diff options
Diffstat (limited to 'engines/scumm/resource_v3.cpp')
-rw-r--r-- | engines/scumm/resource_v3.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/engines/scumm/resource_v3.cpp b/engines/scumm/resource_v3.cpp index 0f9f97ad16..f422f823b7 100644 --- a/engines/scumm/resource_v3.cpp +++ b/engines/scumm/resource_v3.cpp @@ -30,30 +30,30 @@ namespace Scumm { extern const char *resTypeFromId(int id); -int ScummEngine_v3old::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v3old::readResTypeList(ResType type) { + uint num; + ResId idx; - debug(9, "readResTypeList(%s)", resTypeFromId(id)); + debug(9, "readResTypeList(%s)", resTypeFromId(type)); num = _fileHandle->readByte(); if (num >= 0xFF) { - error("Too many %ss (%d) in directory", resTypeFromId(id), num); + error("Too many %ss (%d) in directory", resTypeFromId(type), num); } - if (id == rtRoom) { - for (i = 0; i < num; i++) - _res->_types[id]._resources[i]._roomno = i; + if (type == rtRoom) { + for (idx = 0; idx < num; idx++) + _res->_types[type]._resources[idx]._roomno = idx; _fileHandle->seek(num, SEEK_CUR); } else { - for (i = 0; i < num; i++) - _res->_types[id]._resources[i]._roomno = _fileHandle->readByte(); + for (idx = 0; idx < num; idx++) + _res->_types[type]._resources[idx]._roomno = _fileHandle->readByte(); } - for (i = 0; i < num; i++) { - _res->_types[id]._resources[i]._roomoffs = _fileHandle->readUint16LE(); - if (_res->_types[id]._resources[i]._roomoffs == 0xFFFF) - _res->_types[id]._resources[i]._roomoffs = (uint32)RES_INVALID_OFFSET; + for (idx = 0; idx < num; idx++) { + _res->_types[type]._resources[idx]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[type]._resources[idx]._roomoffs == 0xFFFF) + _res->_types[type]._resources[idx]._roomoffs = (uint32)RES_INVALID_OFFSET; } return num; |