gameinitmgr.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Commando/gameinitmgr.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 12/12/01 3:15p $*
  29. * *
  30. * $Revision:: 13 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __GAME_INIT_MGR_H
  39. #define __GAME_INIT_MGR_H
  40. #include "renegadedialogmgr.h"
  41. ////////////////////////////////////////////////////////////////
  42. //
  43. // GameInitMgrClass
  44. //
  45. ////////////////////////////////////////////////////////////////
  46. class GameInitMgrClass
  47. {
  48. public:
  49. ////////////////////////////////////////////////////////////////
  50. // Public methods
  51. ////////////////////////////////////////////////////////////////
  52. //
  53. // Level init
  54. //
  55. static void Start_Game (const char *map_name, int teamChoice, unsigned long clanID);
  56. static void End_Game (void);
  57. static void Continue_Game (void);
  58. static void Display_End_Game_Menu (void);
  59. static bool Is_Game_In_Progress(void);
  60. //
  61. // Client/server control
  62. //
  63. static void Set_Is_Client_Required (bool onoff) { IsClientRequired = onoff; }
  64. static void Set_Is_Server_Required (bool onoff) { IsServerRequired = onoff; }
  65. //
  66. // Interface type init
  67. //
  68. // LAN = Local Area Network
  69. // WOL = Westwood Online
  70. // SP = Single Player
  71. //
  72. static void Initialize_LAN (void);
  73. static void Initialize_WOL (void);
  74. static void Initialize_SP (void);
  75. static void Initialize_Skirmish (void);
  76. static bool Is_LAN_Initialized (void) { return Mode == MODE_LAN; }
  77. static bool Is_WOL_Initialized (void) { return Mode == MODE_WOL; }
  78. static bool Is_SP_Initialized (void) { return Mode == MODE_SP; }
  79. static bool Is_Skirmish_Initialized (void) { return Mode == MODE_SKIRMISH; }
  80. static void Shutdown (void);
  81. static void Shutdown_LAN (void);
  82. static void Shutdown_WOL (void);
  83. static void Shutdown_SP (void);
  84. static void Shutdown_Skirmish (void);
  85. static void End_Client_Server (void);
  86. //
  87. // Thinking support (for safely triggering game ends)
  88. //
  89. static void Think (void);
  90. static void Set_Needs_Game_Exit (bool onoff) { NeedsGameExit = onoff; }
  91. static void Set_Needs_Game_Exit_All (bool onoff) { NeedsGameExitAll = onoff; }
  92. //
  93. // WOL specific
  94. //
  95. static void Set_WOL_Return_Dialog (RenegadeDialogMgrClass::LOCATION location) { WOLReturnDialog = location; }
  96. private:
  97. ////////////////////////////////////////////////////////////////
  98. // Private constants
  99. ////////////////////////////////////////////////////////////////
  100. enum
  101. {
  102. MODE_UNKNOWN = 0,
  103. MODE_SP,
  104. MODE_SKIRMISH,
  105. MODE_LAN,
  106. MODE_WOL
  107. };
  108. ////////////////////////////////////////////////////////////////
  109. // Private methods
  110. ////////////////////////////////////////////////////////////////
  111. static void Start_Client_Server (void);
  112. static void Transmit_Player_Data (int teamChoice, unsigned long clanID);
  113. ////////////////////////////////////////////////////////////////
  114. // Private member data
  115. ////////////////////////////////////////////////////////////////
  116. static bool IsClientRequired;
  117. static bool IsServerRequired;
  118. static bool RestoreSFX;
  119. static bool RestoreMusic;
  120. static int Mode;
  121. static int WOLReturnDialog;
  122. static bool NeedsGameExit;
  123. static bool NeedsGameExitAll;
  124. };
  125. #endif //__GAME_INIT_MGR_H