aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-14 21:45:16 +0000
committerMartin Kiewitz2009-10-14 21:45:16 +0000
commita7e51b8276df7123c6471c1bf212729e181b4642 (patch)
treecfd404bb54ff8a641de358f90dedb379688af4ad
parentbc49c6e63ed0ba4eb7f8b372872505665aec2383 (diff)
downloadscummvm-rg350-a7e51b8276df7123c6471c1bf212729e181b4642.tar.gz
scummvm-rg350-a7e51b8276df7123c6471c1bf212729e181b4642.tar.bz2
scummvm-rg350-a7e51b8276df7123c6471c1bf212729e181b4642.zip
SCI: kAnimate now delays a bit if needed (fixes typing in intro of lsl5, kq6 sierra logo and much more)
svn-id: r45093
-rw-r--r--engines/sci/engine/kgraphics.cpp10
-rw-r--r--engines/sci/engine/state.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 22492d1718..8d26eda207 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -933,6 +933,16 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) {
process_sound_events(s);
s->_gui->animate(castListReference, cycle, argc, argv);
+
+ // Do some speed throttling to calm down games that rely on counting cycles
+ uint32 curTime = g_system->getMillis();
+ uint32 duration = curTime - s->_lastAnimateTime;
+
+ if (duration < 50) {
+ g_system->delayMillis(50-duration);
+ }
+ s->_lastAnimateTime = curTime;
+
return s->r_acc;
}
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index bcf7c8309a..6b0aeb6028 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -218,6 +218,8 @@ 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 _lastAnimateTime; /**< last time kAnimate was invoked */
+
/* Kernel File IO stuff */
Common::Array<FileHandle> _fileHandles; /**< Array of file handles. Dynamically increased if required. */