aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mohawk/riven.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index a668052503..37a7745d34 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -216,6 +216,30 @@ void MohawkEngine_Riven::doFrame() {
_stack->keyResetAction();
}
+ processInput();
+
+ _stack->onFrame();
+
+ if (!_scriptMan->runningQueuedScripts()) {
+ // Don't run queued scripts if we are calling from a queued script
+ // otherwise infinite looping will happen.
+ _scriptMan->runQueuedScripts();
+ }
+
+ if (shouldPerformAutoSave(_lastSaveTime)) {
+ tryAutoSaving();
+ }
+
+ _inventory->onFrame();
+
+ // Update the screen once per frame
+ _system->updateScreen();
+
+ // Cut down on CPU usage
+ _system->delayMillis(10);
+}
+
+void MohawkEngine_Riven::processInput() {
Common::Event event;
while (_eventMan->pollEvent(event)) {
switch (event.type) {
@@ -305,26 +329,6 @@ void MohawkEngine_Riven::doFrame() {
break;
}
}
-
- _stack->onFrame();
-
- if (!_scriptMan->runningQueuedScripts()) {
- // Don't run queued scripts if we are calling from a queued script
- // otherwise infinite looping will happen.
- _scriptMan->runQueuedScripts();
- }
-
- if (shouldPerformAutoSave(_lastSaveTime)) {
- tryAutoSaving();
- }
-
- _inventory->onFrame();
-
- // Update the screen once per frame
- _system->updateScreen();
-
- // Cut down on CPU usage
- _system->delayMillis(10);
}
void MohawkEngine_Riven::goToMainMenu() {