[Scummvm-cvs-logs] SF.net SVN: scummvm: [25094] scummvm/trunk/engines/parallaction/graphics. cpp

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Jan 15 21:46:07 CET 2007


Revision: 25094
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25094&view=rev
Author:   peres001
Date:     2007-01-15 12:46:06 -0800 (Mon, 15 Jan 2007)

Log Message:
-----------
enforced MemoryReadStream usage instead of custom byte swapping in background loading

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.cpp

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-01-15 20:11:49 UTC (rev 25093)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-01-15 20:46:06 UTC (rev 25094)
@@ -1108,16 +1108,7 @@
 //	* path data [bit 8] (walkable areas)
 //
 
-uint16 _swap_16(uint16 *v) {
 
-	uint16 v2 = *v;
-	uint16 v3 = *v & 0xFF;
-	*v = (v3 << 8) | ((v2 >> 8) & 0xFF);
-
-	return *v;
-}
-
-
 void unpackBackgroundScanline(byte *src, byte *screen, byte *mask, byte *path) {
 
 	// update mask, path and screen
@@ -1143,8 +1134,10 @@
 	byte v150[4];
 	readArchivedFile(file, _palette, PALETTE_SIZE);
 	readArchivedFile(file, &v150, 4);
-	readArchivedFile(file, _palettefx, sizeof(PaletteFxRange)*6);
 
+	byte tempfx[sizeof(PaletteFxRange)*6];
+	readArchivedFile(file, &tempfx, sizeof(PaletteFxRange)*6);
+
 //	setPalette(palette);
 
 	uint16 _si;
@@ -1153,10 +1146,13 @@
 		_bgLayers[_si] = _al;
 	}
 
+    Common::MemoryReadStream sread(tempfx, sizeof(PaletteFxRange)*6);
 	for (_si = 0; _si < 6; _si++) {
-		_swap_16(&_palettefx[_si]._timer);
-		_swap_16(&_palettefx[_si]._step);
-		_swap_16(&_palettefx[_si]._flags);
+	    _palettefx[_si]._timer = sread.readUint16BE();
+	    _palettefx[_si]._step = sread.readUint16BE();
+	    _palettefx[_si]._flags = sread.readUint16BE();
+	    _palettefx[_si]._first = sread.readByte();
+	    _palettefx[_si]._last = sread.readByte();
 	}
 
 #if 0


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