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/resource_v4.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/scumm/resource_v4.cpp') diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index a3a2786e20..8fc27627b2 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -38,13 +38,13 @@ int ScummEngine_v4::readResTypeList(int id) { num = _fileHandle->readUint16LE(); - if (num != _res->num[id]) { + if (num != _res->_types[id].num) { error("Invalid number of %ss (%d) in directory", resTypeFromId(id), num); } for (i = 0; i < num; i++) { - _res->roomno[id][i] = _fileHandle->readByte(); - _res->roomoffs[id][i] = _fileHandle->readUint32LE(); + _res->_types[id].roomno[i] = _fileHandle->readByte(); + _res->_types[id].roomoffs[i] = _fileHandle->readUint32LE(); } return num; -- cgit v1.2.3