From 8a7d0cc249ead074d7fb5bc8ff45acb279b87f80 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 30 Oct 2010 17:27:53 +0000 Subject: GOB: Remove the "ugly" reading of Map::_itemPoses Removing the need to pack that struct svn-id: r53951 --- engines/gob/map.h | 17 ++++++----------- engines/gob/map_v1.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/engines/gob/map.h b/engines/gob/map.h index f373eb2123..f8e16210ee 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -63,20 +63,15 @@ struct WayPoint { 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; diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp index 1f007dbf34..aa6603fd55 100644 --- a/engines/gob/map_v1.cpp +++ b/engines/gob/map_v1.cpp @@ -98,7 +98,12 @@ void Map_v1::loadMapObjects(const char *avjFile) { _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); -- cgit v1.2.3