Browse files

changed names to be in the same format as those in PSL1GHT libs

  • Loading branch information...
1 parent 11155d3 commit 2fffd74dbc68fa3f9372e2ce873794a3666ecbf8 @wargio committed Jan 18, 2013
Showing with 38 additions and 40 deletions.
  1. +11 −12 libmove/libmove.cpp
  2. +16 −11 libmove/libmove/libmove.h
  3. +1 −0 libmove/libmove/moveutil.h
  4. +10 −17 sample/libmove-NoRSX/source/main.cpp
View
23 libmove/libmove.cpp
@@ -5,8 +5,7 @@ static int _gem_loaded = LIBMOVE_ERROR;
static moveContext *move_context = NULL;
-
-int init_move(){
+int initLibMove(){
int ret;
_camera_loaded = !sysModuleIsLoaded (SYSMODULE_CAMERA);
if (!_camera_loaded)
@@ -32,7 +31,7 @@ int init_move(){
return ret;
}
-int end_move(){
+int endLibMove(){
if (move_context){
endMove (move_context);
move_context = NULL;
@@ -43,20 +42,20 @@ int end_move(){
return LIBMOVE_ERROR;
}
-int camera_is_loaded(){
+int cameraIsLoaded(){
return _camera_loaded;
}
-int move_is_loaded(){
+int moveIsLoaded(){
return _gem_loaded;
}
-void get_3d_position(int pad_number, float *x, float *y, float *z){
+void get3DPosition(int pad_number, float *x, float *y, float *z){
processMove(move_context, pad_number);
moveGet3DPosition(move_context, x, y, z);
}
-void get_gyro_position(int pad_number, float *x, float *y, float *z){
+void getGyroPosition(int pad_number, float *x, float *y, float *z){
processMove (move_context, pad_number);
gemInertialState gem_inert;
gemGetInertialState (0, 0, 0, &gem_inert);
@@ -78,24 +77,24 @@ void getMovePadData(int pad_number, movePadData *data){
data->ANA_T = move_context->state.paddata.ANA_T;
}
-void set_move_led_color(int pad_number, f32 red, f32 green, f32 blue){
+void setMoveLedColor(int pad_number, f32 red, f32 green, f32 blue){
gemReset(pad_number);
processMove(move_context, pad_number, red, green, blue);
}
-int move_reset(int pad_number){
+int moveReset(int pad_number){
return gemReset(pad_number);
}
-void calibrate_move(int pad_number){
+void calibrateMove(int pad_number){
gemCalibrate(pad_number);
}
-void move_set_rumble(int pad_number, u8 intensity){
+void moveSetRumble(int pad_number, u8 intensity){
gemSetRumble(pad_number, intensity);
}
-u8 move_get_rumble(int pad_number){
+u8 moveGetRumble(int pad_number){
u8 intensity;
gemGetRumble(pad_number, &intensity);
return intensity;
View
27 libmove/libmove/libmove.h
@@ -15,30 +15,35 @@
#define PLAYSTATION_MOVE_PAD_0 0
#define PLAYSTATION_MOVE_PAD_1 1
#define PLAYSTATION_MOVE_PAD_2 2
+#define PLAYSTATION_MOVE_PAD_3 3
+#define PLAYSTATION_MOVE_PAD_4 4
+#define PLAYSTATION_MOVE_PAD_5 5
+#define PLAYSTATION_MOVE_PAD_6 6
+#define PLAYSTATION_MOVE_PAD_7 7
/*
* This function initialize lib move. to use this, you need an EyeToy or a PS Eye, and a PS Move.
* Return LIBMOVE_OK if nothing went wrong.
*/
-int init_move();
+int initLibMove();
/*
* This function terminate lib move.
* Return LIBMOVE_OK if nothing went wrong.
*/
-int end_move();
+int endLibMove();
/*
* This function return the camera status.
* Return LIBMOVE_OK if everything is fine.
*/
-int camera_is_loaded();
+int cameraIsLoaded();
/*
* This function return the gem status.
* Return LIBMOVE_OK if everything is fine.
*/
-int move_is_loaded();
+int moveIsLoaded();
/*
* This function get the PS Move 3D Position value
@@ -47,7 +52,7 @@ int move_is_loaded();
* get_3d_position( PLAYSTATION_MOVE_PAD_0 , &x, &y, &z );
*/
-void get_3d_position(int pad_number, float *x, float *y, float *z);
+void get3DPosition(int pad_number, float *x, float *y, float *z);
/*
* This function get the PS Move Gyroscopic value
@@ -56,7 +61,7 @@ void get_3d_position(int pad_number, float *x, float *y, float *z);
* get_gyro_position( PLAYSTATION_MOVE_PAD_0 , &x, &y, &z );
*/
-void get_gyro_position(int pad_number, float *x, float *y, float *z);
+void getGyroPosition(int pad_number, float *x, float *y, float *z);
/*
* This function get the PS Move Buttons
@@ -70,23 +75,23 @@ void getMovePadData(int pad_number, movePadData *data);
* an example: set_move_led_color( PLAYSTATION_MOVE_PAD_0 , 0.5, 0.5, 0.5 );
*/
-void set_move_led_color(int pad_number, f32 red, f32 green, f32 blue);
+void setMoveLedColor(int pad_number, f32 red, f32 green, f32 blue);
/*
* This function should reset the PS Move
*/
-int move_reset(int pad_number);
+int moveReset(int pad_number);
/*
* This function recalibrate the PS Move
*/
-void calibrate_move(int pad_number);
+void calibrateMove(int pad_number);
/*
* These functions set and get the Rumble intensity of the PS Move
*/
-void move_set_rumble(int pad_number, u8 intensity);
-u8 move_get_rumble(int pad_number);
+void moveSetRumble(int pad_number, u8 intensity);
+u8 moveGetRumble(int pad_number);
#endif
View
1 libmove/libmove/moveutil.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) Antonio José Ramos Márquez (bigboss)
* Copyright (C) Youness Alaoui (KaKaRoTo)
+ * Copyright (C) 2013, Giovanni Dante Grazioli (deroad)
*/
#ifndef __LIBMOVE_MOVEUTIL_H__
View
27 sample/libmove-NoRSX/source/main.cpp
@@ -31,9 +31,9 @@ s32 main(s32 argc, const char* argv[])
padData paddata;
ioPadInit(7);
- init_move();
+ initLibMove();
- set_move_led_color(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
+ setMoveLedColor(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
NoRSX *GFX = new NoRSX(RESOLUTION_1920x1080); //set defined screen resolution You can change it to:
//RESOLUTION_720x480 | RESOLUTION_720x576 | RESOLUTION_1280x720 | RESOLUTION_1920x1080
@@ -55,22 +55,17 @@ s32 main(s32 argc, const char* argv[])
F1.PrintfToBitmap(150,400,&Precalculated_Layer,COLOR_YELLOW, 35,"Press start to exit! (move)");
GFX->AppStart();
- int frame=0;
float x=GFX->width*0.5,y=GFX->height*0.5,z=0;
float x1=0,y1=0,z1=0;
movePadData data;
- get_gyro_position(PLAYSTATION_MOVE_PAD_0,&x1,&y1,&z1);
+ getGyroPosition(PLAYSTATION_MOVE_PAD_0,&x1,&y1,&z1);
x=GFX->width*0.5-x1;
y=GFX->height*0.5-y1;
z=-z1;
while(GFX->GetAppStatus()){
- static time_t starttime = 0;
- double fps = 0;
- if (starttime == 0) starttime = time (NULL);
- else fps = frame / difftime (time (NULL), starttime);
BMap.DrawBitmap(&Precalculated_Layer);
getMovePadData(PLAYSTATION_MOVE_PAD_0, &data);
@@ -84,17 +79,17 @@ s32 main(s32 argc, const char* argv[])
}
if(data.BTN_ACTION){
- calibrate_move(PLAYSTATION_MOVE_PAD_0);
- set_move_led_color(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
- get_gyro_position(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
+ calibrateMove(PLAYSTATION_MOVE_PAD_0);
+ setMoveLedColor(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
+ getGyroPosition(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
x=GFX->width*0.5-x1;
y=GFX->height*0.5-y1;
z=-z1;
}
- get_3d_position(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
+ get3DPosition(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
F1.Printf(150,200,COLOR_WHITE,30,"3D: x %.2f, y %.2f, z %.2f",x1,y1,z1);
- get_gyro_position(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
+ getGyroPosition(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
F1.Printf(150,300,COLOR_WHITE,30,"Gyro: x %.2f, y %.2f, z %.2f",x1,y1,z1);
@@ -111,7 +106,6 @@ s32 main(s32 argc, const char* argv[])
else if(y<0) y = 0;
- F1.Printf(150,100,COLOR_RED,60,"FPS %f", fps);
if(data.BTN_CROSS)
F1.Printf(150,150,COLOR_RED,60,"BTN_CROSS");
if(data.BTN_CIRCLE)
@@ -136,13 +130,12 @@ s32 main(s32 argc, const char* argv[])
F1.Printf(150,250,COLOR_WHITE,30,"Trigger T 0x%04x",data.ANA_T);
OBJ.Rectangle(x-5, y-5 , 10, 10, COLOR_WHITE);
GFX->Flip();
- move_set_rumble(PLAYSTATION_MOVE_PAD_0, (u8)data.ANA_T);
- frame ++;
+ moveSetRumble(PLAYSTATION_MOVE_PAD_0, (u8)data.ANA_T);
}
end:
//You need to clean the Bitmap before exit
BMap.ClearBitmap(&Precalculated_Layer);
- end_move();
+ endLibMove();
GFX->NoRSX_Exit();
ioPadEnd();
return 0;

0 comments on commit 2fffd74

Please sign in to comment.