mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
ULTIMA4: Janitorial
This commit is contained in:
parent
f63dd075fa
commit
bc84f8799e
@ -27,9 +27,6 @@
|
||||
namespace Ultima {
|
||||
namespace Ultima4 {
|
||||
|
||||
/**
|
||||
* Returns the opposite direction.
|
||||
*/
|
||||
Direction dirReverse(Direction dir) {
|
||||
switch (dir) {
|
||||
case DIR_NONE:
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user