diff options
Diffstat (limited to 'engines/sword25')
-rw-r--r-- | engines/sword25/kernel/persistenceservice.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/math/region.cpp | 8 | ||||
-rw-r--r-- | engines/sword25/sfx/soundengine.cpp | 7 |
3 files changed, 10 insertions, 7 deletions
diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index 27d669caa1..df26da7800 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -59,7 +59,7 @@ static const int VERSIONNUM = 2; char gameTarget[MAX_SAVEGAME_SIZE]; void setGameTarget(const char *target) { - strncpy(gameTarget, target, MAX_SAVEGAME_SIZE); + strncpy(gameTarget, target, MAX_SAVEGAME_SIZE - 1); } static Common::String generateSavegameFilename(uint slotID) { diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index b6ebaee23f..db888e432a 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; } diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index d90849e449..8ff1b0cf2a 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; |