diff options
author | Bastien Bouclet | 2016-02-26 07:18:44 +0100 |
---|---|---|
committer | Bastien Bouclet | 2016-02-26 07:22:30 +0100 |
commit | 5aeda50f5811d185e336813d7c7904b771e453ae (patch) | |
tree | 9817936aecc6df339e5cc8a6bd176ffc317b799d /engines/mohawk/myst_graphics.cpp | |
parent | faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f (diff) | |
download | scummvm-rg350-5aeda50f5811d185e336813d7c7904b771e453ae.tar.gz scummvm-rg350-5aeda50f5811d185e336813d7c7904b771e453ae.tar.bz2 scummvm-rg350-5aeda50f5811d185e336813d7c7904b771e453ae.zip |
MOHAWK: Fix the drawing time simulation
Was broken when adding transition support.
Fixes scripted card changes not displaying for a long enough time.
Diffstat (limited to 'engines/mohawk/myst_graphics.cpp')
-rw-r--r-- | engines/mohawk/myst_graphics.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/mohawk/myst_graphics.cpp b/engines/mohawk/myst_graphics.cpp index 6c93f980ac..5db9697a78 100644 --- a/engines/mohawk/myst_graphics.cpp +++ b/engines/mohawk/myst_graphics.cpp @@ -227,9 +227,8 @@ void MystGraphics::copyBackBufferToScreen(Common::Rect r) { void MystGraphics::runTransition(TransitionType type, Common::Rect rect, uint16 steps, uint16 delay) { - // Do not artificially delay during transitions - int oldEnableDrawingTimeSimulation = _enableDrawingTimeSimulation; - _enableDrawingTimeSimulation = 0; + // Transitions are barely visible without adding delays between the draw calls + enableDrawingTimeSimulation(true); switch (type) { case kTransitionLeftToRight: { @@ -290,7 +289,10 @@ void MystGraphics::runTransition(TransitionType type, Common::Rect rect, uint16 debugC(kDebugView, "Dissolve"); for (int16 step = 0; step < 8; step++) { - simulatePreviousDrawDelay(rect); + // Only one eighth of the rect pixels are updated by a draw step, + // delay by one eighth of the regular time + simulatePreviousDrawDelay(Common::Rect(rect.width() / 8, rect.height())); + transitionDissolve(rect, step); } } @@ -369,7 +371,7 @@ void MystGraphics::runTransition(TransitionType type, Common::Rect rect, uint16 error("Unknown transition %d", type); } - _enableDrawingTimeSimulation = oldEnableDrawingTimeSimulation; + enableDrawingTimeSimulation(false); } void MystGraphics::transitionDissolve(Common::Rect rect, uint step) { @@ -641,8 +643,10 @@ void MystGraphics::simulatePreviousDrawDelay(const Common::Rect &dest) { // Do not draw anything new too quickly after the previous draw call // so that images stay at least a little while on screen // This is enabled only for scripted draw calls - if (time < _nextAllowedDrawTime) + if (time < _nextAllowedDrawTime) { + debugC(kDebugView, "Delaying draw call by %d ms", _nextAllowedDrawTime - time); _vm->_system->delayMillis(_nextAllowedDrawTime - time); + } } // Next draw call allowed at DELAY + AERA * COEFF milliseconds from now |