SCUMM: cleanup (moved small header specific code from ScummEngine::readResTypeList to ScummEngine_v4::readResTypeList)
svn-id: r25827
This commit is contained in:
parent
dcc6e2c0bb
commit
04a18dd7c4
3 changed files with 32 additions and 18 deletions
|
@ -214,6 +214,7 @@ public:
|
|||
virtual void resetScumm();
|
||||
|
||||
protected:
|
||||
virtual void readResTypeList(int id, const char *name);
|
||||
virtual void readIndexFile();
|
||||
virtual void loadCharset(int no);
|
||||
virtual void resetRoomObjects();
|
||||
|
|
|
@ -512,12 +512,6 @@ void ScummEngine::readResTypeList(int id, const char *name) {
|
|||
error("Invalid number of %ss (%d) in directory", name, num);
|
||||
}
|
||||
|
||||
if (_game.features & GF_SMALL_HEADER) {
|
||||
for (i = 0; i < num; i++) {
|
||||
_res->roomno[id][i] = _fileHandle->readByte();
|
||||
_res->roomoffs[id][i] = _fileHandle->readUint32LE();
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < num; i++) {
|
||||
_res->roomno[id][i] = _fileHandle->readByte();
|
||||
}
|
||||
|
@ -534,7 +528,6 @@ void ScummEngine::readResTypeList(int id, const char *name) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ResourceManager::allocResTypeData(int id, uint32 tag, int num_, const char *name_, int mode_) {
|
||||
debug(9, "allocResTypeData(%s/%s,%s,%d,%d)", resTypeFromId(id), name_, tag2str(TO_BE_32(tag)), num_, mode_);
|
||||
|
|
|
@ -30,6 +30,26 @@
|
|||
|
||||
namespace Scumm {
|
||||
|
||||
extern const char *resTypeFromId(int id);
|
||||
|
||||
void ScummEngine_v4::readResTypeList(int id, const char *name) {
|
||||
int num;
|
||||
int i;
|
||||
|
||||
debug(9, "readResTypeList(%s,%s)", resTypeFromId(id), name);
|
||||
|
||||
num = _fileHandle->readUint16LE();
|
||||
|
||||
if (num != _res->num[id]) {
|
||||
error("Invalid number of %ss (%d) in directory", name, num);
|
||||
}
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
_res->roomno[id][i] = _fileHandle->readByte();
|
||||
_res->roomoffs[id][i] = _fileHandle->readUint32LE();
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v4::readIndexFile() {
|
||||
uint16 blocktype;
|
||||
uint32 itemsize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue