Fix for bug #734154 (DIG: Savegame/Island names)

svn-id: r11928
This commit is contained in:
Max Horn 2003-12-25 22:05:02 +00:00
parent dc116a34af
commit 3959b96c9a
2 changed files with 8 additions and 1 deletions

View File

@ -135,6 +135,7 @@ bool ScummEngine::loadState(int slot, bool compat, SaveFileManager *mgr) {
CHECK_HEAP
closeRoom();
memset(_inventory, 0, sizeof(_inventory[0]) * _numInventory);
memset(_newNames, 0, sizeof(_newNames[0]) * _numNewNames);
/* Nuke all resources */
for (i = rtFirst; i <= rtLast; i++)
@ -728,6 +729,9 @@ void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) {
if (type == rtInventory) {
ser->saveWord(_inventory[idx]);
}
if (type == rtObjectName && ser->getVersion() >= VER(25)) {
ser->saveWord(_newNames[idx]);
}
} else {
size = ser->loadUint32();
if (size) {
@ -736,6 +740,9 @@ void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) {
if (type == rtInventory) {
_inventory[idx] = ser->loadWord();
}
if (type == rtObjectName && ser->getVersion() >= VER(25)) {
_newNames[idx] = ser->loadWord();
}
}
}
} else if (res.mode[type] == 2 && ser->getVersion() >= VER(23)) {

View File

@ -32,7 +32,7 @@ namespace Scumm {
// Can be useful for other ports too :)
#define VER(x) x
#define CURRENT_VER 24
#define CURRENT_VER 25
// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
// we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC