[Scummvm-cvs-logs] scummvm master -> 5aeda50f5811d185e336813d7c7904b771e453ae
bgK
bastien.bouclet at gmail.com
Fri Feb 26 07:25:05 CET 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
faff49d001 MOHAWK: Fix loading a save from the launcher
5aeda50f58 MOHAWK: Fix the drawing time simulation
Commit: faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f
https://github.com/scummvm/scummvm/commit/faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-26T07:22:30+01:00
Commit Message:
MOHAWK: Fix loading a save from the launcher
Was broken by d6881100dd5613c8573f8f8235b93772ae513e49
Changed paths:
engines/mohawk/myst.cpp
engines/mohawk/myst.h
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index ad803cc..e0e8380c 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -235,7 +235,7 @@ Common::Error MohawkEngine_Myst::run() {
_cursor->showCursor();
// Load game from launcher/command line if requested
- if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) {
+ if (ConfMan.hasKey("save_slot") && hasGameSaveSupport()) {
uint32 gameToLoad = ConfMan.getInt("save_slot");
Common::StringArray savedGamesList = MystGameState::generateSaveGameList();
if (gameToLoad > savedGamesList.size())
@@ -1093,9 +1093,13 @@ Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &d
return _gameState->save(desc) ? Common::kNoError : Common::kUnknownError;
}
+bool MohawkEngine_Myst::hasGameSaveSupport() const {
+ return !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF;
+}
+
bool MohawkEngine_Myst::canLoadGameStateCurrently() {
// No loading in the demo/makingof
- return _canSafelySaveLoad && !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF;
+ return _canSafelySaveLoad && hasGameSaveSupport();
}
bool MohawkEngine_Myst::canSaveGameStateCurrently() {
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 79bd081..0803c69 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -245,6 +245,7 @@ private:
* Saving / Loading is only allowed from the main event loop
*/
bool _canSafelySaveLoad;
+ bool hasGameSaveSupport() const;
bool pollEvent(Common::Event &event);
Commit: 5aeda50f5811d185e336813d7c7904b771e453ae
https://github.com/scummvm/scummvm/commit/5aeda50f5811d185e336813d7c7904b771e453ae
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-02-26T07:22:30+01:00
Commit Message:
MOHAWK: Fix the drawing time simulation
Was broken when adding transition support.
Fixes scripted card changes not displaying for a long enough time.
Changed paths:
engines/mohawk/myst.cpp
engines/mohawk/myst_graphics.cpp
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index e0e8380c..3bc2b2d 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -599,10 +599,12 @@ void MohawkEngine_Myst::changeToCard(uint16 card, TransitionType transition) {
// Make sure the screen is updated
if (transition != kNoTransition) {
- if (!_gameState->_globals.transitions)
- transition = kTransitionCopy;
-
- _gfx->runTransition(transition, Common::Rect(544, 333), 10, 0);
+ if (_gameState->_globals.transitions) {
+ _gfx->runTransition(transition, Common::Rect(544, 333), 10, 0);
+ } else {
+ _gfx->copyBackBufferToScreen(Common::Rect(544, 333));
+ _needsUpdate = true;
+ }
}
// Make sure we have the right cursor showing
diff --git a/engines/mohawk/myst_graphics.cpp b/engines/mohawk/myst_graphics.cpp
index 6c93f98..5db9697 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
More information about the Scummvm-git-logs
mailing list