[Scummvm-cvs-logs] scummvm master -> 22af86340e8462ab8cca73f502684852a9166cfb

dreammaster dreammaster at scummvm.org
Fri Oct 11 04:49:44 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
22af86340e TSAGE: Cleaner implementation of saving disable code


Commit: 22af86340e8462ab8cca73f502684852a9166cfb
    https://github.com/scummvm/scummvm/commit/22af86340e8462ab8cca73f502684852a9166cfb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-10-10T19:49:14-07:00

Commit Message:
TSAGE: Cleaner implementation of saving disable code

Changed paths:
    engines/tsage/core.cpp
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_logic.h



diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 5261081..bd7610c 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2817,9 +2817,8 @@ void BackgroundSceneObject::copySceneToBackground() {
 
 	// WORKAROUND: Since savegames don't store the active screen data, once we copy the 
 	// foreground objects to the background, we have to prevent the scene being saved.
-	// I do this the easiest way, by using the existing animationCtr global
 	if (g_vm->getGameID() == GType_Ringworld2)
-		++R2_GLOBALS._animationCtr;
+		((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->_preventSaving = true;
 }
 
 /*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index fc06b20..bd90850 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -321,9 +321,11 @@ bool Ringworld2Game::canLoadGameStateCurrently() {
  * Returns true if it is currently okay to save the game
  */
 bool Ringworld2Game::canSaveGameStateCurrently() {
-	// Don't allow a game to be saved if a dialog is active or if an animation
-	// is playing
-	return g_globals->_gfxManagers.size() == 1 && R2_GLOBALS._animationCtr == 0;
+	// Don't allow a game to be saved if a dialog is active, or if an animation
+	// is playing, or if an active scene prevents it
+	return g_globals->_gfxManagers.size() == 1 && R2_GLOBALS._animationCtr == 0 &&
+		(!R2_GLOBALS._sceneManager._scene ||
+		!((SceneExt *)R2_GLOBALS._sceneManager._scene)->_preventSaving);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -338,6 +340,7 @@ SceneExt::SceneExt(): Scene() {
 	_savedPlayerEnabled = false;
 	_savedUiEnabled = false;
 	_savedCanWalk = false;
+	_preventSaving = false;
 
 	// WORKAROUND: In the original, playing animations don't reset the global _animationCtr
 	// counter as scene changes unless the playing animation explicitly finishes. For now,
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index aeac2fd..5c8af8d 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -85,6 +85,7 @@ public:
 	bool _savedPlayerEnabled;
 	bool _savedUiEnabled;
 	bool _savedCanWalk;
+	bool _preventSaving;
 
 	Visage _cursorVisage;
 	SynchronizedList<EventHandler *> _sceneAreas;






More information about the Scummvm-git-logs mailing list