aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/object.cpp
diff options
context:
space:
mode:
authorMax Horn2011-05-11 16:23:26 +0200
committerMax Horn2011-05-13 11:47:08 +0200
commit45e65d7ea04b10cf7bb5282bd66b8df609700a63 (patch)
tree9600fbf0670d552e5b68b7f55c446c0fb5c9596d /engines/scumm/object.cpp
parentb37463fe5921420a9081aa6c5cf7588d52b41e78 (diff)
downloadscummvm-rg350-45e65d7ea04b10cf7bb5282bd66b8df609700a63.tar.gz
scummvm-rg350-45e65d7ea04b10cf7bb5282bd66b8df609700a63.tar.bz2
scummvm-rg350-45e65d7ea04b10cf7bb5282bd66b8df609700a63.zip
SCUMM: Refactor how resource (types) are srepresented
Previously, we had a couple of arrays of size N (where N = number of resource types), one for each attribute of a resource type (such as as the number of resources of that type. Now, we have one array of size N, whose elements are a record aggregating all the attributes of each resource type.
Diffstat (limited to 'engines/scumm/object.cpp')
-rw-r--r--engines/scumm/object.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index 8b4d39a838..457e2c717c 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -192,8 +192,8 @@ void ScummEngine::clearOwnerOf(int obj) {
if (!_inventory[i] && _inventory[i+1]) {
_inventory[i] = _inventory[i+1];
_inventory[i+1] = 0;
- _res->address[rtInventory][i] = _res->address[rtInventory][i + 1];
- _res->address[rtInventory][i + 1] = NULL;
+ _res->_types[rtInventory].address[i] = _res->_types[rtInventory].address[i + 1];
+ _res->_types[rtInventory].address[i + 1] = NULL;
}
}
break;
@@ -1796,7 +1796,7 @@ int ScummEngine::findLocalObjectSlot() {
int ScummEngine::findFlObjectSlot() {
int i;
for (i = 1; i < _numFlObject; i++) {
- if (_res->address[rtFlObject][i] == NULL)
+ if (_res->_types[rtFlObject].address[i] == NULL)
return i;
}
error("findFlObjectSlot: Out of FLObject slots");