aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/saveload.cpp
diff options
context:
space:
mode:
authorVincent Hamm2012-08-13 20:12:07 -0700
committerVincent Hamm2012-08-13 20:12:07 -0700
commit2fd8bae31994e5581d0ef43da439d01ddd0d1ef5 (patch)
tree16486b6d85e8763a2cd28db600e9862ef401e979 /engines/cine/saveload.cpp
parentc839fd50b5ddfcceada8cbbd3046ce219df248a0 (diff)
downloadscummvm-rg350-2fd8bae31994e5581d0ef43da439d01ddd0d1ef5.tar.gz
scummvm-rg350-2fd8bae31994e5581d0ef43da439d01ddd0d1ef5.tar.bz2
scummvm-rg350-2fd8bae31994e5581d0ef43da439d01ddd0d1ef5.zip
CINE: Fix restoring of savegame in cave
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);