aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorRobert Göffringmann2005-12-13 15:05:06 +0000
committerRobert Göffringmann2005-12-13 15:05:06 +0000
commitf74b5711a6b55d59e0a6010e592783936f4fef59 (patch)
tree70b90c22c907ff23ba6bae8010a9caf5be507a3e /sky
parentc477d545707aacaa8dbfe1bfcc0f8f83f9e772fc (diff)
downloadscummvm-rg350-f74b5711a6b55d59e0a6010e592783936f4fef59.tar.gz
scummvm-rg350-f74b5711a6b55d59e0a6010e592783936f4fef59.tar.bz2
scummvm-rg350-f74b5711a6b55d59e0a6010e592783936f4fef59.zip
changed delay code
svn-id: r19792
Diffstat (limited to 'sky')
-rw-r--r--sky/sky.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/sky/sky.cpp b/sky/sky.cpp
index 97db0b402d..f88ee27cbd 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -244,6 +244,7 @@ int SkyEngine::go() {
_lastSaveTime = _system->getMillis();
+ uint32 delayCount = _system->getMillis();
while (!_systemVars.quitGame) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -260,10 +261,13 @@ int SkyEngine::go() {
_skySound->checkFxQueue();
_skyMouse->mouseEngine((uint16)_mouseX, (uint16)_mouseY);
handleKey();
- while (_systemVars.paused) {
- _system->updateScreen();
- delay(300);
- handleKey();
+ if (_systemVars.paused) {
+ do {
+ _system->updateScreen();
+ delay(50);
+ handleKey();
+ } while (_systemVars.paused);
+ delayCount = _system->getMillis();
}
_skyLogic->engine();
@@ -279,8 +283,15 @@ int SkyEngine::go() {
delay(0);
else if (_fastMode & 1)
delay(10);
- else
- delay((frameTime + _systemVars.gameSpeed) - _system->getMillis());
+ else {
+ delayCount += _systemVars.gameSpeed;
+ int needDelay = delayCount - (int)_system->getMillis();
+ if ((needDelay < 0) || (needDelay > 4 * _systemVars.gameSpeed)) {
+ needDelay = 0;
+ delayCount = _system->getMillis();
+ }
+ delay(needDelay);
+ }
}
_skyControl->showGameQuitMsg();