|
From: Tapio V. <aa...@us...> - 2010-01-10 21:42:59
|
Module: performous
Branch: master
Commit: b10daaf077b0ae77b7f781d6f3363d1428e7c342
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jan 10 23:42:19 2010 +0200
Fixes to instrument type forcing.
---
data/schema.xml | 2 +-
game/joystick.cc | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index a3168d7..fed2106 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -85,7 +85,7 @@ to save the current settings to XML.
</locale>
</entry>
<entry name="game/instruments" type="string_list">
- <!-- Should be SDL_ID:{GUITAR_GUITARHERO|GUITAR_ROCKBAND|DRUMS_GUITARHERO|DRUMS_ROCKBAND}
+ <!-- Should be SDL_ID:{GUITAR_GUITARHERO|GUITAR_ROCKBAND|DRUMS_GUITARHERO|DRUMS_ROCKBAND|DRUMS_MIDI|DANCEPAD_GENERIC}
example:
<stringvalue>0:GUITAR_GUITARHERO</stringvalue>
-->
diff --git a/game/joystick.cc b/game/joystick.cc
index 1a6cdfd..a4b1afa 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -177,7 +177,7 @@ void input::SDL::init() {
std::map<unsigned int, input::Private::Type> forced_type;
using namespace boost::spirit::classic;
- rule<> type = str_p("GUITAR_GUITARHERO") | "GUITAR_ROCKBAND" | "DRUMS_GUITARHERO" | "DRUMS_ROCKBAND";
+ rule<> type = str_p("GUITAR_GUITARHERO") | "GUITAR_ROCKBAND" | "DRUMS_GUITARHERO" | "DRUMS_ROCKBAND" | "DRUMS_MIDI" | "DANCEPAD_GENERIC";
rule<> entry = uint_p[assign_a(sdl_id)] >> ":" >> (type)[assign_a(instrument_type)];
ConfigItem::StringList const& instruments = config["game/instruments"].sl();
@@ -193,7 +193,11 @@ void input::SDL::init() {
} else if (instrument_type == "GUITAR_ROCKBAND") {
forced_type[sdl_id] = input::Private::GUITAR_RB;
} else if (instrument_type == "DRUMS_ROCKBAND") {
- forced_type[sdl_id] = input::Private::DRUMS_GH;
+ forced_type[sdl_id] = input::Private::DRUMS_RB;
+ } else if (instrument_type == "DRUMS_MIDI") {
+ forced_type[sdl_id] = input::Private::DRUMS_MIDI;
+ } else if (instrument_type == "DANCEPAD_GENERIC") {
+ forced_type[sdl_id] = input::Private::DANCEPAD_GENERIC;
}
}
}
|