00001
00002 #ifndef __GHOST_H__
00003 #define __GHOST_H__
00004
00005 #include "light.h"
00006 #include "level.h"
00007
00008 #define GHOST_FILENAME "Ghost.dat"
00009 #define GHOST_FILENAME_MIRRORED "Ghost.tad"
00010
00011 #define GHOST_DATA_MAX (10000)
00012 #define GHOST_MAX_SPLIT_TIMES (MAX_SPLIT_TIMES)
00013 #define GHOST_LAP_TIME (GHOST_MAX_SPLIT_TIMES)
00014
00015 #define GHOST_MIN_TIMESTEP MAKE_TIME(0, 0, 75)
00016
00017 #define GHOST_VECTOR_SCALE (100.0f)
00018 #define GHOST_VECTOR_INVSCALE (1.0f / GHOST_VECTOR_SCALE)
00019
00020 #define GHOST_WHEEL_SCALE (5.0f)
00021 #define GHOST_WHEEL_INVSCALE (1.0f / GHOST_WHEEL_SCALE)
00022
00023 #define GHOST_ANGLE_SCALE (5.0f)
00024 #define GHOST_ANGLE_INVSCALE (1.0f / GHOST_WHEEL_SCALE)
00025
00026
00028
00029
00030
00031
00032 typedef struct GhostInfoStruct {
00033
00034 long CarID;
00035 char PlayerName[MAX_PLAYER_NAME];
00036 long Time[GHOST_MAX_SPLIT_TIMES + 1];
00037 long NFrames;
00038
00039 } GHOST_INFO;
00040
00041
00043
00044
00045
00046
00047 typedef struct GhostDataStruct {
00048
00049 long Time;
00050
00051 VEC Pos;
00052 CHARQUAT Quat;
00053 char WheelAngle[CAR_NWHEELS];
00054 char WheelPos[CAR_NWHEELS];
00055
00056 } GHOST_DATA;
00057
00058
00059 extern void InitGhostData(PLAYER *player);
00060 extern void EndGhostData(PLAYER *player);
00061 extern void InitBestGhostData();
00062 extern void ClearBestGhostData();
00063 extern void SwitchGhostDataStores();
00064 extern bool StoreGhostData(CAR *car);
00065 extern bool LoadGhostData(LEVELINFO *levelInfo);
00066 extern bool SaveGhostData(LEVELINFO *levelInfo);
00067
00068 extern void InterpGhostData(CAR *ghostCar);
00069 extern void InitGhostLight(void);
00070
00071
00072 extern GHOST_INFO *GHO_BestGhostInfo;
00073 extern long GHO_BestFrame;
00074 extern long GhostSolid;
00075 extern PLAYER *GHO_GhostPlayer;
00076 extern bool GHO_GhostExists;
00077 extern LIGHT *GhostLight;
00078
00079 #endif
00080