aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/room.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/room.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/room.cpp')
-rw-r--r--engines/scumm/room.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index f672798505..7e0f70e2cd 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -525,14 +525,14 @@ void ScummEngine::resetRoomSubBlocks() {
//
// Load scale data
//
- for (i = 1; i < _res->num[rtScaleTable]; i++)
+ for (i = 1; i < _res->_types[rtScaleTable].num; i++)
_res->nukeResource(rtScaleTable, i);
ptr = findResourceData(MKTAG('S','C','A','L'), roomptr);
if (ptr) {
int s1, s2, y1, y2;
if (_game.version == 8) {
- for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 16) {
+ for (i = 1; i < _res->_types[rtScaleTable].num; i++, ptr += 16) {
s1 = READ_LE_UINT32(ptr);
y1 = READ_LE_UINT32(ptr + 4);
s2 = READ_LE_UINT32(ptr + 8);
@@ -540,7 +540,7 @@ void ScummEngine::resetRoomSubBlocks() {
setScaleSlot(i, 0, y1, s1, 0, y2, s2);
}
} else {
- for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 8) {
+ for (i = 1; i < _res->_types[rtScaleTable].num; i++, ptr += 8) {
s1 = READ_LE_UINT16(ptr);
y1 = READ_LE_UINT16(ptr + 2);
s2 = READ_LE_UINT16(ptr + 4);
@@ -794,7 +794,7 @@ void ScummEngine_v3old::resetRoomSubBlocks() {
//
// No scale data in old bundle games
//
- for (i = 1; i < _res->num[rtScaleTable]; i++)
+ for (i = 1; i < _res->_types[rtScaleTable].num; i++)
_res->nukeResource(rtScaleTable, i);
}