From ab7d5aa9afc82598dc17dcfe3c4f26615b0e84e9 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Mon, 24 Aug 2009 14:19:00 +0000 Subject: [PATCH] Turn move status into an enum git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8048 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/move.h | 14 -------------- src/movedef.h | 28 ++++++++++++++++++++++------ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/move.h b/src/move.h index 544bcec59..bc0e1db93 100644 --- a/src/move.h +++ b/src/move.h @@ -26,20 +26,6 @@ #include "objectdef.h" -#define MOVEINACTIVE 0 -#define MOVENAVIGATE 1 -#define MOVETURN 2 -#define MOVEPAUSE 3 -#define MOVEPOINTTOPOINT 4 -#define MOVETURNSTOP 5 -#define MOVETURNTOTARGET 6 -#define MOVEROUTE 7 -#define MOVEHOVER 8 -#define MOVEDRIVE 9 -#define MOVEWAITROUTE 11 -#define MOVESHUFFLE 12 -#define MOVEROUTESHUFFLE 13 - /* The base movement speed */ extern float baseSpeed; diff --git a/src/movedef.h b/src/movedef.h index 789ed397d..19728f3b9 100644 --- a/src/movedef.h +++ b/src/movedef.h @@ -27,16 +27,32 @@ //Watermelon:num of VTOL weapons should be same as DROID_MAXWEAPS #define VTOL_MAXWEAPS 3 +typedef enum _move_status +{ +MOVEINACTIVE, +MOVENAVIGATE, +MOVETURN, +MOVEPAUSE, +MOVEPOINTTOPOINT, +MOVETURNSTOP, +MOVETURNTOTARGET, +MOVEROUTE, +MOVEHOVER, +MOVEDRIVE, +MOVEWAITROUTE, +MOVESHUFFLE, +MOVEROUTESHUFFLE, +} MOVE_STATUS; + typedef struct _move_control { - UBYTE Status; // Inactive, Navigating or moving point to point status - UBYTE Position; // Position in asPath - UBYTE numPoints; // number of points in asPath - Vector2i *asPath; // Pointer to list of block X,Y map coordinates. + MOVE_STATUS Status; // Inactive, Navigating or moving point to point status + uint16_t Position; // Position in asPath + uint16_t numPoints; // number of points in asPath + Vector2i *asPath; // Pointer to list of block X,Y map coordinates. + SDWORD DestinationX, DestinationY; // World coordinates of movement destination SDWORD srcX,srcY,targetX,targetY; - - /* Stuff for John's movement update */ float fx,fy; // droid location as a fract float speed; // Speed of motion SWORD boundX,boundY; // Vector for the end of path boundary