CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

EXTERNS.H (14227B)


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