aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kmisc.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-23 11:25:48 +0000
committerMartin Kiewitz2009-10-23 11:25:48 +0000
commit9c9181eed6c650cedd359f56f36c3418eefb3e9e (patch)
tree0e1ed3e2353c57b830c3e5c2d33025957f2956c5 /engines/sci/engine/kmisc.cpp
parent770fbdcf538b3185d28752c37bb1f06e9bfb5e22 (diff)
downloadscummvm-rg350-9c9181eed6c650cedd359f56f36c3418eefb3e9e.tar.gz
scummvm-rg350-9c9181eed6c650cedd359f56f36c3418eefb3e9e.tar.bz2
scummvm-rg350-9c9181eed6c650cedd359f56f36c3418eefb3e9e.zip
SCI: speed throttler moved to kGameIsRestarting for all games. Also made the delay shorter. sq3 now seems to work fine, kq1 also has animations and lsl5 mud wrestling is also working correctly.
svn-id: r45345
Diffstat (limited to 'engines/sci/engine/kmisc.cpp')
-rw-r--r--engines/sci/engine/kmisc.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 3e03e19668..43cc57ee0b 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -44,6 +44,8 @@ reg_t kRestartGame(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
+void gfxop_sleep(GfxState *gfx, uint32 duration);
+
/* kGameIsRestarting():
** Returns the restarting_flag in acc
*/
@@ -55,25 +57,15 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) {
s->restarting_flags &= ~SCI_GAME_WAS_RESTARTED;
}
- if (getSciVersion() <= SCI_VERSION_01) {
- // Do speed throttling for SCI0/SCI01 games in here, actually just a test if lsl3 pushups get fixed that way
- uint32 curTime = g_system->getMillis();
- uint32 duration = curTime - s->_lastAnimateTime;
- uint32 neededSleep = 40;
-
- // 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;
- }
+ uint32 curTime = g_system->getMillis();
+ uint32 duration = curTime - s->_lastAnimateTime;
+ uint32 neededSleep = 30;
- if (duration < neededSleep) {
- g_system->delayMillis(neededSleep - duration);
- s->_lastAnimateTime = g_system->getMillis();
- } else {
- s->_lastAnimateTime = curTime;
- }
+ if (duration < neededSleep) {
+ gfxop_sleep(s->gfx_state, neededSleep - duration);
+ s->_lastAnimateTime = g_system->getMillis();
+ } else {
+ s->_lastAnimateTime = curTime;
}
return s->r_acc;