diff --git a/engines/ultima/ultima4/map/direction.cpp b/engines/ultima/ultima4/map/direction.cpp index 24023c60b01..032dbadd0e2 100644 --- a/engines/ultima/ultima4/map/direction.cpp +++ b/engines/ultima/ultima4/map/direction.cpp @@ -27,9 +27,6 @@ namespace Ultima { namespace Ultima4 { -/** - * Returns the opposite direction. - */ Direction dirReverse(Direction dir) { switch (dir) { case DIR_NONE: diff --git a/engines/ultima/ultima4/map/direction.h b/engines/ultima/ultima4/map/direction.h index 55013c85d50..134f9809d48 100644 --- a/engines/ultima/ultima4/map/direction.h +++ b/engines/ultima/ultima4/map/direction.h @@ -49,7 +49,11 @@ enum Direction { #define DIR_ADD_TO_MASK(dir,mask) ((1 << (dir)) | (mask)) #define DIR_REMOVE_FROM_MASK(dir,mask) ((~(1 << (dir))) & (mask)) +/** + * Returns the opposite direction. + */ Direction dirReverse(Direction dir); + Direction dirFromMask(int dir_mask); Direction dirRotateCW(Direction dir); Direction dirRotateCCW(Direction dir); diff --git a/engines/ultima/ultima4/map/location.cpp b/engines/ultima/ultima4/map/location.cpp index aa2cdb1711e..3d2f78581c5 100644 --- a/engines/ultima/ultima4/map/location.cpp +++ b/engines/ultima/ultima4/map/location.cpp @@ -245,8 +245,8 @@ int Location::getCurrentPosition(MapCoords *coords) { MoveResult Location::move(Direction dir, bool userEvent) { MoveEvent event(dir, userEvent); - switch (_map->_type) { + switch (_map->_type) { case Map::DUNGEON: moveAvatarInDungeon(event); break; @@ -266,7 +266,6 @@ MoveResult Location::move(Direction dir, bool userEvent) { return event._result; } - void locationFree(Location **stack) { delete locationPop(stack); } diff --git a/engines/ultima/ultima4/map/map.cpp b/engines/ultima/ultima4/map/map.cpp index e01678e91f9..21df967716d 100644 --- a/engines/ultima/ultima4/map/map.cpp +++ b/engines/ultima/ultima4/map/map.cpp @@ -44,9 +44,11 @@ namespace Ultima4 { bool MapCoords::operator==(const MapCoords &a) const { return (x == a.x) && (y == a.y) && (z == a.z); } + bool MapCoords::operator!=(const MapCoords &a) const { return !operator==(a); } + bool MapCoords::operator<(const MapCoords &a) const { if (x > a.x) return false; @@ -55,7 +57,6 @@ bool MapCoords::operator<(const MapCoords &a) const { return z < a.z; } - MapCoords &MapCoords::wrap(const Map *map) { if (map && map->_borderBehavior == Map::BORDER_WRAP) { while (x < 0) diff --git a/engines/ultima/ultima4/map/movement.cpp b/engines/ultima/ultima4/map/movement.cpp index ef4631d3b59..cf3d4ae8602 100644 --- a/engines/ultima/ultima4/map/movement.cpp +++ b/engines/ultima/ultima4/map/movement.cpp @@ -38,11 +38,6 @@ namespace Ultima { namespace Ultima4 { -/** - * Attempt to move the avatar in the given direction. User event - * should be set if the avatar is being moved in response to a - * keystroke. Returns zero if the avatar is blocked. - */ void moveAvatar(MoveEvent &event) { MapCoords newCoords; int slowed = 0; @@ -128,9 +123,6 @@ void moveAvatar(MoveEvent &event) { event._result = (MoveResult)(MOVE_SUCCEEDED | MOVE_END_TURN); } -/** - * Moves the avatar while in dungeon view - */ void moveAvatarInDungeon(MoveEvent &event) { MapCoords newCoords; Direction realDir = dirNormalize((Direction)g_ultima->_saveGame->_orientation, event._dir); /* get our real direction */ diff --git a/engines/ultima/ultima4/map/movement.h b/engines/ultima/ultima4/map/movement.h index 57752765659..0a883d5aae5 100644 --- a/engines/ultima/ultima4/map/movement.h +++ b/engines/ultima/ultima4/map/movement.h @@ -60,7 +60,16 @@ public: MoveResult _result; /**< how the movement was resolved */ }; +/** + * Attempt to move the avatar in the given direction. User event + * should be set if the avatar is being moved in response to a + * keystroke. Returns zero if the avatar is blocked. + */ void moveAvatar(MoveEvent &event); + +/** + * Moves the avatar while in dungeon view + */ void moveAvatarInDungeon(MoveEvent &event); /**