|
From: Tapio V. <aa...@us...> - 2010-04-21 09:50:27
|
Module: performous
Branch: master
Commit: 5e00aa00ca9951cae25421cc2bb2f7334a04d9d3
Author: Tapio Vierros <tap...@gm...>
Date: Wed Apr 21 12:49:59 2010 +0300
Lefty-mode for drums.
---
game/guitargraph.cc | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 1255692..e29b2fd 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -222,6 +222,9 @@ void GuitarGraph::engine() {
}
if (ev.type == input::Event::RELEASE) endHold(ev.button, time);
if (ev.type == input::Event::WHAMMY) whammy = (1.0 + ev.button + 2.0*(rand()/double(RAND_MAX))) / 4.0;
+ } else {
+ // Handle drum lefty-mode
+ if (m_leftymode && ev.button > 0) ev.button = 5 - ev.button;
}
// Keypress anims
if (ev.type == input::Event::PRESS) m_hit[!m_drums + ev.button].setValue(1.0);
@@ -237,7 +240,7 @@ void GuitarGraph::engine() {
difficulty_changed = true;
}
// Lefty-mode switch
- if (!m_drums && ev.type == input::Event::PRESS && ev.pressed[0] && ev.pressed[1])
+ if (ev.type == input::Event::PRESS && ev.pressed[1] && ev.pressed[(m_drums ? 2 : 1)])
m_leftymode = !m_leftymode;
// Playing
} else if (m_drums) {
|