aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2007-08-05 01:42:38 +0000
committerSven Hesse2007-08-05 01:42:38 +0000
commitd31d50ac3dbf5c12b126b4d26ba2cd15e7057dcc (patch)
tree7fe57460e90633958e079ad7797b69a2303e75be /engines/gob
parentca01e07a3ce0fe50605aaf199ec8f780198990e0 (diff)
downloadscummvm-rg350-d31d50ac3dbf5c12b126b4d26ba2cd15e7057dcc.tar.gz
scummvm-rg350-d31d50ac3dbf5c12b126b4d26ba2cd15e7057dcc.tar.bz2
scummvm-rg350-d31d50ac3dbf5c12b126b4d26ba2cd15e7057dcc.zip
Possible fix for bug #1767748 (Gobliiins is not fast as it can be on slow computers)
svn-id: r28456
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/game_v1.cpp3
-rw-r--r--engines/gob/video.cpp10
-rw-r--r--engines/gob/video.h1
3 files changed, 9 insertions, 5 deletions
diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp
index 6ba68553c7..9c18ec1151 100644
--- a/engines/gob/game_v1.cpp
+++ b/engines/gob/game_v1.cpp
@@ -911,7 +911,8 @@ void Game_v1::collisionsBlock(void) {
_shouldPushColls = 0;
_vm->_global->_inter_execPtr = savedIP;
deltaTime = timeVal -
- (_vm->_util->getTimeKey() - timeKey);
+ ((_vm->_util->getTimeKey() - timeKey)
+ - _vm->_video->_lastRetraceLength);
if (deltaTime < 2)
deltaTime = 2;
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 83cd436b8a..0dc15a8657 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -94,6 +94,7 @@ Video::Video(GobEngine *vm) : _vm(vm) {
_splitHeight1 = 200;
_splitHeight2 = 0;
_splitStart = 0;
+ _lastRetraceLength = 0;
_curSparse = 0;
_lastSparse = 0xFFFFFFFF;
@@ -161,6 +162,8 @@ SurfaceDesc *Video::initSurfDesc(int16 vidMode, int16 width, int16 height,
}
void Video::retrace(bool mouse) {
+ uint32 time = _vm->_util->getTimeKey();
+
if (mouse)
CursorMan.showMouse((_vm->_draw->_showCursor & 2) != 0);
if (_vm->_global->_primarySurfDesc) {
@@ -173,14 +176,13 @@ void Video::retrace(bool mouse) {
_vm->_height - _splitHeight2, _vm->_width, _splitHeight2);
g_system->updateScreen();
}
+
+ _lastRetraceLength = _vm->_util->getTimeKey() - time;
}
void Video::waitRetrace(bool mouse) {
- uint32 time;
-
- time = _vm->_util->getTimeKey();
retrace(mouse);
- _vm->_util->delay(MAX(1, 10 - (int)(_vm->_util->getTimeKey() - time)));
+ _vm->_util->delay(MAX(1, 10 - (int) _lastRetraceLength));
}
void Video::sparseRetrace(int max) {
diff --git a/engines/gob/video.h b/engines/gob/video.h
index 51d02bd219..dc23bda81e 100644
--- a/engines/gob/video.h
+++ b/engines/gob/video.h
@@ -104,6 +104,7 @@ public:
int16 _splitHeight1;
int16 _splitHeight2;
int16 _splitStart;
+ uint32 _lastRetraceLength;
void freeDriver();
void initPrimary(int16 mode);