[Scummvm-cvs-logs] SF.net SVN: scummvm:[47583] scummvm/trunk/engines/mohawk
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Wed Jan 27 00:05:52 CET 2010
Revision: 47583
http://scummvm.svn.sourceforge.net/scummvm/?rev=47583&view=rev
Author: mthreepwood
Date: 2010-01-26 23:05:52 +0000 (Tue, 26 Jan 2010)
Log Message:
-----------
Correct our interpretation of the first four bytes of the RSRC section in Mohawk archives.
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/resource.cpp
scummvm/trunk/engines/mohawk/resource.h
scummvm/trunk/engines/mohawk/riven_saveload.cpp
Modified: scummvm/trunk/engines/mohawk/resource.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/resource.cpp 2010-01-26 22:52:08 UTC (rev 47582)
+++ scummvm/trunk/engines/mohawk/resource.cpp 2010-01-26 23:05:52 UTC (rev 47583)
@@ -66,7 +66,12 @@
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();
Modified: scummvm/trunk/engines/mohawk/resource.h
===================================================================
--- scummvm/trunk/engines/mohawk/resource.h 2010-01-26 22:52:08 UTC (rev 47582)
+++ scummvm/trunk/engines/mohawk/resource.h 2010-01-26 23:05:52 UTC (rev 47583)
@@ -166,7 +166,8 @@
};
struct RSRC_Header {
- uint32 size;
+ uint16 version;
+ uint16 compaction;
uint32 filesize;
uint32 abs_offset;
uint16 file_table_offset;
Modified: scummvm/trunk/engines/mohawk/riven_saveload.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_saveload.cpp 2010-01-26 22:52:08 UTC (rev 47582)
+++ scummvm/trunk/engines/mohawk/riven_saveload.cpp 2010-01-26 23:05:52 UTC (rev 47583)
@@ -286,7 +286,8 @@
// 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list