From: <z-...@us...> - 2008-01-05 17:45:18
|
Revision: 7474 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7474&view=rev Author: z-man Date: 2008-01-05 09:45:19 -0800 (Sat, 05 Jan 2008) Log Message: ----------- Joystick bindings no longer get lost when AA is started without the appropriate stick plugged in, they get remembered silently. Fixed hat direction. Modified Paths: -------------- armagetronad/trunk/armagetronad/src/ui/uInput.cpp Modified: armagetronad/trunk/armagetronad/src/ui/uInput.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/ui/uInput.cpp 2008-01-05 17:36:52 UTC (rev 7473) +++ armagetronad/trunk/armagetronad/src/ui/uInput.cpp 2008-01-05 17:45:19 UTC (rev 7474) @@ -326,15 +326,11 @@ { input = su_inputs[ value ]; } - else - { - return; - } } if ( !input ) { - input = su_NewInput( id, tString("unknown") ); + input = su_NewInput( id, tString("") ); } tASSERT( input ); @@ -914,8 +910,8 @@ { int & lastDir = joystick->GetHatDirection( hat, 0 ); int newDir = - ( ( hatDirection & SDL_HAT_LEFT ) ? 1 : 0 ) + - ( ( hatDirection & SDL_HAT_RIGHT ) ? -1 : 0 ); + ( ( hatDirection & SDL_HAT_LEFT ) ? +1 : 0 ) + + ( ( hatDirection & SDL_HAT_RIGHT ) ? 1 : 0 ); // negate previous events if ( lastDir < 0 && newDir >= 0 ) @@ -954,8 +950,8 @@ { int & lastDir = joystick->GetHatDirection( hat, 1 ); int newDir = - ( ( hatDirection & SDL_HAT_UP ) ? 1 : 0 ) + - ( ( hatDirection & SDL_HAT_DOWN ) ? -1 : 0 ); + ( ( hatDirection & SDL_HAT_UP ) ? -1 : 0 ) + + ( ( hatDirection & SDL_HAT_DOWN ) ? 1 : 0 ); // negate previous events if ( lastDir < 0 && newDir >= 0 ) @@ -1032,7 +1028,7 @@ for( uInputs::const_iterator i = su_inputs.begin(); i != su_inputs.end(); ++i ) { uBind * bind = (*i)->GetBind(); - if( bind && + if( bind && (*i)->Name().size() > 0 && bind->act==act && bind->CheckPlayer(ePlayer) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |