diff options
author | Bendegúz Nagy | 2016-08-26 22:18:01 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 0e0fb9763220f0949925fe8d5c6e0dcbd2a15b14 (patch) | |
tree | 0bb63ea4b872ee29282d59d0ae5ad7edeb657bd6 | |
parent | cfebcea041d9fd123e06a01d1ddaf87b6e246bc0 (diff) | |
download | scummvm-rg350-0e0fb9763220f0949925fe8d5c6e0dcbd2a15b14.tar.gz scummvm-rg350-0e0fb9763220f0949925fe8d5c6e0dcbd2a15b14.tar.bz2 scummvm-rg350-0e0fb9763220f0949925fe8d5c6e0dcbd2a15b14.zip |
DM: Some renaming
-rw-r--r-- | engines/dm/champion.cpp | 4 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 4 | ||||
-rw-r--r-- | engines/dm/dm.h | 5 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 8 | ||||
-rw-r--r-- | engines/dm/dungeonman.h | 24 |
5 files changed, 22 insertions, 23 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 6518ee9eeb..1ef0e8a81d 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -202,8 +202,8 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { int16 mapY = _vm->_dungeonMan->_currMap._partyPosY; uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._currMap._partyDir)); - mapX += gDirIntoStepCountEast[dunMan._currMap._partyDir]; - mapY += gDirIntoStepCountNorth[dunMan._currMap._partyDir]; + mapX += _dirIntoStepCountEast[dunMan._currMap._partyDir]; + mapY += _dirIntoStepCountNorth[dunMan._currMap._partyDir]; thing = dunMan.getSquareFirstThing(mapX, mapY); AL_0_slotIndex_Red = kChampionSlotBackpackLine_1_1; uint16 slotIndex_Green; diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 6d9b503399..e8543fc307 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -23,8 +23,8 @@ namespace DM { -int8 gDirIntoStepCountEast[4] = {0 /* North */, 1 /* East */, 0 /* West */, -1 /* South */}; // @ G0233_ai_Graphic559_DirectionToStepEastCount -int8 gDirIntoStepCountNorth[4] = {-1 /* North */, 0 /* East */, 1 /* West */, 0 /* South */}; // @ G0234_ai_Graphic559_DirectionToStepNorthCount +int8 _dirIntoStepCountEast[4] = {0 /* North */, 1 /* East */, 0 /* West */, -1 /* South */}; // @ G0233_ai_Graphic559_DirectionToStepEastCount +int8 _dirIntoStepCountNorth[4] = {-1 /* North */, 0 /* East */, 1 /* West */, 0 /* South */}; // @ G0234_ai_Graphic559_DirectionToStepNorthCount void turnDirRight(direction &dir) { dir = (direction)((dir + 1) & 3); } void turnDirLeft(direction &dir) { dir = (direction)((dir - 1) & 3); } diff --git a/engines/dm/dm.h b/engines/dm/dm.h index d9cecaa2ab..0b69aff89e 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -27,15 +27,14 @@ enum direction { }; // TODO: refactor direction into a class -extern int8 gDirIntoStepCountEast[4]; -extern int8 gDirIntoStepCountNorth[4]; +extern int8 _dirIntoStepCountEast[4]; +extern int8 _dirIntoStepCountNorth[4]; void turnDirRight(direction &dir); void turnDirLeft(direction &dir); direction returnOppositeDir(direction dir); bool isOrientedWestEast(direction dir); - enum ThingType { kPartyThingType = -1, // @ CM1_THING_TYPE_PARTY, special value kDoorThingType = 0, diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index f489c53d2f..d9554f29da 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -391,11 +391,11 @@ int16 DM::indexToOrdinal(int16 val) { return val + 1; } void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) { - posX += gDirIntoStepCountEast[dir] * stepsForward; - posY += gDirIntoStepCountNorth[dir] * stepsForward; + posX += _dirIntoStepCountEast[dir] * stepsForward; + posY += _dirIntoStepCountNorth[dir] * stepsForward; turnDirRight(dir); - posX += gDirIntoStepCountEast[dir] * stepsRight; - posY += gDirIntoStepCountNorth[dir] * stepsRight; + posX += _dirIntoStepCountEast[dir] * stepsRight; + posY += _dirIntoStepCountNorth[dir] * stepsRight; } DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine), _rawDunFileData(NULL), _maps(NULL), _rawMapData(NULL) { diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index ad64b85084..3dc3ab4176 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -176,19 +176,19 @@ enum TeleporterScope { class Teleporter { - Thing nextThing; - uint16 attributes; - uint16 destMapIndex; + Thing _nextThing; + uint16 _attributes; + uint16 _destMapIndex; public: - Teleporter(uint16 *rawDat) : nextThing(rawDat[0]), attributes(rawDat[1]), destMapIndex(rawDat[2]) {} - Thing getNextThing() { return nextThing; } - bool makesSound() { return (attributes >> 15) & 1; } - TeleporterScope getScope() { return (TeleporterScope)((attributes >> 13) & 1); } - bool absRotation() { return (attributes >> 12) & 1; } - direction getRotationDir() { return (direction)((attributes >> 10) & 1); } - byte getDestY() { return (attributes >> 5) & 0xF; } - byte getDestX() { return attributes & 0xF; } - uint16 getDestMapIndex() { return destMapIndex >> 8; } + Teleporter(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]), _destMapIndex(rawDat[2]) {} + Thing getNextThing() { return _nextThing; } + bool makesSound() { return (_attributes >> 15) & 1; } + TeleporterScope getScope() { return (TeleporterScope)((_attributes >> 13) & 1); } + bool absRotation() { return (_attributes >> 12) & 1; } + direction getRotationDir() { return (direction)((_attributes >> 10) & 1); } + byte getDestY() { return (_attributes >> 5) & 0xF; } + byte getDestX() { return _attributes & 0xF; } + uint16 getDestMapIndex() { return _destMapIndex >> 8; } }; // @ TELEPORTER |