GOB: Rename Map::_widthByte to _mapVersion
svn-id: r53950
This commit is contained in:
parent
bfa88a05a1
commit
0f536e28f9
4 changed files with 16 additions and 10 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue