aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2017-05-04 22:42:32 -0500
committerColin Snover2017-05-04 23:00:53 -0500
commit8d94a046052bc5c041831a77b2a9a8b59e1f527e (patch)
treedf46a1cae27115944ed4b862077f27e4ac162430 /engines/sci/graphics
parentc057f00eab65bc31f48b40c04aadc73f1569ee3a (diff)
downloadscummvm-rg350-8d94a046052bc5c041831a77b2a9a8b59e1f527e.tar.gz
scummvm-rg350-8d94a046052bc5c041831a77b2a9a8b59e1f527e.tar.bz2
scummvm-rg350-8d94a046052bc5c041831a77b2a9a8b59e1f527e.zip
SCI32: Disable game script video benchmarking
The approach to video benchmarking used by SCI engine does not translate very well to modern video devices -- it will either be so slow that the games think the system is not capable of showing normal visual effects, or so fast that the benchmarks overflow their counters. So, game scripts that perform video benchmarking are now patched to unconditionally return the highest speed value. A pleasant but subtle side-effect of this change is that the extra time sitting at a blank screen before the start of a game (while benchmarks ran) is now gone. Fixes Trac#9741.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/frameout.cpp65
-rw-r--r--engines/sci/graphics/frameout.h22
2 files changed, 11 insertions, 76 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 259e3a01b8..d5a7e33c32 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -65,8 +65,6 @@ GfxFrameout::GfxFrameout(SegManager *segMan, GfxPalette32 *palette, GfxTransitio
_cursor(cursor),
_segMan(segMan),
_transitions(transitions),
- _benchmarkingFinished(false),
- _throttleFrameOut(true),
_throttleState(0),
_remapOccurred(false),
_overdrawThreshold(0),
@@ -153,28 +151,6 @@ bool GfxFrameout::gameIsHiRes() const {
}
#pragma mark -
-#pragma mark Benchmarking
-
-bool GfxFrameout::checkForFred(const reg_t object) {
- const int16 viewId = readSelectorValue(_segMan, object, SELECTOR(view));
- const SciGameId gameId = g_sci->getGameId();
-
- if (gameId == GID_QFG4 && viewId == 9999) {
- return true;
- }
-
- if (gameId != GID_QFG4 && viewId == -556) {
- return true;
- }
-
- if (Common::String(_segMan->getObjectName(object)) == "fred") {
- return true;
- }
-
- return false;
-}
-
-#pragma mark -
#pragma mark Screen items
void GfxFrameout::addScreenItem(ScreenItem &screenItem) const {
@@ -226,14 +202,6 @@ void GfxFrameout::deleteScreenItem(ScreenItem &screenItem, const reg_t planeObje
}
void GfxFrameout::kernelAddScreenItem(const reg_t object) {
- // The "fred" object is used to test graphics performance;
- // it is impacted by framerate throttling, so disable the
- // throttling when this item is on the screen for the
- // performance check to pass.
- if (!_benchmarkingFinished && _throttleFrameOut && checkForFred(object)) {
- _throttleFrameOut = false;
- }
-
const reg_t planeObject = readSelector(_segMan, object, SELECTOR(plane));
_segMan->getObject(object)->setInfoSelectorFlag(kInfoFlagViewInserted);
@@ -273,15 +241,6 @@ void GfxFrameout::kernelUpdateScreenItem(const reg_t object) {
}
void GfxFrameout::kernelDeleteScreenItem(const reg_t object) {
- // The "fred" object is used to test graphics performance;
- // it is impacted by framerate throttling, so disable the
- // throttling when this item is on the screen for the
- // performance check to pass.
- if (!_benchmarkingFinished && checkForFred(object)) {
- _benchmarkingFinished = true;
- _throttleFrameOut = true;
- }
-
_segMan->getObject(object)->clearInfoSelectorFlag(kInfoFlagViewInserted);
const reg_t planeObject = readSelector(_segMan, object, SELECTOR(plane));
@@ -430,7 +389,7 @@ void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &eraseR
// we must poll for mouse events instead, poll here so that the mouse gets
// updated with its current position at render time. If we do not do this,
// the mouse gets "stuck" during loops that do not make calls to kGetEvent,
- // like transitions and the benchmarking loop at the start of every game.
+ // like transitions.
g_sci->getEventManager()->getSciEvent(SCI_EVENT_PEEK);
RobotDecoder &robotPlayer = g_sci->_video32->getRobotPlayer();
@@ -1177,19 +1136,17 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) {
}
void GfxFrameout::throttle() {
- if (_throttleFrameOut) {
- uint8 throttleTime;
- if (_throttleState == 2) {
- throttleTime = 16;
- _throttleState = 0;
- } else {
- throttleTime = 17;
- ++_throttleState;
- }
-
- g_sci->getEngineState()->speedThrottler(throttleTime);
- g_sci->getEngineState()->_throttleTrigger = true;
+ uint8 throttleTime;
+ if (_throttleState == 2) {
+ throttleTime = 16;
+ _throttleState = 0;
+ } else {
+ throttleTime = 17;
+ ++_throttleState;
}
+
+ g_sci->getEngineState()->speedThrottler(throttleTime);
+ g_sci->getEngineState()->_throttleTrigger = true;
}
void GfxFrameout::shakeScreen(int16 numShakes, const ShakeDirection direction) {
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 146211544c..650c2c7889 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -61,28 +61,6 @@ public:
void run();
#pragma mark -
-#pragma mark Benchmarking
-private:
- /**
- * Optimization to avoid the more expensive object name
- * comparision on every call to kAddScreenItem and
- * kRemoveScreenItem.
- */
- bool _benchmarkingFinished;
-
- /**
- * Whether or not calls to kFrameOut should be framerate
- * limited to 60fps.
- */
- bool _throttleFrameOut;
-
- /**
- * Determines whether or not a screen item is the "Fred"
- * object.
- */
- bool checkForFred(const reg_t object);
-
-#pragma mark -
#pragma mark Screen items
private:
void remapMarkRedraw();