[Scummvm-cvs-logs] SF.net SVN: scummvm: [21456] scummvm/trunk/engines/scumm
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Mar 25 16:25:05 CET 2006
Revision: 21456
Author: kirben
Date: 2006-03-25 16:24:00 -0800 (Sat, 25 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21456&view=rev
Log Message:
-----------
Reduce size of saved games for HE games, music/speech resources don't need to be saved
Modified Paths:
--------------
scummvm/trunk/engines/scumm/resource.cpp
scummvm/trunk/engines/scumm/saveload.cpp
scummvm/trunk/engines/scumm/saveload.h
Modified: scummvm/trunk/engines/scumm/resource.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource.cpp 2006-03-25 21:17:38 UTC (rev 21455)
+++ scummvm/trunk/engines/scumm/resource.cpp 2006-03-26 00:24:00 UTC (rev 21456)
@@ -1415,7 +1415,7 @@
allocResTypeData(rtTalkie, MKID_BE('TLKE'), _numTalkies, "talkie", 1);
if (_game.heversion >= 70) {
- allocResTypeData(rtSpoolBuffer, 0, 9, "spool buffer", 0);
+ allocResTypeData(rtSpoolBuffer, 0, 9, "spool buffer", 1);
}
}
Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp 2006-03-25 21:17:38 UTC (rev 21455)
+++ scummvm/trunk/engines/scumm/saveload.cpp 2006-03-26 00:24:00 UTC (rev 21456)
@@ -1402,7 +1402,7 @@
void ScummEngine::saveResource(Serializer *ser, int type, int idx) {
assert(res.address[type][idx]);
- if ((res.mode[type] == 0) || (_game.heversion >= 60 && res.mode[type] == 2 && idx == 1)) {
+ if (res.mode[type] == 0) {
byte *ptr = res.address[type][idx];
uint32 size = ((MemBlkHeader *)ptr)->size;
@@ -1419,11 +1419,17 @@
}
void ScummEngine::loadResource(Serializer *ser, int type, int idx) {
- if ((res.mode[type] == 0) || (_game.heversion >= 60 && res.mode[type] == 2 && idx == 1)) {
+ if (_game.heversion >= 60 && ser->getVersion() <= VER(65) &&
+ ((type == rtSound && idx == 1) || (type == rtSpoolBuffer))) {
uint32 size = ser->loadUint32();
assert(size);
res.createResource(type, idx, size);
ser->loadBytes(getResourceAddress(type, idx), size);
+ } else if (res.mode[type] == 0) {
+ uint32 size = ser->loadUint32();
+ assert(size);
+ res.createResource(type, idx, size);
+ ser->loadBytes(getResourceAddress(type, idx), size);
if (type == rtInventory) {
_inventory[idx] = ser->loadUint16();
@@ -1432,6 +1438,10 @@
_newNames[idx] = ser->loadUint16();
}
} else if (res.mode[type] == 2) {
+ // HE Games use sound resource 1 for speech
+ if (_game.heversion >= 60 && idx == 1)
+ return;
+
ensureResourceLoaded(type, idx);
}
}
Modified: scummvm/trunk/engines/scumm/saveload.h
===================================================================
--- scummvm/trunk/engines/scumm/saveload.h 2006-03-25 21:17:38 UTC (rev 21455)
+++ scummvm/trunk/engines/scumm/saveload.h 2006-03-26 00:24:00 UTC (rev 21456)
@@ -47,7 +47,7 @@
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
-#define CURRENT_VER 65
+#define CURRENT_VER 66
/**
* An auxillary macro, used to specify savegame versions. We use this instead
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list