aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/saveload.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-08-31 13:11:31 +0200
committerEinar Johan Trøan Sømåen2012-08-31 13:11:31 +0200
commit3fe7f2cbe2b70eaa824b7159d94d40c2280006a3 (patch)
treeea592da00ad567c75008137f79eeba16c3ba40c4 /engines/cine/saveload.cpp
parent246109839b9c196e9181a6f619c15694456b9aec (diff)
parent10a947a0be80ea8c5c88bd3493a5057b1223ce45 (diff)
downloadscummvm-rg350-3fe7f2cbe2b70eaa824b7159d94d40c2280006a3.tar.gz
scummvm-rg350-3fe7f2cbe2b70eaa824b7159d94d40c2280006a3.tar.bz2
scummvm-rg350-3fe7f2cbe2b70eaa824b7159d94d40c2280006a3.zip
Merge remote-tracking branch 'origin/master' into wintermute
Diffstat (limited to 'engines/cine/saveload.cpp')
-rw-r--r--engines/cine/saveload.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp
index 223099a587..20952eea52 100644
--- a/engines/cine/saveload.cpp
+++ b/engines/cine/saveload.cpp
@@ -991,7 +991,7 @@ void CineEngine::makeSave(char *saveFileName) {
* at a time.
*/
void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGameFormat saveGameFormat) {
- int16 currentAnim, foundFileIdx;
+ int16 foundFileIdx;
char *animName, part[256], name[10];
strcpy(part, currentPartName);
@@ -1001,10 +1001,10 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
const int entrySize = ((saveGameFormat == ANIMSIZE_23) ? 23 : 30);
const int fileStartPos = fHandle.pos();
- currentAnim = 0;
- while (currentAnim < NUM_MAX_ANIMDATA) {
+
+ for(int resourceIndex=0; resourceIndex<NUM_MAX_ANIMDATA; resourceIndex++) {
// Seek to the start of the current animation's entry
- fHandle.seek(fileStartPos + currentAnim * entrySize);
+ fHandle.seek(fileStartPos + resourceIndex * entrySize);
// Read in the current animation entry
fHandle.readUint16BE(); // width
fHandle.readUint16BE();
@@ -1019,7 +1019,7 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
}
foundFileIdx = fHandle.readSint16BE();
- fHandle.readSint16BE(); // frame
+ int16 frameIndex = fHandle.readSint16BE(); // frame
fHandle.read(name, 10);
// Handle variables only present in animation entries of size 23
@@ -1029,7 +1029,7 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
// Don't try to load invalid entries.
if (foundFileIdx < 0 || !validPtr) {
- currentAnim++; // Jump over the invalid entry
+ //resourceIndex++; // Jump over the invalid entry
continue;
}
@@ -1041,9 +1041,7 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
animName = g_cine->_partBuffer[foundFileIdx].partName;
loadRelatedPalette(animName); // Is this for Future Wars only?
- const int16 prevAnim = currentAnim;
- currentAnim = loadResource(animName, currentAnim);
- assert(currentAnim > prevAnim); // Make sure we advance forward
+ loadResource(animName, resourceIndex, frameIndex);
}
loadPart(part);