diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 5e7d1bf6b1..ff60ba75a4 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -88,7 +88,7 @@ struct AutoJoyMapping const char *szControllerName; // the product name of the controller struct InputMapper::Mapping maps[32]; }; -#define END_MARKER {-1, DeviceButton_Invalid, -1, false }, // end marker +#define END_MARKER {-1, DeviceButton_Invalid, GameButton_Invalid, false }, // end marker const AutoJoyMapping g_AutoJoyMappings[] = { { @@ -484,6 +484,8 @@ void InputMapper::Unmap( InputDevice id ) void InputMapper::ApplyMapping( const Mapping *maps, GameController gc, InputDevice id ) { + map MappedButtons; + for( int k=0; !maps[k].IsEndMarker(); k++ ) { GameController map_gc = gc; @@ -500,7 +502,9 @@ void InputMapper::ApplyMapping( const Mapping *maps, GameController gc, InputDev DeviceInput di( id, maps[k].deviceButton ); GameInput gi( map_gc, maps[k].gb ); - SetInputMap( di, gi, maps[k].iSlotIndex ); + int iSlot = MappedButtons[gi]; + ++MappedButtons[gi]; + SetInputMap( di, gi, iSlot );//maps[k].iSlotIndex ); } } diff --git a/stepmania/src/InputMapper.h b/stepmania/src/InputMapper.h index 80afe3bb5b..a28faf7683 100644 --- a/stepmania/src/InputMapper.h +++ b/stepmania/src/InputMapper.h @@ -80,11 +80,11 @@ public: struct Mapping { - bool IsEndMarker() const { return iSlotIndex==-1; } + bool IsEndMarker() const { return gb == GameButton_Invalid; } - int iSlotIndex; // -1 == end marker + int iSlotIndex; DeviceButton deviceButton; - GameButton gb; + GameButton gb; // GameButton_Invalid == end marker /* * If this is true, this is an auxilliary mapping assigned to the second