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