diff options
author | Travis Howell | 2006-03-26 00:24:00 +0000 |
---|---|---|
committer | Travis Howell | 2006-03-26 00:24:00 +0000 |
commit | 67b8589c18ec712c5c577394d5213a54dcc005cc (patch) | |
tree | 74e4458c207629184dc855a826e2865416f3e377 /engines | |
parent | dd505ff6aebbe3f321d8bbebabc32a471c2ac0c8 (diff) | |
download | scummvm-rg350-67b8589c18ec712c5c577394d5213a54dcc005cc.tar.gz scummvm-rg350-67b8589c18ec712c5c577394d5213a54dcc005cc.tar.bz2 scummvm-rg350-67b8589c18ec712c5c577394d5213a54dcc005cc.zip |
Reduce size of saved games for HE games, music/speech resources don't need to be saved
svn-id: r21456
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/resource.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/saveload.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/saveload.h | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 60b04f18ae..897459c8be 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -1415,7 +1415,7 @@ void ScummEngine::allocateArrays() { 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); } } diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 4245f2ca30..a6f3f0462a 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1402,7 +1402,7 @@ void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) { 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,7 +1419,13 @@ void ScummEngine::saveResource(Serializer *ser, int type, int idx) { } 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); @@ -1432,6 +1438,10 @@ void ScummEngine::loadResource(Serializer *ser, int type, int idx) { _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); } } diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 8af3cec46c..3a2090f7bd 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -47,7 +47,7 @@ namespace Scumm { * 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 |