diff options
author | Nicola Mettifogo | 2009-01-04 15:09:28 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2009-01-04 15:09:28 +0000 |
commit | a53fa36913d3effba490d1d179c27833684b2635 (patch) | |
tree | cfb35c6ae74a36d702e1f2f6a412484a49056de2 /engines/parallaction | |
parent | 203358bcb70a8fe0954feccd2c7559ea7d9ade35 (diff) | |
download | scummvm-rg350-a53fa36913d3effba490d1d179c27833684b2635.tar.gz scummvm-rg350-a53fa36913d3effba490d1d179c27833684b2635.tar.bz2 scummvm-rg350-a53fa36913d3effba490d1d179c27833684b2635.zip |
Made sure each event is processed only once. This wasn't always the case when _inputMode changed as a result of a game action. This also caused the comment mode to be apparently skipped.
svn-id: r35725
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/input.cpp | 9 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 21 |
2 files changed, 26 insertions, 4 deletions
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 4904e63df6..3bedebb7f3 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -212,6 +212,8 @@ int Input::updateGameInput() { int Input::updateInput() { + int oldMode = _inputMode; + int event = kEvNone; readInput(); @@ -225,6 +227,13 @@ int Input::updateInput() { break; } + // when mode changes, then consider any input consumed + // for the current frame + if (oldMode != _inputMode) { + _mouseButtons = kEvNone; + _hasKeyPressEvent = false; + } + return event; } diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index d8e5a43631..272152cd69 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -341,10 +341,23 @@ void Parallaction::runGame() { if (shouldQuit()) return; - runGuiFrame(); - runDialogueFrame(); - runCommentFrame(); - runGameFrame(event); + switch (_input->_inputMode) { + case Input::kInputModeMenu: + runGuiFrame(); + break; + + case Input::kInputModeDialogue: + runDialogueFrame(); + break; + + case Input::kInputModeComment: + runCommentFrame(); + break; + + case Input::kInputModeGame: + runGameFrame(event); + break; + } if (shouldQuit()) return; |