[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.141,1.142
Max Horn
fingolfin at users.sourceforge.net
Tue Feb 17 09:53:02 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: web/screenshots big_scummvm_17.png,1.2,1.3 big_scummvm_19.png,1.2,1.3 big_scummvm_20.png,1.2,1.3 big_scummvm_24.png,1.1,1.2 big_scummvm_25.png,1.1,1.2 scummvm_17.png,1.4,1.5 scummvm_19.png,1.4,1.5 scummvm_20.png,1.4,1.5 scummvm_24.png,1.3,1.4 scummvm_25.png,1.3,1.4
- Next message: [Scummvm-cvs-logs] CVS: web/screenshots big_scummvm_26.png,1.2,1.3 big_scummvm_27.png,1.2,1.3 scummvm_26.png,1.3,1.4 scummvm_27.png,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8617
Modified Files:
saveload.cpp
Log Message:
delete certain unused non-perma resources when loading
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- saveload.cpp 17 Feb 2004 00:40:51 -0000 1.141
+++ saveload.cpp 17 Feb 2004 17:43:27 -0000 1.142
@@ -183,7 +183,7 @@
// scumm vars. We now know the proper locations. To be able to properly use
// old save games, we update the old (bad) variables to the new (correct)
// ones.
- if (hdr.ver < 28 && _version == 8) {
+ if (hdr.ver < VER(28) && _version == 8) {
_scummVars[VAR_CAMERA_MIN_X] = _scummVars[101];
_scummVars[VAR_CAMERA_MAX_X] = _scummVars[102];
_scummVars[VAR_CAMERA_MIN_Y] = _scummVars[103];
@@ -657,6 +657,18 @@
// Save all resource.
int type, idx;
+
+ if (s->isLoading()) {
+ // When loading, start by deleting old non-permanent resources (an
+ // exception is made for buffer/temp resources, they are going to be
+ // deleted later on anyway).
+ for (type = rtFirst; type <= rtLast; type++) {
+ if (res.mode[type] != 1 && type != rtTemp && type != rtBuffer)
+ for (idx = 1; idx < res.num[type]; idx++)
+ nukeResource(type, idx);
+ }
+ }
+
if (savegameVersion >= VER(26)) {
// New, more robust resource save/load system. This stores the type
// and index of each resource. Thus if we increase e.g. the maximum
@@ -689,10 +701,9 @@
// with index 0, and breaks whenever we change the limit on a given
// resource type.
for (type = rtFirst; type <= rtLast; type++)
- if (res.mode[type] != 1)
+ if (res.mode[type] != 1 && type != rtTemp && type != rtBuffer)
for (idx = 1; idx < res.num[type]; idx++)
- if (type != rtTemp && type != rtBuffer)
- saveLoadResource(s, type, idx);
+ saveLoadResource(s, type, idx);
}
s->saveLoadArrayOf(_objectOwnerTable, _numGlobalObjects, sizeof(_objectOwnerTable[0]), sleByte);
- Previous message: [Scummvm-cvs-logs] CVS: web/screenshots big_scummvm_17.png,1.2,1.3 big_scummvm_19.png,1.2,1.3 big_scummvm_20.png,1.2,1.3 big_scummvm_24.png,1.1,1.2 big_scummvm_25.png,1.1,1.2 scummvm_17.png,1.4,1.5 scummvm_19.png,1.4,1.5 scummvm_20.png,1.4,1.5 scummvm_24.png,1.3,1.4 scummvm_25.png,1.3,1.4
- Next message: [Scummvm-cvs-logs] CVS: web/screenshots big_scummvm_26.png,1.2,1.3 big_scummvm_27.png,1.2,1.3 scummvm_26.png,1.3,1.4 scummvm_27.png,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list