EXTERNS.H 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. /*
  2. ** Command & Conquer(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. /* $Header: F:\projects\c&c\vcs\code\externs.h_v 2.15 16 Oct 1995 16:45:34 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : EXTERNS.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : May 27, 1994 *
  30. * *
  31. * Last Update : May 27, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef EXTERNS_H
  37. #define EXTERNS_H
  38. #include "cell.h"
  39. #ifdef SCENARIO_EDITOR
  40. #include "mapedit.h"
  41. #endif
  42. #include "techno.h"
  43. #include "type.h"
  44. #include "building.h"
  45. #include "unit.h"
  46. #include "credits.h"
  47. #include "goptions.h"
  48. #include "options.h"
  49. #include "infantry.H"
  50. #ifdef JAPANESE
  51. extern bool ForceEnglish;
  52. #endif
  53. extern bool Debug_Quiet;
  54. extern bool Debug_Cheat;
  55. extern bool Debug_Remap;
  56. extern bool Debug_Flag;
  57. extern bool Debug_Lose;
  58. extern bool Debug_Map;
  59. extern bool Debug_Win;
  60. extern bool Debug_Icon;
  61. extern bool Debug_Passable;
  62. extern bool Debug_Unshroud;
  63. extern bool Debug_Threat;
  64. extern bool Debug_Find_Path;
  65. extern bool Debug_Check_Map;
  66. extern bool Debug_Playtest;
  67. extern bool Debug_Heap_Dump;
  68. extern bool Debug_Smart_Print;
  69. extern bool Debug_Trap_Check_Heap;
  70. extern bool Debug_Instant_Build;
  71. extern void const *WarFactoryOverlay;
  72. /*
  73. ** Dynamic global variables (these change or are initialized at run time).
  74. */
  75. #ifdef PATCH
  76. extern bool IsV107;
  77. extern char OverridePath[128];
  78. #endif
  79. extern bool SlowPalette;
  80. extern char VersionText[16];
  81. extern bool ScoresPresent;
  82. extern int CrateCount;
  83. extern TCountDownTimerClass CrateTimer;
  84. extern bool CrateMaker;
  85. extern ThemeType TransitTheme;
  86. extern bool AllowVoice;
  87. extern NewConfigType NewConfig;
  88. extern char BriefingText[512];
  89. extern char IntroMovie[_MAX_FNAME+_MAX_EXT];
  90. extern char ActionMovie[_MAX_FNAME+_MAX_EXT];
  91. extern char BriefMovie[_MAX_FNAME+_MAX_EXT];
  92. extern char WinMovie[_MAX_FNAME+_MAX_EXT];
  93. extern char LoseMovie[_MAX_FNAME+_MAX_EXT];
  94. extern VoxType SpeakQueue;
  95. extern bool PlayerWins;
  96. extern bool PlayerLoses;
  97. extern bool PlayerRestarts;
  98. extern StructType SabotagedType;
  99. extern bool TempleIoned;
  100. extern long Frame;
  101. extern void * SpeechBuffer;
  102. extern int PreserveVQAScreen;
  103. extern bool BreakoutAllowed;
  104. extern bool Brokeout;
  105. extern CELL Views[4];
  106. extern GameOptionsClass Options;
  107. extern LogicClass Logic;
  108. #ifdef SCENARIO_EDITOR
  109. extern MapEditClass Map;
  110. #else
  111. extern MouseClass Map;
  112. #endif
  113. extern ScoreClass Score;
  114. extern MonoClass MonoArray[MonoClass::MAX_MONO_PAGES];
  115. extern MixFileClass * ScoreMix;
  116. extern MixFileClass * TheaterData;
  117. extern MixFileClass * LowTheaterData;
  118. extern MixFileClass * MoviesMix;
  119. extern MixFileClass * GeneralMix;
  120. extern ThemeClass Theme;
  121. extern SpecialClass Special;
  122. /*
  123. ** Game object allocation and tracking classes.
  124. */
  125. extern TFixedIHeapClass<UnitClass> Units;
  126. extern TFixedIHeapClass<FactoryClass> Factories;
  127. extern TFixedIHeapClass<TerrainClass> Terrains;
  128. extern TFixedIHeapClass<TemplateClass> Templates;
  129. extern TFixedIHeapClass<SmudgeClass> Smudges;
  130. extern TFixedIHeapClass<OverlayClass> Overlays;
  131. extern TFixedIHeapClass<InfantryClass> Infantry;
  132. extern TFixedIHeapClass<BulletClass> Bullets;
  133. extern TFixedIHeapClass<BuildingClass> Buildings;
  134. extern TFixedIHeapClass<AnimClass> Anims;
  135. extern TFixedIHeapClass<AircraftClass> Aircraft;
  136. extern TFixedIHeapClass<TriggerClass> Triggers;
  137. extern TFixedIHeapClass<TeamTypeClass> TeamTypes;
  138. extern TFixedIHeapClass<TeamClass> Teams;
  139. extern TFixedIHeapClass<HouseClass> Houses;
  140. extern QueueClass<EventClass, MAX_EVENTS> OutList;
  141. extern QueueClass<EventClass, (MAX_EVENTS * 8)> DoList;
  142. extern DynamicVectorClass<ObjectClass *> CurrentObject;
  143. extern DynamicVectorClass<TriggerClass *> CellTriggers;
  144. extern DynamicVectorClass<TriggerClass *> HouseTriggers[HOUSE_COUNT];
  145. extern CELL Waypoint[WAYPT_COUNT];
  146. extern BaseClass Base;
  147. /*
  148. ** Loaded data file pointers.
  149. */
  150. extern void const * Green12FontPtr;
  151. extern void const * Green12GradFontPtr;
  152. extern void const * MapFontPtr;
  153. extern void const * VCRFontPtr;
  154. extern void const * Font3Ptr;
  155. extern void const * Font6Ptr;
  156. extern void const * Font8Ptr;
  157. extern void const * FontLEDPtr;
  158. extern void const * ScoreFontPtr;
  159. extern void const * GradFont6Ptr;
  160. extern char const * SystemStrings;
  161. /*
  162. ** Miscellaneous globals.
  163. */
  164. extern HousesType Whom;
  165. extern _VQAConfig AnimControl;
  166. extern long SpareTicks;
  167. extern int MonoPage;
  168. extern unsigned char * OriginalPalette;
  169. extern int EndCountDown;
  170. extern bool GameActive;
  171. extern bool SpecialFlag;
  172. extern bool ScenarioInit;
  173. extern long TutorFlags[2];
  174. extern HouseClass * PlayerPtr;
  175. extern unsigned char * BlackPalette;
  176. extern unsigned char * WhitePalette;
  177. extern unsigned char * GamePalette;
  178. extern unsigned Scenario;
  179. extern ScenarioPlayerType ScenPlayer;
  180. extern ScenarioDirType ScenDir;
  181. extern ScenarioVarType ScenVar;
  182. extern int CarryOverMoney;
  183. extern int CarryOverCap;
  184. extern int CarryOverPercent;
  185. extern char ScenarioName[_MAX_FNAME+_MAX_EXT];
  186. extern unsigned BuildLevel;
  187. extern unsigned long ScenarioCRC;
  188. #ifdef SCENARIO_EDITOR
  189. extern CELL CurrentCell;
  190. #endif
  191. extern GameType GameToPlay;
  192. extern CommProtocolType CommProtocol;
  193. extern CCFileClass RecordFile;
  194. extern int RecordGame;
  195. extern int SuperRecord;
  196. extern int PlaybackGame;
  197. extern int AllowAttract;
  198. extern GetCDClass CDList;
  199. /*
  200. ** Modem globals
  201. */
  202. extern bool ModemService;
  203. extern NullModemClass NullModem;
  204. extern DynamicVectorClass<PhoneEntryClass *> PhoneBook;
  205. extern int CurPhoneIdx;
  206. extern DynamicVectorClass <char *> InitStrings;
  207. extern SerialSettingsType SerialDefaults;
  208. extern ModemGameType ModemGameToPlay;
  209. extern char * DialMethodCheck[ DIAL_METHODS ];
  210. extern char * CallWaitStrings[ CALL_WAIT_STRINGS_NUM ];
  211. /*
  212. ** Network/Modem globals
  213. */
  214. extern int ScenarioIdx;
  215. extern int ColorUsed[];
  216. extern char MPlayerName[MPLAYER_NAME_MAX];
  217. extern int MPlayerGColors[];
  218. extern int MPlayerTColors[];
  219. extern char MPlayerDescriptions[100][40];
  220. extern DynamicVectorClass <char *> MPlayerScenarios;
  221. extern DynamicVectorClass <int> MPlayerFilenum;
  222. extern int MPlayerMax;
  223. extern int MPlayerPrefColor;
  224. extern int MPlayerColorIdx;
  225. extern HousesType MPlayerHouse;
  226. extern unsigned char MPlayerLocalID;
  227. extern int MPlayerCount;
  228. extern int MPlayerBases;
  229. extern int MPlayerCredits;
  230. extern int MPlayerTiberium;
  231. extern int MPlayerGoodies;
  232. extern int MPlayerGhosts;
  233. extern int MPlayerSolo;
  234. extern int MPlayerUnitCount;
  235. extern int MPlayerCountMin[2];
  236. extern int MPlayerCountMax[2];
  237. extern unsigned long MPlayerMaxAhead;
  238. extern unsigned long FrameSendRate;
  239. extern unsigned char MPlayerID[MAX_PLAYERS];
  240. extern HousesType MPlayerHouses[MAX_PLAYERS];
  241. extern char MPlayerNames [MAX_PLAYERS][MPLAYER_NAME_MAX];
  242. extern MessageListClass Messages;
  243. extern IPXAddressClass MessageAddress;
  244. extern char LastMessage[MAX_MESSAGE_LENGTH];
  245. extern int MPlayerBlitz;
  246. extern int MPlayerObiWan;
  247. extern MPlayerScoreType MPlayerScore[MAX_MULTI_NAMES];
  248. extern int MPlayerGamesPlayed;
  249. extern int MPlayerNumScores;
  250. extern int MPlayerWinner;
  251. extern int MPlayerCurGame;
  252. extern int TheirProcessTime[MAX_PLAYERS - 1];
  253. extern int DesiredFrameRate;
  254. extern char * GlobalPacketNames[];
  255. extern char * SerialPacketNames[];
  256. typedef struct {
  257. union {
  258. AircraftClass *Aircraft;
  259. AnimClass *Anim;
  260. BuildingClass *Building;
  261. BulletClass *Bullet;
  262. InfantryClass *Infantry;
  263. UnitClass *Unit;
  264. void *All;
  265. } Ptr;
  266. } TrapObjectType;
  267. extern long TrapFrame;
  268. extern RTTIType TrapObjType;
  269. extern TrapObjectType TrapObject;
  270. extern COORDINATE TrapCoord;
  271. extern void * TrapThis;
  272. extern CellClass * TrapCell;
  273. extern int TrapCheckHeap;
  274. /*
  275. ** Network (IPX) globals
  276. */
  277. extern IPXManagerClass Ipx;
  278. extern int IsBridge;
  279. extern IPXAddressClass BridgeNet;
  280. extern bool NetMaster;
  281. extern bool NetStealth;
  282. extern bool NetProtect;
  283. extern bool NetOpen;
  284. extern char MPlayerGameName[MPLAYER_NAME_MAX];
  285. extern GlobalPacketType GPacket;
  286. extern int GPacketlen;
  287. extern IPXAddressClass GAddress;
  288. extern unsigned short GProductID;
  289. extern char * MetaPacket;
  290. extern int MetaSize;
  291. extern DynamicVectorClass <NodeNameType *> Games;
  292. extern DynamicVectorClass <NodeNameType *> Players;
  293. extern int Seed;
  294. extern long * RandSeedPtr;
  295. extern int CustomSeed;
  296. extern int NewMaxAheadFrame1;
  297. extern int NewMaxAheadFrame2;
  298. /*
  299. ** Constant externs (data is not modified during game play).
  300. */
  301. extern unsigned char const RemapGreen[256];
  302. extern unsigned char const RemapBlue[256];
  303. extern unsigned char const RemapOrange[256];
  304. extern unsigned char const RemapNone[256];
  305. extern unsigned char const RemapYellow[256];
  306. extern unsigned char const RemapRed[256];
  307. extern unsigned char const RemapBlueGreen[256];
  308. extern WeaponTypeClass const Weapons[WEAPON_COUNT];
  309. extern WarheadTypeClass const Warheads[WARHEAD_COUNT];
  310. extern char const * SourceName[SOURCE_COUNT];
  311. extern GroundType const Ground[LAND_COUNT];
  312. extern TheaterDataType const Theaters[THEATER_COUNT];
  313. extern unsigned char const Facing32[256];
  314. extern unsigned char const Facing8[256];
  315. extern unsigned char const Pixel2Lepton[24];
  316. extern COORDINATE const StoppingCoordAbs[5];
  317. extern CELL const AdjacentCell[FACING_COUNT];
  318. extern COORDINATE const AdjacentCoord[FACING_COUNT];
  319. extern int SoundOn;
  320. //extern GraphicBufferClass SeenPage;
  321. extern GraphicBufferClass VisiblePage;
  322. extern GraphicBufferClass HiddenPage;
  323. extern GraphicViewPortClass SeenBuff;
  324. extern GraphicBufferClass ModeXBuff;
  325. extern GraphicViewPortClass HidPage;
  326. extern GraphicBufferClass LoResHidPage;
  327. extern GraphicBufferClass SysMemPage;
  328. extern int MenuList[][8];
  329. extern CountDownTimerClass FrameTimer;
  330. extern CountDownTimerClass CountDownTimer;
  331. extern TimerClass ProcessTimer;
  332. extern int ProcessTicks;
  333. extern int ProcessFrames;
  334. extern SpecialDialogType SpecialDialog;
  335. //extern bool IsFindPath;
  336. extern char *DebugFname; // for stoopid debugging purposes
  337. extern int DebugLine; // for stoopid debugging purposes
  338. extern int RequiredCD;
  339. extern int MouseInstalled;
  340. extern int AreThingiesEnabled;
  341. extern WWKeyboardClass Kbd;
  342. extern int In_Debugger;
  343. extern WWMouseClass *WWMouse;
  344. extern HANDLE hInstance;
  345. extern int AllDone;
  346. extern "C" bool MMXAvailable;
  347. extern int Get_CD_Index (int cd_drive, int timeout);
  348. void Memory_Error_Handler(void);
  349. extern bool GameStatisticsPacketSent;
  350. extern bool ConnectionLost;
  351. extern bool InMainLoop; // True if in game state rather than menu state
  352. void CCDebugString (char *string);
  353. extern void *PacketLater;
  354. void Load_Title_Screen(char *name, GraphicViewPortClass *video_page, unsigned char *palette);
  355. extern "C"{
  356. extern bool IsTheaterShape;
  357. }
  358. extern void Reset_Theater_Shapes(void);
  359. extern TheaterType LastTheater;
  360. #endif