mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-21 01:05:59 +00:00
Correct our interpretation of the first four bytes of the RSRC section in Mohawk archives.
svn-id: r47583
This commit is contained in:
parent
77fe0215cd
commit
d4f08cbe81
@ -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();
|
||||
|
@ -166,7 +166,8 @@ struct TypeTable {
|
||||
};
|
||||
|
||||
struct RSRC_Header {
|
||||
uint32 size;
|
||||
uint16 version;
|
||||
uint16 compaction;
|
||||
uint32 filesize;
|
||||
uint32 abs_offset;
|
||||
uint16 file_table_offset;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user