diff options
author | Max Horn | 2011-05-13 11:39:51 +0200 |
---|---|---|
committer | Max Horn | 2011-05-13 11:47:12 +0200 |
commit | abaaf0cad9a63c1a6f1946a8a90facd1535e762d (patch) | |
tree | 74ced6debdee6f6ed74aade1975588b5cbccd9a4 /engines/scumm | |
parent | 107e25ff5bc65ccca62c8fe0a51cf978ee86dae4 (diff) | |
download | scummvm-rg350-abaaf0cad9a63c1a6f1946a8a90facd1535e762d.tar.gz scummvm-rg350-abaaf0cad9a63c1a6f1946a8a90facd1535e762d.tar.bz2 scummvm-rg350-abaaf0cad9a63c1a6f1946a8a90facd1535e762d.zip |
SCUMM: Tweak sound res syncing
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/saveload.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 376351c19a..d81095a37b 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1636,7 +1636,11 @@ void ScummEngine_v100he::saveOrLoad(Serializer *s) { void ScummEngine::loadResourceOLD(Serializer *ser, int type, int idx) { uint32 size; - if (_res->_types[type]._mode == kDynamicResTypeMode) { + if (type == rtSound && ser->getVersion() >= VER(23)) { + // Save/load only a list of resource numbers that need to be reloaded. + if (ser->loadUint16()) + ensureResourceLoaded(rtSound, idx); + } else if (_res->_types[type]._mode == kDynamicResTypeMode) { size = ser->loadUint32(); if (size) { _res->createResource(type, idx, size); @@ -1655,10 +1659,6 @@ void ScummEngine::loadResourceOLD(Serializer *ser, int type, int idx) { _newNames[idx] = ser->loadUint16(); } } - } else if (_res->_types[type]._mode == kSoundResTypeMode && ser->getVersion() >= VER(23)) { - // Save/load only a list of resource numbers that need to be reloaded. - if (ser->loadUint16()) - ensureResourceLoaded(type, idx); } } @@ -1688,11 +1688,17 @@ void ScummEngine::loadResource(Serializer *ser, int type, int idx) { assert(size); _res->createResource(type, idx, size); ser->loadBytes(getResourceAddress(type, idx), size); + } else if (type == rtSound) { + // HE Games use sound resource 1 for speech + if (_game.heversion >= 60 && idx == 1) + return; + + ensureResourceLoaded(rtSound, idx); } else if (_res->_types[type]._mode == kDynamicResTypeMode) { uint32 size = ser->loadUint32(); assert(size); - _res->createResource(type, idx, size); - ser->loadBytes(getResourceAddress(type, idx), size); + byte *ptr = _res->createResource(type, idx, size); + ser->loadBytes(ptr, size); if (type == rtInventory) { _inventory[idx] = ser->loadUint16(); @@ -1700,12 +1706,6 @@ void ScummEngine::loadResource(Serializer *ser, int type, int idx) { if (type == rtObjectName) { _newNames[idx] = ser->loadUint16(); } - } else if (_res->_types[type]._mode == kSoundResTypeMode) { - // HE Games use sound resource 1 for speech - if (_game.heversion >= 60 && idx == 1) - return; - - ensureResourceLoaded(type, idx); } } |