GLOBALS.H 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __GLOBALS_H
  2. #define __GLOBALS_H
  3. #include "engine.h"
  4. #include "resource.h"
  5. #include "inifile.h"
  6. /***********************************************************************
  7. * Global constants
  8. **********************************************************************/
  9. #define kRequiredFiles 30
  10. #define kMaxPlayers 8
  11. // Game clock timer resolution
  12. #define kTimerRate 120
  13. // number of clock ticks per game frame
  14. #define kFrameTicks 4 // 30 frames/sec
  15. // Physics constants
  16. #define kZUnitsPerMeter (32 << 8)
  17. #define kXUnitsPerMeter (32 << 4)
  18. #define kRealGravity 20.0 // meter/sec^2
  19. //#define kRealGravity 9.8 // meter/sec^2
  20. #define M2Z(n) (int)((n) * kZUnitsPerMeter) // convert meters to z units
  21. #define M2X(n) (int)((n) * kXUnitsPerMeter) // convert meters to x units
  22. #define kGravity (int)(M2Z(kRealGravity) / (kTimerRate * kTimerRate) + .5)
  23. enum
  24. {
  25. kNetModeOff = 0,
  26. kNetModeCoop,
  27. kNetModeBloodBath,
  28. kNetModeTeams
  29. };
  30. /***********************************************************************
  31. * Global variables
  32. **********************************************************************/
  33. extern Resource gSysRes;
  34. extern IniFile BloodINI;
  35. extern char gBuildDate[];
  36. extern int gOldDisplayMode;
  37. extern long gFrameClock;
  38. extern int gFrameTicks;
  39. extern int gFrame;
  40. extern volatile long gGameClock;
  41. extern int gCacheMiss;
  42. extern int gFrameRate;
  43. extern int gGamma;
  44. extern int gSpring; // û(m/k)
  45. extern int gSpringPhaseInc; // kAngle360 / T
  46. extern BOOL gPaused;
  47. extern BOOL gNetGame;
  48. extern int gNetPlayers;
  49. extern int gNetMode;
  50. void ClockStrobe( void );
  51. void LockClockStrobe( void );
  52. void UnlockClockStrobe( void );
  53. #endif