From 45e65d7ea04b10cf7bb5282bd66b8df609700a63 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 11 May 2011 16:23:26 +0200 Subject: 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. --- engines/scumm/room.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/scumm/room.cpp') 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); } -- cgit v1.2.3