[Scummvm-cvs-logs] scummvm master -> f4e7b593dc9d841640bda26da59de716772b4411

digitall dgturner at iee.org
Tue Mar 18 23:47:48 CET 2014


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:
f4e7b593dc SCUMM: Fix bug #6009 "DC: FT/Dig - Sound disappears when VMU save fails"


Commit: f4e7b593dc9d841640bda26da59de716772b4411
    https://github.com/scummvm/scummvm/commit/f4e7b593dc9d841640bda26da59de716772b4411
Author: D G Turner (digitall at scummvm.org)
Date: 2014-03-18T22:49:36Z

Commit Message:
SCUMM: Fix bug #6009 "DC: FT/Dig - Sound disappears when VMU save fails"

This was introduced by fd3970aa52a0c7f411afdddfebad208f783281c8:
Apply patch #2984508 - "GSoC: SCUMM stopped audio from playing while
saving"

This was not quite correct as if the save fails, the function exits
without unpausing the engine, which resulted in sound and music
remaining muted. This corrects the logic to unpause in all cases.

Changed paths:
    engines/scumm/saveload.cpp



diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 67bd6f6..8d278f6 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -188,32 +188,31 @@ bool ScummEngine::saveState(Common::WriteStream *out, bool writeHeader) {
 }
 
 bool ScummEngine::saveState(int slot, bool compat, Common::String &filename) {
-	bool saveFailed;
+	bool saveFailed = false;
 
 	pauseEngine(true);
 
 	Common::WriteStream *out = openSaveFileForWriting(slot, compat, filename);
-	if (!out)
-		return false;
-
-	saveFailed = false;
-	if (!saveState(out))
+	if (!out) {
 		saveFailed = true;
+	} else {
+		if (!saveState(out))
+			saveFailed = true;
 
-	out->finalize();
-	if (out->err())
-		saveFailed = true;
-	delete out;
+		out->finalize();
+		if (out->err())
+			saveFailed = true;
+		delete out;
+	}
 
-	if (saveFailed) {
+	if (saveFailed)
 		debug(1, "State save as '%s' FAILED", filename.c_str());
-		return false;
-	}
-	debug(1, "State saved as '%s'", filename.c_str());
+	else
+		debug(1, "State saved as '%s'", filename.c_str());
 
 	pauseEngine(false);
 
-	return true;
+	return !saveFailed;
 }
 
 






More information about the Scummvm-git-logs mailing list