From 5bacb6edeef0dac09b5e5b2ac41a6a332f78cee7 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 13 Aug 2007 14:04:50 +0000 Subject: Woodruff is now controllable svn-id: r28591 --- engines/gob/map.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'engines/gob/map.h') diff --git a/engines/gob/map.h b/engines/gob/map.h index 0e0a80aad3..acfe8b675e 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -63,9 +63,11 @@ public: #include "common/pack-end.h" // END STRUCT PACKING + byte _widthByte; int16 _mapWidth; int16 _mapHeight; int16 _screenWidth; + int16 _screenHeight; int16 _tilesWidth; int16 _tilesHeight; int16 _passWidth; @@ -107,7 +109,6 @@ public: virtual void findNearestToDest(Mult::Mult_Object *obj) = 0; virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y) = 0; - virtual void init(void) = 0; Map(GobEngine *vm); virtual ~Map(); @@ -127,18 +128,24 @@ public: virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y); virtual int8 getPass(int x, int y, int heightOff = -1) { + if (!_passMap) + return 0; + return _passMap[y * _mapWidth + x]; } virtual void setPass(int x, int y, int8 pass, int heightOff = -1) { + if (!_passMap) + return; + _passMap[y * _mapWidth + x] = pass; } - virtual void init(void); Map_v1(GobEngine *vm); virtual ~Map_v1(); protected: + void init(void); void loadSounds(Common::SeekableReadStream &data); void loadGoblins(Common::SeekableReadStream &data, uint32 gobsPos); void loadObjects(Common::SeekableReadStream &data, uint32 objsPos); @@ -153,18 +160,23 @@ public: virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y); virtual int8 getPass(int x, int y, int heightOff = -1) { + if (!_passMap) + return 0; + if (heightOff == -1) heightOff = _passWidth; return _passMap[y * heightOff + x]; } virtual void setPass(int x, int y, int8 pass, int heightOff = -1) { + if (!_passMap) + return; + if (heightOff == -1) heightOff = _passWidth; _passMap[y * heightOff + x] = pass; } - virtual void init(void); Map_v2(GobEngine *vm); virtual ~Map_v2(); @@ -172,6 +184,14 @@ protected: void loadGoblinStates(Common::SeekableReadStream &data, int index); }; +class Map_v4 : public Map_v2 { +public: + virtual void loadMapObjects(const char *avjFile); + + Map_v4(GobEngine *vm); + virtual ~Map_v4(); +}; + } // End of namespace Gob #endif // GOB_MAP_H -- cgit v1.2.3