aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-11-22 21:19:44 +0000
committerNicola Mettifogo2007-11-22 21:19:44 +0000
commitd8e8050015086f4139fb327a2a25a6859b858d8f (patch)
treea4a0175c5149f544a2d328a571414bceb1d1acd8 /engines/parallaction/parallaction.cpp
parentcd3f548407f90128c95deda368f3fd46613e1d5d (diff)
downloadscummvm-rg350-d8e8050015086f4139fb327a2a25a6859b858d8f.tar.gz
scummvm-rg350-d8e8050015086f4139fb327a2a25a6859b858d8f.tar.bz2
scummvm-rg350-d8e8050015086f4139fb327a2a25a6859b858d8f.zip
* added (incomplete) explicit state machine handling in engine class (see _inputMode)
* added service routines to Gfx * changed displayCharacterComment to work with the new state machine and gfx routines svn-id: r29613
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r--engines/parallaction/parallaction.cpp44
1 files changed, 31 insertions, 13 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 1dd377b9a3..5031e7be22 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -270,6 +270,8 @@ void waitUntilLeftClick() {
void Parallaction::runGame() {
+ _inputMode = kInputModeGame;
+
while ((_engineFlags & kEngineQuit) == 0) {
updateInput();
@@ -283,14 +285,13 @@ void Parallaction::runGame() {
changeLocation(_location._name);
}
- eraseAnimations();
-
- runScripts();
- walk();
-
- runJobs();
-
- drawAnimations();
+ if (_inputMode == kInputModeGame) {
+ eraseAnimations();
+ runScripts();
+ walk();
+ runJobs();
+ drawAnimations();
+ }
updateView();
@@ -387,11 +388,7 @@ void Parallaction::processInput(InputData *data) {
-
-
-
-
-void Parallaction::updateInput() {
+void Parallaction::updateGameInput() {
int16 keyDown = readInput();
@@ -429,6 +426,27 @@ void Parallaction::updateInput() {
if (_input._event != kEvNone)
processInput(&_input);
+}
+
+void Parallaction::updateCommentInput() {
+ waitUntilLeftClick();
+
+ _gfx->hideDialogueStuff();
+ _inputMode = kInputModeGame;
+}
+
+void Parallaction::updateInput() {
+
+ switch (_inputMode) {
+ case kInputModeComment:
+ updateCommentInput();
+ break;
+
+ case kInputModeGame:
+ updateGameInput();
+ break;
+ }
+
return;
}