aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kevent.cpp14
-rw-r--r--engines/sci/engine/state.cpp1
-rw-r--r--engines/sci/engine/state.h1
-rw-r--r--engines/sci/graphics/animate.cpp11
4 files changed, 15 insertions, 12 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 9d48174078..58de38bd8e 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -176,15 +176,11 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
// Wait a bit here, so that the CPU isn't maxed out when the game
// is waiting for user input (e.g. when showing text boxes) - bug
- // #3037874. This works when games do benchmarking at the beginning,
- // because most of them call kAnimate for benchmarking without
- // calling kGetEvent in between (rightly so).
- if (g_sci->getGameId() == GID_JONES && g_sci->getEngineState()->currentRoomNumber() == 764) {
- // Jones CD is an exception, as it incorrectly calls GetEvent
- // while benchmarking. Thus, don't delay here for room 764 in
- // Jones (the speed test room), otherwise speed testing will
- // fail and the game won't show any views, as it will think that
- // the user has a slow machine - bug #3058865
+ // #3037874. Make sure that we're not delaying while the game is
+ // benchmarking, as that will affect the final benchmarked result -
+ // check bugs #3058865 and #3127824
+ if (s->_gameIsBenchmarking) {
+ // Game is benchmarking, don't add a delay
} else {
g_system->delayMillis(10);
}
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index efcb826819..12795adeb1 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -106,6 +106,7 @@ void EngineState::reset(bool isRestoring) {
_throttleCounter = 0;
_throttleLastTime = 0;
_throttleTrigger = false;
+ _gameIsBenchmarking = false;
_lastSaveVirtualId = SAVEGAMEID_OFFICIALRANGE_START;
_lastSaveNewId = 0;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 5defd5705b..bba34b6b48 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -159,6 +159,7 @@ public:
uint32 _throttleCounter; /**< total times kAnimate was invoked */
uint32 _throttleLastTime; /**< last time kAnimate was invoked */
bool _throttleTrigger;
+ bool _gameIsBenchmarking;
/* Kernel File IO stuff */
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 92bdbd30c3..2e5e94c52a 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -686,7 +686,6 @@ void GfxAnimate::kernelAnimate(reg_t listReference, bool cycle, int argc, reg_t
_ports->setPort(oldPort);
-
// Now trigger speed throttler
switch (_lastCastData.size()) {
case 0:
@@ -698,8 +697,10 @@ void GfxAnimate::kernelAnimate(reg_t listReference, bool cycle, int argc, reg_t
AnimateEntry *onlyCast = &_lastCastData[0];
if ((onlyCast->viewId == 0) && (onlyCast->loopNo == 13) && (onlyCast->celNo == 0)) {
// this one is used by jones talkie
- if ((onlyCast->celRect.height() == 8) && (onlyCast->celRect.width() == 8))
+ if ((onlyCast->celRect.height() == 8) && (onlyCast->celRect.width() == 8)) {
+ _s->_gameIsBenchmarking = true;
return;
+ }
}
// first loop and first cel used?
if ((onlyCast->loopNo == 0) && (onlyCast->celNo == 0)) {
@@ -712,15 +713,19 @@ void GfxAnimate::kernelAnimate(reg_t listReference, bool cycle, int argc, reg_t
((onlyWidth == 1) && (onlyHeight == 1))) { // Laura Bow 2 Talkie
// check further that there is only one cel in that view
GfxView *onlyView = _cache->getView(onlyCast->viewId);
- if ((onlyView->getLoopCount() == 1) && (onlyView->getCelCount(0)))
+ if ((onlyView->getLoopCount() == 1) && (onlyView->getCelCount(0))) {
+ _s->_gameIsBenchmarking = true;
return;
+ }
}
}
+ _s->_gameIsBenchmarking = false;
_s->_throttleTrigger = true;
break;
}
default:
// More than 1 entry drawn -> time for speed throttling
+ _s->_gameIsBenchmarking = false;
_s->_throttleTrigger = true;
break;
}