diff options
author | James Brown | 2003-05-29 08:05:20 +0000 |
---|---|---|
committer | James Brown | 2003-05-29 08:05:20 +0000 |
commit | aa919f35089dc5d6b20283da0e05bc1e6277ce6e (patch) | |
tree | c6092a51cfe2f84afeeefaad222c1da3f9447903 /scumm/resource_v2.cpp | |
parent | 19684947dfd372a17a046ac6d94f7fef27f6b133 (diff) | |
download | scummvm-rg350-aa919f35089dc5d6b20283da0e05bc1e6277ce6e.tar.gz scummvm-rg350-aa919f35089dc5d6b20283da0e05bc1e6277ce6e.tar.bz2 scummvm-rg350-aa919f35089dc5d6b20283da0e05bc1e6277ce6e.zip |
A few small V2 detection/init changes
svn-id: r8085
Diffstat (limited to 'scumm/resource_v2.cpp')
-rw-r--r-- | scumm/resource_v2.cpp | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/scumm/resource_v2.cpp b/scumm/resource_v2.cpp index 76d997ad87..1e0fc3c073 100644 --- a/scumm/resource_v2.cpp +++ b/scumm/resource_v2.cpp @@ -24,18 +24,11 @@ #include "intern.h" #include "resource.h" +void Scumm_v2::readClassicIndexFile() { + error("Classic non-blocked format not yet implemented"); +} -void Scumm_v2::readIndexFile() { - int magic = 0; - debug(9, "readIndexFile()"); - - closeRoom(); - openRoom(0); - - magic = _fileHandle.readUint16LE(); - if (magic != 0x0100) - warning("The magic id doesn't match (0x%X)", magic); - +void Scumm_v2::readEnhancedIndexFile() { _numGlobalObjects = _fileHandle.readUint16LE(); _fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags _numRooms = _fileHandle.readByte(); @@ -68,6 +61,30 @@ void Scumm_v2::readIndexFile() { readResTypeList(rtCostume, MKID('COST'), "costume"); readResTypeList(rtScript, MKID('SCRP'), "script"); readResTypeList(rtSound, MKID('SOUN'), "sound"); +} + +void Scumm_v2::readIndexFile() { + int magic = 0; + debug(9, "readIndexFile()"); + + closeRoom(); + openRoom(0); + + magic = _fileHandle.readUint16LE(); + + switch(magic) { + case 0x0100: + warning("Enhanced V2 game detected"); + readEnhancedIndexFile(); + break; + case 0x0A31: + warning("Classic V1 game detected"); + readClassicIndexFile(); + break; + default: + error("Unknown magic id (0x%X) - this version is unsupported", magic); + break; + } closeRoom(); } @@ -94,7 +111,6 @@ void Scumm_v2::readMAXS() { } void Scumm_v2::loadCharset(int num) { - warning("loadCharset(%d): Charset loading not yet implemented for V1/V2", num); - // TODO: For the old games, the charset is actually encoded in the engine. So we must - // rip it out of one of the .exes, and create a fake resource here. + // Stub, V2 font resources are hardcoded into the engine. Possibly do some + // kind of language detection here in the future for multiple fonts... } |