diff options
author | Martin Kiewitz | 2009-10-16 18:46:18 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-16 18:46:18 +0000 |
commit | 2ada85b6cc1331036cb0a24b7d085585ce30776d (patch) | |
tree | 7f3d93b62a9ce5e19f744f5ad8d32e55593528cf | |
parent | 620fa7c6414e98949537b9b759c65ea336fb64d0 (diff) | |
download | scummvm-rg350-2ada85b6cc1331036cb0a24b7d085585ce30776d.tar.gz scummvm-rg350-2ada85b6cc1331036cb0a24b7d085585ce30776d.tar.bz2 scummvm-rg350-2ada85b6cc1331036cb0a24b7d085585ce30776d.zip |
SCI: kAnimate now delays the first few calls less, otherwise sq3 will remove details graphicwise. Walter please check, if this creates a regression with lsl3.
svn-id: r45173
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 12 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 6132753c11..3551286dbd 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -941,9 +941,17 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) { // Do some speed throttling to calm down games that rely on counting cycles uint32 curTime = g_system->getMillis(); uint32 duration = curTime - s->_lastAnimateTime; + uint32 neededSleep = 40; - if (duration < 40) { - gfxop_sleep(s->gfx_state, 40-duration); + // We are doing this, so that games like sq3 dont think we are running too slow and will remove details (like + // animated sierra logo at the beginning). Hopefully this wont cause regressions with pullups in lsl3 (FIXME?) + if (s->_lastAnimateCounter < 10) { + s->_lastAnimateCounter++; + neededSleep = 8; + } + + if (duration < neededSleep) { + gfxop_sleep(s->gfx_state, neededSleep - duration); s->_lastAnimateTime = g_system->getMillis(); } else { s->_lastAnimateTime = curTime; diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 3f8eae5e49..e850c8b07f 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -106,6 +106,7 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, successor = 0; + _lastAnimateCounter = 0; _lastAnimateTime = 0; _setCursorType = SCI_VERSION_AUTODETECT; diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 204867b714..4f08994ffc 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -178,6 +178,7 @@ public: uint32 game_start_time; /**< The time at which the interpreter was started */ uint32 last_wait_time; /**< The last time the game invoked Wait() */ + uint32 _lastAnimateCounter; /**< total times kAnimate was invoked */ uint32 _lastAnimateTime; /**< last time kAnimate was invoked */ /* Kernel File IO stuff */ |