diff options
| author | Martin Kiewitz | 2009-10-22 21:30:30 +0000 |
|---|---|---|
| committer | Martin Kiewitz | 2009-10-22 21:30:30 +0000 |
| commit | 8e6291f7bbaafeed0718264ae401dcf052559cab (patch) | |
| tree | 104c4f47c44c77e4a69fafba17367d5f0a48c8aa /engines/sci/engine/kmisc.cpp | |
| parent | 12cdcea516530fbcf2744f59f6eefe8f4f9452a8 (diff) | |
| download | scummvm-rg350-8e6291f7bbaafeed0718264ae401dcf052559cab.tar.gz scummvm-rg350-8e6291f7bbaafeed0718264ae401dcf052559cab.tar.bz2 scummvm-rg350-8e6291f7bbaafeed0718264ae401dcf052559cab.zip | |
SCI: kGameIsRestarting - implemented speed throttler in here for sci0/sci01 games, test only!
svn-id: r45342
Diffstat (limited to 'engines/sci/engine/kmisc.cpp')
| -rw-r--r-- | engines/sci/engine/kmisc.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 7f8667af18..3e03e19668 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -55,6 +55,27 @@ 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; + } + + if (duration < neededSleep) { + g_system->delayMillis(neededSleep - duration); + s->_lastAnimateTime = g_system->getMillis(); + } else { + s->_lastAnimateTime = curTime; + } + } + return s->r_acc; } |
