From 350943f291f6e6b9506bb790b7e0496504c2e6fd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 23 Dec 2008 15:26:55 +0000 Subject: Enumerated the different actor directions and fixed spelling svn-id: r35496 --- engines/saga/actor.cpp | 4 ++-- engines/saga/actor.h | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 8112ebb655..ffd725b9da 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -685,7 +685,7 @@ ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) { } - fourDirection = actorDirectectionsLUT[actor->_facingDirection]; + fourDirection = actorDirectionsLUT[actor->_facingDirection]; return &actor->_frames[frameType].directions[fourDirection]; } @@ -700,7 +700,7 @@ ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) { return &def; } frameType = CLIP(frameType, 0, actor->_framesCount - 1); - fourDirection = actorDirectectionsLUT[actor->_facingDirection]; + fourDirection = actorDirectionsLUT[actor->_facingDirection]; return &actor->_frames[frameType].directions[fourDirection]; } return NULL; diff --git a/engines/saga/actor.h b/engines/saga/actor.h index 351abd78e3..cae8dd8355 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -59,10 +59,6 @@ class HitZone; #define ACTOR_COLLISION_HEIGHT 8 #define ACTOR_DIRECTIONS_COUNT 4 // for ActorFrameSequence -#define ACTOR_DIRECTION_RIGHT 0 -#define ACTOR_DIRECTION_LEFT 1 -#define ACTOR_DIRECTION_BACK 2 -#define ACTOR_DIRECTION_FORWARD 3 #define ACTOR_SPEECH_STRING_MAX 16 // speech const #define ACTOR_SPEECH_ACTORS_MAX 8 @@ -78,6 +74,13 @@ class HitZone; #define ACTOR_INHM_SIZE 228 +enum ActorDirections { + kDirectionRight = 0, + kDirectionLeft = 1, + kDirectionUp = 2, + kDirectionDown = 3 +}; + enum ActorActions { kActionWait = 0, kActionWalkToPoint = 1, @@ -131,15 +134,15 @@ enum ActorFrameTypes { }; // Lookup table to convert 8 cardinal directions to 4 -static const int actorDirectectionsLUT[8] = { - ACTOR_DIRECTION_BACK, // kDirUp - ACTOR_DIRECTION_RIGHT, // kDirUpRight - ACTOR_DIRECTION_RIGHT, // kDirRight - ACTOR_DIRECTION_RIGHT, // kDirDownRight - ACTOR_DIRECTION_FORWARD,// kDirDown - ACTOR_DIRECTION_LEFT, // kDirDownLeft - ACTOR_DIRECTION_LEFT, // kDirLeft - ACTOR_DIRECTION_LEFT, // kDirUpLeft +static const int actorDirectionsLUT[8] = { + kDirectionUp, // kDirUp + kDirectionRight, // kDirUpRight + kDirectionRight, // kDirRight + kDirectionRight, // kDirDownRight + kDirectionDown, // kDirDown + kDirectionLeft, // kDirDownLeft + kDirectionLeft, // kDirLeft + kDirectionLeft // kDirUpLeft }; enum ActorFlagsEx { -- cgit v1.2.3