diff options
author | Sven Hesse | 2010-10-30 17:27:23 +0000 |
---|---|---|
committer | Sven Hesse | 2010-10-30 17:27:23 +0000 |
commit | 0f536e28f9c3b6ee7bb3a92de49c8efc03e70ea8 (patch) | |
tree | 5b351acaf98781614fc3d5846895d1a416c0ad69 /engines/gob | |
parent | bfa88a05a153ec7c91d0b2e79c9f5705c9ba55ed (diff) | |
download | scummvm-rg350-0f536e28f9c3b6ee7bb3a92de49c8efc03e70ea8.tar.gz scummvm-rg350-0f536e28f9c3b6ee7bb3a92de49c8efc03e70ea8.tar.bz2 scummvm-rg350-0f536e28f9c3b6ee7bb3a92de49c8efc03e70ea8.zip |
GOB: Rename Map::_widthByte to _mapVersion
svn-id: r53950
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/goblin_v4.cpp | 2 | ||||
-rw-r--r-- | engines/gob/map.cpp | 8 | ||||
-rw-r--r-- | engines/gob/map.h | 6 | ||||
-rw-r--r-- | engines/gob/map_v2.cpp | 10 |
4 files changed, 16 insertions, 10 deletions
diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp index f4b0ecdd20..0b0ff0e4f9 100644 --- a/engines/gob/goblin_v4.cpp +++ b/engines/gob/goblin_v4.cpp @@ -135,7 +135,7 @@ void Goblin_v4::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 obj->destX = destX; obj->destY = destY; - if (_vm->_map->_widthByte == 4) { + if (_vm->_map->getVersion() == 4) { switch (dir) { case kDirNW: animData->nextState = turnState(animData->state, kDirNW); diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 1310798d2d..95b4c1b318 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -32,13 +32,13 @@ namespace Gob { Map::Map(GobEngine *vm) : _vm(vm) { + _mapVersion = 0; + _passWidth = 0; _mapWidth = -1; _mapHeight = -1; _passMap = 0; - _widthByte = 0; - _screenWidth = 0; _screenHeight = 0; _tilesWidth = 0; @@ -82,6 +82,10 @@ Map::~Map() { delete[] _wayPoints; } +uint8 Map::getVersion() const { + return _mapVersion; +} + int8 Map::getPass(int x, int y, int width) const { if (!_passMap) return 0; diff --git a/engines/gob/map.h b/engines/gob/map.h index a04fe43283..f373eb2123 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -80,8 +80,6 @@ public: int16 _mapWidth; int16 _mapHeight; - byte _widthByte; - int16 _screenWidth; int16 _screenHeight; int16 _tilesWidth; @@ -107,6 +105,8 @@ public: Map(GobEngine *vm); virtual ~Map(); + uint8 getVersion() const; + int8 getPass(int x, int y, int width = -1) const; void setPass(int x, int y, int8 pass, int width = -1); @@ -139,6 +139,8 @@ protected: bool _loadFromAvo; + uint8 _mapVersion; + int16 _passWidth; int8 *_passMap; // [y * _mapWidth + x], getPass(x, y); diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp index 968663a4b4..15bc709411 100644 --- a/engines/gob/map_v2.cpp +++ b/engines/gob/map_v2.cpp @@ -100,11 +100,11 @@ void Map_v2::loadMapObjects(const char *avjFile) { Common::SeekableReadStream &mapData = *resource->stream(); - _widthByte = mapData.readByte(); - if (_widthByte == 4) { + _mapVersion = mapData.readByte(); + if (_mapVersion == 4) { _screenWidth = 640; _screenHeight = 400; - } else if (_widthByte == 3) { + } else if (_mapVersion == 3) { _passWidth = 65; _screenWidth = 640; _screenHeight = 200; @@ -121,7 +121,7 @@ void Map_v2::loadMapObjects(const char *avjFile) { _bigTiles = !(_tilesHeight & 0xFF00); _tilesHeight &= 0xFF; - if (_widthByte == 4) { + if (_mapVersion == 4) { _screenWidth = mapData.readSint16LE(); _screenHeight = mapData.readSint16LE(); } @@ -145,7 +145,7 @@ void Map_v2::loadMapObjects(const char *avjFile) { _wayPoints[i].notWalkable = mapData.readSByte(); } - if (_widthByte == 4) { + if (_mapVersion == 4) { _mapWidth = VAR(17); _passWidth = _mapWidth; } |