diff options
author | David Corrales | 2007-08-05 19:34:20 +0000 |
---|---|---|
committer | David Corrales | 2007-08-05 19:34:20 +0000 |
commit | 6856535010bd2fa4449bcfde1c88dc06cd46e26f (patch) | |
tree | b81a2234c2beff0312c93e039d6cafda4babeca6 /engines/gob/util.cpp | |
parent | 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 (diff) | |
parent | ec1803f838d5efc7decf75c05a1fb4a9633751e5 (diff) | |
download | scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.gz scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.bz2 scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.zip |
Merged fsnode with trunk: r27971:28460
svn-id: r28462
Diffstat (limited to 'engines/gob/util.cpp')
-rw-r--r-- | engines/gob/util.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index ff6333aa9e..40acf21f9e 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -32,7 +32,6 @@ #include "gob/dataio.h" #include "gob/draw.h" #include "gob/game.h" -#include "gob/imd.h" #include "gob/sound.h" #include "gob/video.h" @@ -50,6 +49,9 @@ uint32 Util::getTimeKey(void) { } int16 Util::getRandom(int16 max) { + if (max == 0) + return 0; + return _vm->_rnd.getRandomNumber(max - 1); } @@ -126,8 +128,8 @@ void Util::processInput(bool scroll) { _vm->_global->_speedFactor = MIN(_fastMode + 1, 3); if (scroll && hasMove) { - if (y >= (200 - _vm->_video->_splitHeight2)) { - y = 200 - _vm->_video->_splitHeight2 - 1; + if (y >= (_vm->_height - _vm->_video->_splitHeight2)) { + y = _vm->_height - _vm->_video->_splitHeight2 - 1; _vm->_util->setMousePos(x, y); } _vm->_game->evaluateScroll(x, y); @@ -301,7 +303,6 @@ void Util::setFrameRate(int16 rate) { _vm->_global->_frameWaitTime = 1000 / rate; _vm->_global->_startFrameTime = getTimeKey(); - _vm->_imdPlayer->_frameDelay = 0; } void Util::waitEndFrame() { @@ -312,17 +313,13 @@ void Util::waitEndFrame() { time = getTimeKey() - _vm->_global->_startFrameTime; if ((time > 1000) || (time < 0)) { _vm->_global->_startFrameTime = getTimeKey(); - _vm->_imdPlayer->_frameDelay = 0; return; } - if (_vm->_global->_frameWaitTime - time > 0) { - _vm->_imdPlayer->_frameDelay = 0; - delay(_vm->_global->_frameWaitTime - _vm->_imdPlayer->_frameDelay - time); - } + if ((_vm->_global->_frameWaitTime - time) > 0) + delay(_vm->_global->_frameWaitTime - time); _vm->_global->_startFrameTime = getTimeKey(); - _vm->_imdPlayer->_frameDelay = time - _vm->_global->_frameWaitTime; } void Util::setScrollOffset(int16 x, int16 y) { |