aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-18 10:40:36 +0000
committerFilippos Karapetis2009-10-18 10:40:36 +0000
commita10929594d951ec31d8f4e4ec0e17178ca0d8a58 (patch)
tree6d73d401a10652f7e8c60e2009735cb85abab221
parentcdf6ea603f12dc5aec33f0155823cf94fa4ca1c4 (diff)
downloadscummvm-rg350-a10929594d951ec31d8f4e4ec0e17178ca0d8a58.tar.gz
scummvm-rg350-a10929594d951ec31d8f4e4ec0e17178ca0d8a58.tar.bz2
scummvm-rg350-a10929594d951ec31d8f4e4ec0e17178ca0d8a58.zip
Re-enabled the speed throttler for SCI1.1 games again, as disabling it makes CPU load spike up in some of them (e.g. LSL6). Added a workaround for the Sierra logo scene in QFG3, too
svn-id: r45215
-rw-r--r--engines/sci/engine/kgraphics.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 41202f4bc8..c7e44028f5 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -941,27 +941,30 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) {
// FIXME: qfg3 gets broken by this, BUT even changing neededSleep to 2 still makes it somewhat broken (palette animation
// isnt working)
- // This speed throttler seems to cause issues in SCI1.1 games (e.g. the Sierra logo in QFG3, it stays there for ages).
- // No observable side effects have been noted in SCI1.1 when this is disabled, so it has been limited to SCI0-SCI1
- if (getSciVersion() < SCI_VERSION_1_1) {
- // 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;
-
- // 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 (s->_gameName == "qfg3" && s->currentRoomNumber() == 130) {
+ // Disable the speed throttler for QFG3, room 130 (the Sierra logo).
+ // kAnimate is called loads of times in that room, and adding any delay here
+ // will make that scene seem like it's stuck (the player needs to wait 5 mins or so)
+ return s->r_acc;
+ }
- if (duration < neededSleep) {
- gfxop_sleep(s->gfx_state, neededSleep - duration);
- s->_lastAnimateTime = g_system->getMillis();
- } else {
- s->_lastAnimateTime = curTime;
- }
+ // 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;
+
+ // 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;
}
return s->r_acc;