Style normalizations to the joystick code.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@349 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
2b78c976ea
commit
1fe1473fbb
@ -533,7 +533,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
|
|||||||
*/
|
*/
|
||||||
void fgJoystickInit( int ident )
|
void fgJoystickInit( int ident )
|
||||||
{
|
{
|
||||||
if( fgJoystick != NULL )
|
if( fgJoystick )
|
||||||
fgError( "illegal attemp to initialize joystick device" );
|
fgError( "illegal attemp to initialize joystick device" );
|
||||||
|
|
||||||
fgJoystick = ( SFG_Joystick * )calloc( sizeof( SFG_Joystick ), 1 );
|
fgJoystick = ( SFG_Joystick * )calloc( sizeof( SFG_Joystick ), 1 );
|
||||||
@ -575,7 +575,7 @@ void fgJoystickInit( int ident )
|
|||||||
*/
|
*/
|
||||||
void fgJoystickClose( void )
|
void fgJoystickClose( void )
|
||||||
{
|
{
|
||||||
if( fgJoystick == NULL )
|
if( !fgJoystick )
|
||||||
fgError( "illegal attempt to deinitialize joystick device" );
|
fgError( "illegal attempt to deinitialize joystick device" );
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@ -596,7 +596,8 @@ void fgJoystickPollWindow( SFG_Window* window )
|
|||||||
float axes[ _JS_MAX_AXES ];
|
float axes[ _JS_MAX_AXES ];
|
||||||
int buttons;
|
int buttons;
|
||||||
|
|
||||||
freeglut_return_if_fail( fgJoystick != NULL && window != NULL );
|
freeglut_return_if_fail( fgJoystick );
|
||||||
|
freeglut_return_if_fail( window );
|
||||||
freeglut_return_if_fail( FETCH_WCB( *window, Joystick ) );
|
freeglut_return_if_fail( FETCH_WCB( *window, Joystick ) );
|
||||||
|
|
||||||
fghJoystickRead( fgJoystick, &buttons, axes );
|
fghJoystickRead( fgJoystick, &buttons, axes );
|
||||||
|
Reference in New Issue
Block a user