From 8f6dcdbecc135f11f27e7d5d78bb673e5ced07b2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 28 Dec 2005 09:14:15 +0000 Subject: [PATCH] blind updates (probably incomplete, since this driver differs more widely from my code) --- .../arch/InputHandler/InputHandler_Carbon.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp index 324457ad38..e91299197f 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp @@ -48,7 +48,7 @@ struct Joystick { InputDevice id; // map cookie to button - hash_map mapping; + hash_map mapping; int x_axis, y_axis, z_axis; int x_min, y_min, z_min; int x_max, y_max, z_max; @@ -412,9 +412,9 @@ void JoystickDevice::AddElement( int usagePage, int usage, int cookie, const CFD { // button n has usage = n, subtract 1 to ensure // button 1 = JOY_BUTTON_1 - const int buttonID = usage + JOY_BUTTON_1 - 1; + const DeviceButton buttonID = enum_add2( JOY_BUTTON_1, usage - 1 ); - if( buttonID < NUM_JOYSTICK_BUTTONS ) + if( buttonID <= JOY_BUTTON_32 ) js.mapping[cookie] = buttonID; break; } @@ -437,7 +437,7 @@ void JoystickDevice::Open() if( js.z_axis ) AddElementToQueue( js.z_axis ); - for( hash_map::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j ) + for( hash_map::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j ) AddElementToQueue( j->first ); } } @@ -452,7 +452,7 @@ int JoystickDevice::AssignJoystickIDs( int startID ) class KeyboardDevice : public Device { private: - hash_map mMapping; + hash_map mMapping; protected: bool AddLogicalDevice( int usagePage, int usage ); @@ -610,7 +610,7 @@ void KeyboardDevice::AddElement( int usagePage, int usage, int cookie, const CFD void KeyboardDevice::Open() { - for (hash_map::const_iterator i = mMapping.begin(); i != mMapping.end(); ++i) + for (hash_map::const_iterator i = mMapping.begin(); i != mMapping.end(); ++i) AddElementToQueue( i->first ); } @@ -637,7 +637,7 @@ void InputHandler_Carbon::QueueCallBack( void *target, int result, void *refcon, if( kd ) { - hash_map::const_iterator iter = kd->mMapping.find( cookie ); + hash_map::const_iterator iter = kd->mMapping.find( cookie ); if( iter != kd->mMapping.end() ) This->ButtonPressed( DeviceInput(DEVICE_KEYBOARD, iter->second, value, now), value ); @@ -675,7 +675,7 @@ void InputHandler_Carbon::QueueCallBack( void *target, int result, void *refcon, else { // hash_map::operator[] is not const - hash_map::const_iterator iter; + hash_map::const_iterator iter; iter = js.mapping.find( cookie ); if( iter != js.mapping.end() )