aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/saveload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r--engines/scumm/saveload.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index b823e3c8f5..f5d219c721 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -427,7 +427,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
// Nuke all resources
for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1))
if (type != rtTemp && type != rtBuffer && (type != rtSound || _saveSound || !compat))
- for (ResId idx = 0; idx < _res->_types[type]._resources.size(); idx++) {
+ for (ResId idx = 0; idx < _res->_types[type].size(); idx++) {
_res->nukeResource(type, idx);
}
@@ -516,7 +516,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
// loading such an old save game, try to upgrade the old to new format.
if (hdr.ver < VER(22)) {
// Convert all rtScaleTable resources to matching scale items
- for (ResId idx = 1; idx < _res->_types[rtScaleTable]._resources.size(); idx++) {
+ for (ResId idx = 1; idx < _res->_types[rtScaleTable].size(); idx++) {
convertScaleTableToScaleSlot(idx);
}
}
@@ -1245,9 +1245,9 @@ void ScummEngine::saveOrLoad(Serializer *s) {
for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) {
if (_res->_types[type]._mode != kStaticResTypeMode && type != rtTemp && type != rtBuffer) {
s->saveUint16(type); // Save the res type...
- for (idx = 0; idx < _res->_types[type]._resources.size(); idx++) {
+ for (idx = 0; idx < _res->_types[type].size(); idx++) {
// Only save resources which actually exist...
- if (_res->_types[type]._resources[idx]._address) {
+ if (_res->_types[type][idx]._address) {
s->saveUint16(idx); // Save the index of the resource
saveResource(s, type, idx);
}
@@ -1259,7 +1259,7 @@ void ScummEngine::saveOrLoad(Serializer *s) {
} else {
while ((type = (ResType)s->loadUint16()) != 0xFFFF) {
while ((idx = s->loadUint16()) != 0xFFFF) {
- assert(idx < _res->_types[type]._resources.size());
+ assert(idx < _res->_types[type].size());
loadResource(s, type, idx);
}
}
@@ -1275,7 +1275,7 @@ void ScummEngine::saveOrLoad(Serializer *s) {
// unchanged resource counts, we have to hard code the following check
if (_game.version < 6 && type == rtObjectName)
continue;
- for (idx = 1; idx < _res->_types[type]._resources.size(); idx++)
+ for (idx = 1; idx < _res->_types[type].size(); idx++)
loadResourceOLD(s, type, idx);
}
}
@@ -1388,7 +1388,7 @@ void ScummEngine::saveOrLoad(Serializer *s) {
//
if (s->isSaving()) {
for (type = rtFirst; type <= rtLast; type = ResType(type + 1))
- for (idx = 1; idx < _res->_types[type]._resources.size(); idx++) {
+ for (idx = 1; idx < _res->_types[type].size(); idx++) {
if (_res->isLocked(type, idx)) {
s->saveByte(type);
s->saveUint16(idx);
@@ -1663,11 +1663,11 @@ void ScummEngine::loadResourceOLD(Serializer *ser, ResType type, ResId idx) {
}
void ScummEngine::saveResource(Serializer *ser, ResType type, ResId idx) {
- assert(_res->_types[type]._resources[idx]._address);
+ assert(_res->_types[type][idx]._address);
if (_res->_types[type]._mode == kDynamicResTypeMode) {
- byte *ptr = _res->_types[type]._resources[idx]._address;
- uint32 size = _res->_types[type]._resources[idx]._size;
+ byte *ptr = _res->_types[type][idx]._address;
+ uint32 size = _res->_types[type][idx]._size;
ser->saveUint32(size);
ser->saveBytes(ptr, size);