diff options
author | Strangerke | 2016-09-12 21:56:49 +0200 |
---|---|---|
committer | Strangerke | 2016-09-12 21:56:49 +0200 |
commit | 935df3b397fa2d0887b8e8afa5e044ba397f5ed3 (patch) | |
tree | 3d3a90dc6774d6af19d214517298de2dda14439f /engines/dm | |
parent | ce6d3fed8f6e30f9a2ce84340e4d572c82bf6016 (diff) | |
download | scummvm-rg350-935df3b397fa2d0887b8e8afa5e044ba397f5ed3.tar.gz scummvm-rg350-935df3b397fa2d0887b8e8afa5e044ba397f5ed3.tar.bz2 scummvm-rg350-935df3b397fa2d0887b8e8afa5e044ba397f5ed3.zip |
DM: Enforce the use of Cell enum, some renaming
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/dungeonman.h | 2 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 8 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 6 | ||||
-rw-r--r-- | engines/dm/movesens.h | 2 | ||||
-rw-r--r-- | engines/dm/projexpl.cpp | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index 0177860dc5..cfa16b0efc 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -422,7 +422,7 @@ public: uint16 getActionTargetMapY() { return (_action >> 11); } uint16 getActionTargetMapX() { return (_action >> 6) & 0x1F; } - Direction getActionTargetCell() { return (Direction)((_action >> 4) & 3); } + Cell getActionTargetCell() { return (Cell)((_action >> 4) & 3); } uint16 getActionHealthMultiplier() { return ((_action >> 4) & 0xF); } // @ M45_HEALTH_MULTIPLIER uint16 getActionTicks() { return ((_action >> 4) >> 4) & 0xFFF; } // @ M46_TICKS uint16 getActionKineticEnergy() { return ((_action >> 4) & 0xFF); }// @ M47_KINETIC_ENERGY diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 6f834d3c19..5d36424cac 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -1167,15 +1167,15 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY if (_vm->_championMan->_leaderIndex == kDMChampionNone) return; - int16 L1155_i_MapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; - int16 L1156_i_MapY = _vm->_dungeonMan->_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; + int16 mapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + int16 mapY = _vm->_dungeonMan->_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; if (_vm->_championMan->_leaderEmptyHanded) { - Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(L1155_i_MapX, L1156_i_MapY); + Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { _vm->_stopWaitingForPlayerInput = true; _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); - _vm->_moveSens->addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, kDMSensorEffectToggle, _vm->_gameTime + 1); + _vm->_moveSens->addEvent(k10_TMEventTypeDoor, mapX, mapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1); return; } } else if (isLeaderHandObjThrown(posX, posY)) diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index 1258ac740c..2ab4b4b79d 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -582,7 +582,7 @@ T0266017_CheckProjectileImpacts: return false; } -void MovesensMan::addEvent(byte type, byte mapX, byte mapY, byte cell, byte effect, int32 time) { +void MovesensMan::addEvent(byte type, byte mapX, byte mapY, Cell cell, byte effect, int32 time) { TimelineEvent newEvent; _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, time); newEvent._type = type; @@ -910,8 +910,8 @@ void MovesensMan::triggerEffect(Sensor *sensor, SensorEffect effect, int16 mapX, int16 targetMapX = sensor->getActionTargetMapX(); int16 targetMapY = sensor->getActionTargetMapY(); SquareType curSquareType = Square(_vm->_dungeonMan->_currMapData[targetMapX][targetMapY]).getType(); - uint16 targetCell; - if (curSquareType == (int)kDMElementTypeWall) + Cell targetCell; + if (curSquareType == k0_WallElemType) targetCell = sensor->getActionTargetCell(); else targetCell = kDMCellNorthWest; diff --git a/engines/dm/movesens.h b/engines/dm/movesens.h index 1a7e230d16..7c2a6bbc6b 100644 --- a/engines/dm/movesens.h +++ b/engines/dm/movesens.h @@ -64,7 +64,7 @@ public: bool getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destMapX, int16 destMapY); // @ F0267_MOVE_GetMoveResult_CPSCE bool isLevitating(Thing thing); // @ F0264_MOVE_IsLevitating bool moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY, Thing thing); // @ F0266_MOVE_IsKilledByProjectileImpact - void addEvent(byte type, byte mapX, byte mapY, byte cell, byte effect, int32 time); // @ F0268_SENSOR_AddEvent + void addEvent(byte type, byte mapX, byte mapY, Cell cell, byte effect, int32 time); // @ F0268_SENSOR_AddEvent int16 getSound(byte creatureType); // @ F0514_MOVE_GetSound int16 getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing thing, uint16 mapIndex);// @ F0262_MOVE_GetTeleporterRotatedGroupResult Thing getTeleporterRotatedProjectileThing(Teleporter *teleporter, Thing projectileThing); // @ F0263_MOVE_GetTeleporterRotatedProjectileThing diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index 74ba24bbe9..7f8696f3d1 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -118,7 +118,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in Door *curDoor = (Door *)_vm->_dungeonMan->getSquareFirstThingData(projectileTargetMapX, projectileTargetMapY); if ((curDoorState != k5_doorState_DESTROYED) && (projectileAssociatedThing == Thing::_explOpenDoor)) { if (curDoor->hasButton()) - _vm->_moveSens->addEvent(k10_TMEventTypeDoor, projectileTargetMapX, projectileTargetMapY, 0, kDMSensorEffectToggle, _vm->_gameTime + 1); + _vm->_moveSens->addEvent(k10_TMEventTypeDoor, projectileTargetMapX, projectileTargetMapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1); break; } |