From 24d5d5220ca4da8df257dba6384898522a2ff07e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 12 Jan 2007 06:03:08 +0000 Subject: [PATCH] move out InputMapper::Mapping --- stepmania/src/InputMapper.cpp | 2 +- stepmania/src/InputMapper.h | 38 ++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index ff60ba75a4..e23a0c0006 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -86,7 +86,7 @@ struct AutoJoyMapping const char *szGame; const char *szDriverRegex; // reported by InputHandler const char *szControllerName; // the product name of the controller - struct InputMapper::Mapping maps[32]; + InputMapper::Mapping maps[32]; }; #define END_MARKER {-1, DeviceButton_Invalid, GameButton_Invalid, false }, // end marker const AutoJoyMapping g_AutoJoyMappings[] = diff --git a/stepmania/src/InputMapper.h b/stepmania/src/InputMapper.h index a28faf7683..86b91b6a28 100644 --- a/stepmania/src/InputMapper.h +++ b/stepmania/src/InputMapper.h @@ -13,6 +13,25 @@ const int NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3; const int NUM_USER_GAME_TO_DEVICE_SLOTS = 2; #define NO_DEFAULT_KEY DeviceButton_Invalid +struct InputMapping +{ + bool IsEndMarker() const { return gb == GameButton_Invalid; } + + int iSlotIndex; + DeviceButton deviceButton; + GameButton gb; // GameButton_Invalid == end marker + + /* + * If this is true, this is an auxilliary mapping assigned to the second + * player. If two of the same device are found, and the device has secondary + * entries, the later entries take precedence. This way, if a Pump pad is + * found, it'll map P1 to the primary pad and P2 to the secondary pad. + * (We can't tell if a slave pad is actually there.) Then, if a second primary + * is found (DEVICE_PUMP2), 2P will be mapped to it. + */ + bool SecondController; +}; + class InputScheme { public: @@ -78,24 +97,7 @@ public: void RepeatStopKey( const GameInput &GameI ); void RepeatStopKey( MenuButton MenuI, PlayerNumber pn ); - struct Mapping - { - bool IsEndMarker() const { return gb == GameButton_Invalid; } - - int iSlotIndex; - DeviceButton deviceButton; - GameButton gb; // GameButton_Invalid == end marker - - /* - * If this is true, this is an auxilliary mapping assigned to the second - * player. If two of the same device are found, and the device has secondary - * entries, the later entries take precedence. This way, if a Pump pad is - * found, it'll map P1 to the primary pad and P2 to the secondary pad. - * (We can't tell if a slave pad is actually there.) Then, if a second primary - * is found (DEVICE_PUMP2), 2P will be mapped to it. - */ - bool SecondController; - }; + typedef InputMapping Mapping; static InputDevice MultiPlayerToInputDevice( MultiPlayer mp ); static MultiPlayer InputDeviceToMultiPlayer( InputDevice id );