aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/util.cpp')
-rw-r--r--engines/gob/util.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 64dfcf9b12..5d6ae78872 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -367,21 +367,29 @@ void Util::notifyNewAnim() {
_startFrameTime = getTimeKey();
}
-void Util::waitEndFrame() {
+void Util::waitEndFrame(bool handleInput) {
int32 time;
- _vm->_video->waitRetrace();
-
time = getTimeKey() - _startFrameTime;
if ((time > 1000) || (time < 0)) {
+ _vm->_video->retrace();
_startFrameTime = getTimeKey();
return;
}
- int32 toWait = _frameWaitTime - time;
+ int32 toWait = 0;
+ do {
+ if (toWait > 0)
+ delay(MIN<int>(toWait, 10));
+
+ if (handleInput)
+ processInput();
+
+ _vm->_video->retrace();
- if (toWait > 0)
- delay(toWait);
+ time = getTimeKey() - _startFrameTime;
+ toWait = _frameWaitTime - time;
+ } while (toWait > 0);
_startFrameTime = getTimeKey();
}