00001
00002 #ifndef TIMING_H
00003 #define TIMING_H
00004
00005 #include "revolt.h"
00006 #include "main.h"
00007 #include "level.h"
00008
00009
00010
00011 #define FIXED_TIME_STEP FALSE
00012
00013 #define MAKE_TIME(_m, _s, _t) \
00014 ((_m) * 60000 + (_s) * 1000 + (_t))
00015
00016 #ifdef _PC
00017 #define TIME2MS(_t) \
00018 (_t) / (TimerFreq / 1000)
00019
00020 #define MS2TIME(_t) \
00021 (_t) * (TimerFreq / 1000)
00022
00023 #define RECORDS_FILENAME "times.dat"
00024 #define RECORDS_FILENAME_MIRRORED "times.tad"
00025 #endif
00026
00027 #ifdef _N64
00028 #define TIME2MS(_t) (_t)
00029 #define MS2TIME(_t) (_t)
00030 #endif
00031
00032
00033 #define COUNTDOWN_START 1
00034
00035
00036
00037 extern unsigned long CurrentTimer(void);
00038 extern void UpdateTimeFactor(void);
00039 extern void UpdateRaceTimers(void);
00040 extern void LoadTrackTimes(LEVELINFO *lev);
00041 extern void SaveTrackTimes(LEVELINFO *lev);
00042 extern void CheckForBestLap(CAR *car);
00043 extern void CheckForBestRace(CAR *car);
00044
00045
00046
00047 extern unsigned long TimerLast, TimerCurrent, TimerDiff, TimerFreq, TotalRaceTime, TotalRaceStartTime, CountdownTime, CountdownEndTime;
00048 extern long TimeQueue, TimeLoopCount;
00049 extern RECORD_ENTRY TrackRecords;
00050
00051 #endif