aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/events.cpp')
-rw-r--r--engines/titanic/events.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 038bc8b83b..d6f12f5c7d 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -86,6 +86,9 @@ bool Events::checkForNextFrameCounter() {
++_frameCounter;
_priorFrameTime = milli;
+ // Handle any idle updates
+ onIdle();
+
// Give time to the debugger
_vm->_debugger->onFrame();
@@ -102,6 +105,22 @@ uint32 Events::getTicksCount() const {
return g_system->getMillis();
}
+void Events::onIdle() {
+ if (!_vm->_window->_inputAllowed)
+ return;
+ CGameManager *gameManager = _vm->_window->_gameManager;
+ if (!gameManager)
+ return;
+
+ // Let the game manager perform any game updates
+ gameManager->update();
+
+ if (gameManager->_gameState._field20) {
+ // Game needs to shut down
+ _vm->quitGame();
+ }
+}
+
#define HANDLE_MESSAGE(METHOD) if (_vm->_window->_inputAllowed) { \
_vm->_window->_gameManager->_inputTranslator.METHOD(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
_vm->_window->mouseChanged(); \