[Scummvm-cvs-logs] SF.net SVN: scummvm: [20867] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Feb 24 18:48:02 CET 2006


Revision: 20867
Author:   fingolfin
Date:     2006-02-24 18:47:22 -0800 (Fri, 24 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20867&view=rev

Log Message:
-----------
Some more MKID -> MKID_BE changes

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/thumbnail.cpp
Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2006-02-25 02:35:45 UTC (rev 20866)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2006-02-25 02:47:22 UTC (rev 20867)
@@ -165,12 +165,10 @@
 
 	// Since version 52 a thumbnail is saved directly after the header.
 	if (hdr.ver >= VER(52)) {
-		uint32 type;
-		in->read(&type, 4);
-
+		uint32 type = in->readUint32BE();
 		// Check for the THMB header. Also, work around a bug which caused
 		// the chunk type (incorrectly) to be written in LE on LE machines.
-		if (! (type == MKID('THMB') || (hdr.ver < VER(55) && type == MKID('BMHT')))){
+		if (! (type == MKID_BE('THMB') || (hdr.ver < VER(55) && type == MKID_BE('BMHT')))){
 			warning("Can not load thumbnail");
 			delete in;
 			return false;
@@ -521,12 +519,11 @@
 		return false;
 	}
 
-	uint32 type;
-	in->read(&type, 4);
+	uint32 type = in->readUint32BE();
 
 	// Check for the THMB header. Also, work around a bug which caused
 	// the chunk type (incorrectly) to be written in LE on LE machines.
-	if (! (type == MKID('THMB') || (hdr.ver < VER(55) && type == MKID('BMHT')))){
+	if (! (type == MKID_BE('THMB') || (hdr.ver < VER(55) && type == MKID_BE('BMHT')))){
 		delete in;
 		return false;
 	}
@@ -546,8 +543,8 @@
 	memset(stuff, 0, sizeof(InfoStuff));
 
 	SaveInfoSection section;
-	file->read(&section.type, 4);
-	if (section.type != MKID('INFO')) {
+	section.type = file->readUint32BE();
+	if (section.type != MKID_BE('INFO')) {
 		return false;
 	}
 
@@ -594,7 +591,7 @@
 
 void ScummEngine::saveInfos(Common::OutSaveFile* file) {
 	SaveInfoSection section;
-	section.type = MKID('INFO');
+	section.type = MKID_BE('INFO');
 	section.version = INFOSECTION_VERSION;
 	section.size = sizeof(SaveInfoSection);
 
@@ -607,7 +604,7 @@
 	section.date = (curTime->tm_mday & 0xFF) << 24 | ((curTime->tm_mon + 1) & 0xFF) << 16 | (curTime->tm_year + 1900) & 0xFFFF;
 	section.time = (curTime->tm_hour & 0xFF) << 8 | (curTime->tm_min) & 0xFF;
 
-	file->write(&section.type, 4);
+	file->writeUint32BE(section.type);
 	file->writeUint32BE(section.version);
 	file->writeUint32BE(section.size);
 	file->writeUint32BE(section.timeTValue);

Modified: scummvm/trunk/engines/scumm/thumbnail.cpp
===================================================================
--- scummvm/trunk/engines/scumm/thumbnail.cpp	2006-02-25 02:35:45 UTC (rev 20866)
+++ scummvm/trunk/engines/scumm/thumbnail.cpp	2006-02-25 02:47:22 UTC (rev 20867)
@@ -56,11 +56,12 @@
 
 Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) {
 	ThumbnailHeader header;
-	file->read(&header.type, 4);
+
+	header.type = file->readUint32BE();
 	// We also accept the bad 'BMHT' header here, for the sake of compatibility
 	// with some older savegames which were written incorrectly due to a bug in
 	// ScummVM which wrote the thumb header type incorrectly on LE systems.
-	if (header.type != MKID('THMB') && header.type != MKID('BMHT'))
+	if (header.type != MKID_BE('THMB') && header.type != MKID_BE('BMHT'))
 		return 0;
 
 	header.size = file->readUint32BE();
@@ -109,7 +110,7 @@
 		thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16));
 
 	ThumbnailHeader header;
-	header.type = MKID('THMB');
+	header.type = MKID_BE('THMB');
 #if defined(PALMOS_ARM) || defined(__GP32__)
 	// sizeof(header) is hardcoded here, because the compiler add padding to
 	// have a 4byte aligned struct and there is no easy way to pack it.
@@ -122,7 +123,7 @@
 	header.height = thumb.h;
 	header.bpp = thumb.bytesPerPixel;
 
-	file->write(&header.type, 4);
+	file->writeUint32BE(header.type);
 	file->writeUint32BE(header.size);
 	file->writeByte(header.version);
 	file->writeUint16BE(header.width);







More information about the Scummvm-git-logs mailing list