main.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*=============================================================================
  2. MAIN.H: Definitions for main Windows interface file for Homeworld.
  3. Created June 1997 By Luke Moloney
  4. =============================================================================*/
  5. #ifndef ___MAIN_H
  6. #define ___MAIN_H
  7. #include "types.h"
  8. #include "mainswitches.h"
  9. /*=============================================================================
  10. Switches:
  11. =============================================================================*/
  12. #define MAIN_Password 0 //enable password-enabling/disabling
  13. #ifndef HW_Release
  14. #define MAIN_MOUSE_FREE 1 //allow the mouse to be freed from the window
  15. #define MAIN_SENSOR_LEVEL 1 //enable command-line adjustment of sensors level
  16. #define MAIN_PRINT_MESSAGES 0 //print the window messages as they come pouring in
  17. #else //HW_Debug
  18. #define MAIN_MOUSE_FREE 1 //allow the mouse to be freed from the window
  19. #define MAIN_SENSOR_LEVEL 0 //enable command-line adjustment of sensors level
  20. #define MAIN_PRINT_MESSAGES 0 //print the window messages as they come pouring in
  21. #endif //HW_Debug
  22. /*=============================================================================
  23. Definitions:
  24. =============================================================================*/
  25. #define ERR_ErrorStart 0xfed5
  26. #define MAIN_CDCheck 0
  27. #define MAIN_ExpiryTime 30 //expires after 30 days
  28. //command-line parsing definitions
  29. #define TS_Delimiters " \t,="
  30. #define MCL_IndentSpace 4 //number of indent characters
  31. //command-line option flags
  32. #define COF_Visible 1 //user can see this option with /?
  33. #define COF_NextToken 2 //pass next token as parameter to function
  34. /*=============================================================================
  35. Type definitions:
  36. =============================================================================*/
  37. //structure for command-line parsing
  38. typedef struct
  39. {
  40. //bool visible; //is this option visible by using '/?'?
  41. udword flags; //flags for this entry. See above for possible values.
  42. char *parameter; //parameter string (begins with a slash)
  43. bool (*function)(char *string); //function to call, NULL if none. Called after variable is set.
  44. void *variableToModify; //variable to modify, NULL if none
  45. udword valueToSet; //value to set variable to
  46. char *helpString; //string printed in help screen
  47. }
  48. commandoption;
  49. /*=============================================================================
  50. Data:
  51. =============================================================================*/
  52. extern void *ghMainWindow;
  53. extern void *ghInstance;
  54. #if MAIN_SENSOR_LEVEL
  55. udword initialSensorLevel;
  56. #endif
  57. extern sdword enableTrails;
  58. extern sdword showBackgrounds;
  59. extern bool POCTrails;
  60. extern bool mainRasterSkip;
  61. extern bool mainSafeGL;
  62. extern bool mainForceKatmai;
  63. extern bool mainAllowKatmai;
  64. extern bool mainAllowPacking;
  65. extern bool mainOnlyPacking;
  66. extern bool fullScreen;
  67. extern bool enableAVI;
  68. extern sdword mainReinitRenderer;
  69. //size of main window
  70. extern sdword MAIN_WindowWidth;
  71. extern sdword MAIN_WindowHeight;
  72. extern sdword MAIN_WindowDepth;
  73. extern sdword mainWindowWidth;
  74. extern sdword mainWindowHeight;
  75. extern sdword mainWindowDepth;
  76. extern char mainDeviceToSelect[];
  77. extern char mainGLToSelect[];
  78. extern char mainD3DToSelect[];
  79. extern bool mainNoPerspective;
  80. extern bool systemActive;
  81. /*=============================================================================
  82. Functions:
  83. =============================================================================*/
  84. void WindowsCleanup(void);
  85. void ActivateMe(void *hWnd);
  86. void DeactivateMe(void *hWnd);
  87. //load/save options from disk
  88. void utyOptionsFileRead(void);
  89. void utyOptionsFileWrite(void);
  90. //renderer swapping functions
  91. bool mainLoadGL(char* data);
  92. bool mainLoadRGL(void);
  93. bool mainLoadParticularRGL(char* device, char* data);
  94. sdword mainActiveRenderer(void);
  95. bool mainReinitRGL(void);
  96. bool mainShutdownRenderer(void);
  97. void mainSaveRender(void);
  98. void mainRestoreRender(void);
  99. void mainRestoreSoftware(void);
  100. //video playback module convenience functions
  101. void mainCleanupAfterVideo(void);
  102. #endif //___MAIN_H