|
From: knittl <kn...@us...> - 2009-08-03 08:40:25
|
Module: performous
Branch: master
Commit: bc368146609b9bf157af69186607ff9075bc678d
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 1 15:52:44 2009 +0200
Fixed compilation error inside joystick.hh
---
game/joystick.hh | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 748cd9d..9764e9a 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -111,23 +111,21 @@ namespace input {
bool assigned() {return m_assigned;};
bool pressed(int _button) {return m_pressed[_button];};
input::Private::Type type() {return m_type;};
- bool type_match( input::Type _type) {
- if( _type == input::UNKNOWN && m_type == input::Private::UNKNOWN ) {
- return true;
- } else if( _type == input::GUITAR &&
+ bool type_match( input::DevType _type) {
+ if( _type == input::GUITAR &&
(m_type == input::Private::GUITAR_GH || m_type == input::Private::GUITAR_RB) ) {
return true;
- } else if( _type == input::DRUM &&
+ } else if( _type == input::DRUMS &&
(m_type == input::Private::DRUM_GH || m_type == input::Private::DRUM_RB) ) {
return true;
} else {
return false;
}
};
- void setType(input::Type _type) {
+ void setType(input::DevType _type) {
if( _type == input::GUITAR ) {
m_type = input::Private::GUITAR_RB;
- } else if( _type == input::DRUM ) {
+ } else if( _type == input::DRUMS ) {
m_type = input::Private::DRUM_RB;
} else {
m_type = input::Private::UNKNOWN;
@@ -160,14 +158,6 @@ namespace input {
return;
}
}
- for(InputDevs::iterator it = devices.begin() ; it != devices.end() ; ++it) {
- if( !it->second.assigned() && it->second.type_match(input::UNKNOWN) ) {
- m_device_id = it->first;
- it->second.setType(_type);
- it->second.assign();
- return;
- }
- }
throw std::runtime_error("No matching instrument available");
};
~InputDev() {input::Private::devices[m_device_id].unassign();};
|