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

criezy criezy at scummvm.org
Sat Oct 5 01:25:50 CEST 2013


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:
f55259e3b1 SWORD25: Fix regression in persistence code
cdbee9972a SWORD25: Fix possible error in sound engine when loading a savegame


Commit: f55259e3b103d5aa966b00fb5c574d84a4f399c0
    https://github.com/scummvm/scummvm/commit/f55259e3b103d5aa966b00fb5c574d84a4f399c0
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-10-04T16:25:04-07:00

Commit Message:
SWORD25: Fix regression in persistence code

The regression was introduced by commit e6ba26ff0d which wrote
coordinates of a rect as unsigned int when they were before written
as signed int. Since the load code was not modified it still expected
signed int. They are now again written as signed int. Any gamed saved
between commit e6ba26ff0d and this commit will therefore be corrupted.

Changed paths:
    engines/sword25/math/region.cpp



diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp
index b6ebaee..db888e4 100644
--- a/engines/sword25/math/region.cpp
+++ b/engines/sword25/math/region.cpp
@@ -311,10 +311,10 @@ bool Region::persist(OutputPersistenceBlock &writer) {
 		++It;
 	}
 
-	writer.write((uint32)_boundingBox.left);
-	writer.write((uint32)_boundingBox.top);
-	writer.write((uint32)_boundingBox.right);
-	writer.write((uint32)_boundingBox.bottom);
+	writer.write((int32)_boundingBox.left);
+	writer.write((int32)_boundingBox.top);
+	writer.write((int32)_boundingBox.right);
+	writer.write((int32)_boundingBox.bottom);
 
 	return Result;
 }


Commit: cdbee9972aca6da04ff8a1d0b564e8758782f9fb
    https://github.com/scummvm/scummvm/commit/cdbee9972aca6da04ff8a1d0b564e8758782f9fb
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-10-04T16:25:04-07:00

Commit Message:
SWORD25: Fix possible error in sound engine when loading a savegame

The error occurred when the save game was saved early in the game
before all the sound handles had been used. The unused handles only had
the handle type initialised (as kFreeHandle) so all the other fields had
random values. After loading the game the sound engine could erroneously
try to play one of these sound handle resulting in an error.

Changed paths:
    engines/sword25/sfx/soundengine.cpp



diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp
index d90849e..8ff1b0c 100644
--- a/engines/sword25/sfx/soundengine.cpp
+++ b/engines/sword25/sfx/soundengine.cpp
@@ -339,7 +339,10 @@ bool SoundEngine::persist(OutputPersistenceBlock &writer) {
 			_handles[i].type = kFreeHandle;
 
 		writer.writeString(_handles[i].fileName);
-		writer.write(_handles[i].sndType);
+		if (_handles[i].type == kFreeHandle)
+			writer.write((int32)-1);
+		else
+			writer.write(_handles[i].sndType);
 		writer.write(_handles[i].volume);
 		writer.write(_handles[i].pan);
 		writer.write(_handles[i].loop);
@@ -381,7 +384,7 @@ bool SoundEngine::unpersist(InputPersistenceBlock &reader) {
 		reader.read(layer);
 
 		if (reader.isGood()) {
-			if (sndType != kFreeHandle)
+			if (sndType != -1)
 				playSoundEx(fileName, (SOUND_TYPES)sndType, volume, pan, loop, loopStart, loopEnd, layer, i);
 		} else
 			return false;






More information about the Scummvm-git-logs mailing list