ULTIMA4: Janitorial

This commit is contained in:
Paul Gilbert 2020-05-12 20:16:24 -07:00
parent f63dd075fa
commit bc84f8799e
6 changed files with 16 additions and 14 deletions

View File

@ -27,9 +27,6 @@
namespace Ultima {
namespace Ultima4 {
/**
* Returns the opposite direction.
*/
Direction dirReverse(Direction dir) {
switch (dir) {
case DIR_NONE:

View File

@ -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);

View File

@ -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);
}

View File

@ -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)

View File

@ -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 */

View File

@ -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);
/**