|
From: knittl <kn...@us...> - 2009-08-03 08:41:01
|
Module: performous
Branch: master
Commit: 4145b20588ce7c7fc5fe9af3d5a092eb6cc597b3
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Aug 1 22:31:22 2009 +0300
Fix guitar gameplay.
---
game/guitargraph.cc | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 2e1951a..2a9b49e 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -58,24 +58,22 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
void GuitarGraph::engine(double time) {
for (input::Event ev; m_input.tryPoll(ev);) {
- if (m_drums) {
- if (ev.type == input::Event::PRESS) drumHit(time, ev.button);
- } else {
- if (time < -0.5) {
- if (ev.type == input::Event::PICK) {
- if (ev.pressed[4]) {
- ++m_track;
- if (!difficulty(m_level)) difficultyAuto();
- }
- if (ev.pressed[0]) difficulty(DIFFICULTY_SUPAEASY);
- else if (ev.pressed[1]) difficulty(DIFFICULTY_EASY);
- else if (ev.pressed[2]) difficulty(DIFFICULTY_MEDIUM);
- else if (ev.pressed[3]) difficulty(DIFFICULTY_AMAZING);
+ if (time < -0.5) {
+ if (ev.type == input::Event::PICK || (m_drums && ev.type == input::Event::PRESS)) {
+ if (ev.pressed[4]) {
+ ++m_track;
+ if (!difficulty(m_level)) difficultyAuto();
}
- continue;
+ if (ev.pressed[0]) difficulty(DIFFICULTY_SUPAEASY);
+ else if (ev.pressed[1]) difficulty(DIFFICULTY_EASY);
+ else if (ev.pressed[2]) difficulty(DIFFICULTY_MEDIUM);
+ else if (ev.pressed[3]) difficulty(DIFFICULTY_AMAZING);
}
+ } else if (m_drums) {
+ if (ev.type == input::Event::PRESS) drumHit(time, ev.button);
+ } else {
+ if (ev.type == input::Event::PRESS || ev.type == input::Event::PICK) guitarPlay(time, ev);
}
- if (m_score < 0) m_score = 0;
}
}
|