diff options
author | Matthew Hoops | 2010-01-26 23:05:52 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-01-26 23:05:52 +0000 |
commit | d4f08cbe818f2a7d80df10b468b30cc61975b422 (patch) | |
tree | 04471d1262ce260739a26e820d52055baf4a4c37 /engines/mohawk | |
parent | 77fe0215cd447ff55279b0b1feaf6b838d2dd71f (diff) | |
download | scummvm-rg350-d4f08cbe818f2a7d80df10b468b30cc61975b422.tar.gz scummvm-rg350-d4f08cbe818f2a7d80df10b468b30cc61975b422.tar.bz2 scummvm-rg350-d4f08cbe818f2a7d80df10b468b30cc61975b422.zip |
Correct our interpretation of the first four bytes of the RSRC section in Mohawk archives.
svn-id: r47583
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/resource.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/resource.h | 3 | ||||
-rw-r--r-- | engines/mohawk/riven_saveload.cpp | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 63f632de5f..62a857b90b 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -66,7 +66,12 @@ void MohawkArchive::open(Common::SeekableReadStream *stream) { if (_mhk->readUint32BE() != ID_RSRC) error ("Could not find tag \'RSRC\'"); - _rsrc.size = _mhk->readUint32BE(); + _rsrc.version = _mhk->readUint16BE(); + + if (_rsrc.version != 0x100) + error("Unsupported Mohawk resource version %d.%d", (_rsrc.version >> 8) & 0xff, _rsrc.version & 0xff); + + _rsrc.compaction = _mhk->readUint16BE(); // Only used in creation, not in reading _rsrc.filesize = _mhk->readUint32BE(); _rsrc.abs_offset = _mhk->readUint32BE(); _rsrc.file_table_offset = _mhk->readUint16BE(); diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index 6b32a32b8e..bd63ae7f44 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -166,7 +166,8 @@ struct TypeTable { }; struct RSRC_Header { - uint32 size; + uint16 version; + uint16 compaction; uint32 filesize; uint32 abs_offset; uint16 file_table_offset; diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 74a40a179e..51d92a0922 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -286,7 +286,8 @@ bool RivenSaveLoad::saveGame(Common::String filename) { // RSRC Header saveFile->writeUint32BE(ID_RSRC); - saveFile->writeUint32BE(16); // Size of RSRC + saveFile->writeUint16BE(0x100); // Resource Version (1.0) + saveFile->writeUint16BE(0); // No compaction saveFile->writeUint32BE(fileSize + 8); // Add on the 8 from the IFF header saveFile->writeUint32BE(28); // IFF + RSRC saveFile->writeUint16BE(62); // File Table Offset |