[Scummvm-cvs-logs] SF.net SVN: scummvm:[53951] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Oct 30 19:27:53 CEST 2010


Revision: 53951
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53951&view=rev
Author:   drmccoy
Date:     2010-10-30 17:27:53 +0000 (Sat, 30 Oct 2010)

Log Message:
-----------
GOB: Remove the "ugly" reading of Map::_itemPoses

Removing the need to pack that struct

Modified Paths:
--------------
    scummvm/trunk/engines/gob/map.h
    scummvm/trunk/engines/gob/map_v1.cpp

Modified: scummvm/trunk/engines/gob/map.h
===================================================================
--- scummvm/trunk/engines/gob/map.h	2010-10-30 17:27:23 UTC (rev 53950)
+++ scummvm/trunk/engines/gob/map.h	2010-10-30 17:27:53 UTC (rev 53951)
@@ -63,20 +63,15 @@
 	int16 notWalkable;
 };
 
+struct ItemPos {
+	int8 x;
+	int8 y;
+	int8 orient;
+};
 
+
 class Map {
 public:
-#include "common/pack-start.h"	// START STRUCT PACKING
-
-#define szMap_ItemPos 3
-	struct ItemPos {
-		int8 x;
-		int8 y;
-		int8 orient;
-	} PACKED_STRUCT;
-
-#include "common/pack-end.h"	// END STRUCT PACKING
-
 	int16 _mapWidth;
 	int16 _mapHeight;
 

Modified: scummvm/trunk/engines/gob/map_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/map_v1.cpp	2010-10-30 17:27:23 UTC (rev 53950)
+++ scummvm/trunk/engines/gob/map_v1.cpp	2010-10-30 17:27:53 UTC (rev 53951)
@@ -98,7 +98,12 @@
 			_wayPoints[i].x = mapData.readUint16LE();
 			_wayPoints[i].y = mapData.readUint16LE();
 		}
-		mapData.read(_itemPoses, szMap_ItemPos * 20);
+
+		for (int i = 0; i < 20; i++) {
+			_itemPoses[i].x      = mapData.readByte();
+			_itemPoses[i].y      = mapData.readByte();
+			_itemPoses[i].orient = mapData.readByte();
+		}
 	}
 
 	mapData.skip(32 + 76 + 4 + 20);


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