00001
00024 #ifndef __player_h__
00025 #define __player_h__
00026
00027 #include "render.h"
00028 #include "genconmac.h"
00029 #include "text.h"
00030
00038 struct UpdateTimes_t {
00042 Uint32 tankPosTime;
00046 Uint32 shellPosTime;
00050 Uint32 dfsTime;
00054 Uint32 identTime;
00055 };
00056
00057 typedef struct UpdateTimes_t UpdateTimes;
00058
00071 enum PLAYER_FLAGS {
00075 PLAYER_FORWARD = 1,
00079 PLAYER_BACKWARD = 2,
00083 PLAYER_ROTRIGHT = 4,
00087 PLAYER_STARTROTRIGHT = 8,
00091 PLAYER_ROTLEFT = 0x10,
00095 PLAYER_STARTROTLEFT = 0x20,
00099 PLAYER_SHOT = 0x40,
00104 PLAYER_PONG = 0x80,
00109 PLAYER_UPDATE_IDENT = 0x100,
00116 PLAYER_UPDATE_TANK = 0x200,
00122 PLAYER_UPDATE_SHELL = 0x400,
00126 PLAYER_UPDATE_DFS = 0x800,
00130 PLAYER_DEAD = 0x1000,
00136 PLAYER_ACTIVE = 0x2000,
00142 PLAYER_UPDATEREQ = 0x4000,
00146 PLAYER_MOVEMENT_MASK = 0xFF,
00150 PLAYER_MOVEMENT_SOUND = 3,
00155 PLAYER_CLIENT_MASK = 0x700,
00164 PLAYER_LOCAL_MASK = ~0x207F,
00168 PLAYER_UPDATE_ITEMS = 0xF00
00169 };
00170
00177 struct Player_t {
00182 RenderItem tank;
00187 RenderItem shell;
00192 RenderItem labelName;
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00209 UpdateTimes lastUpdate;
00214 Uint32 localUpdate;
00219 Sint32 x, y;
00224 Sint32 shellX, shellY;
00229 Uint16 shellDist;
00233 Uint16 shellRot;
00238 Uint16 rot;
00242 Sint16 kills;
00246 Sint16 captures;
00250 Uint16 flags;
00255 rtsa_char name[MAX_NAME_LEN];
00260 Uint8 pid;
00264 Uint8 team;
00270 Uint8 deadTime;
00271 };
00272
00273 typedef struct Player_t Player;
00274
00279 extern Uint32 localPlayer;
00280
00287 extern Uint8 localUpdateFlags;
00288
00293 extern Player players[MAX_PLAYERS];
00294
00312 void AddPlayer(Player *p);
00313
00319 void RemovePlayer(Player *p);
00320
00323 #endif
00324