CnC_Remastered_Collection

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

DLLInterface.h (20950B)


      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 
     17 #pragma once
     18 
     19 #ifndef DLL_INTERFACE_H
     20 #define DLL_INTERFACE_H
     21 		
     22 struct CarryoverObjectStruct;
     23 
     24 
     25 /*
     26 ** DLL Interface version
     27 ** 
     28 ** 
     29 ** 
     30 */
     31 #include "DLLInterfaceVersion.h"
     32 
     33 
     34 
     35 #define MAX_EXPORT_CELLS			(128 * 128)
     36 
     37 #ifdef TIBERIAN_DAWN
     38 #define MAP_MAX_CELL_WIDTH 64
     39 #define MAP_MAX_CELL_HEIGHT 64
     40 #else
     41 #define MAP_MAX_CELL_WIDTH 128
     42 #define MAP_MAX_CELL_HEIGHT 128
     43 #endif
     44 
     45 
     46 /*
     47 ** Interface structs require stricter packing
     48 ** 
     49 ** 
     50 */
     51 #pragma pack(push)
     52 #pragma pack(1)
     53 
     54 
     55 
     56 
     57 /**************************************************************************************
     58 ** 
     59 ** Game state request types
     60 ** 
     61 ** 
     62 */
     63 enum GameStateRequestEnum {
     64 	GAME_STATE_NONE,
     65 	GAME_STATE_STATIC_MAP,
     66 	GAME_STATE_DYNAMIC_MAP,
     67 	GAME_STATE_LAYERS,
     68 	GAME_STATE_SIDEBAR,
     69 	GAME_STATE_PLACEMENT,
     70 	GAME_STATE_SHROUD,
     71 	GAME_STATE_OCCUPIER,
     72 	GAME_STATE_PLAYER_INFO
     73 };	
     74 
     75 
     76 
     77 
     78 /**************************************************************************************
     79 ** 
     80 ** Static map data (tiles)
     81 ** 
     82 ** 
     83 */
     84 struct CNCStaticCellStruct {
     85 	char	TemplateTypeName[32];
     86 	int	IconNumber;
     87 };
     88 
     89 
     90 
     91 enum CnCTheaterType {
     92 	CNC_THEATER_NONE=-1,
     93 	CNC_THEATER_DESERT,
     94 	CNC_THEATER_JUNGLE,
     95 	CNC_THEATER_TEMPERATE,
     96 	CNC_THEATER_WINTER,
     97 
     98 	CNC_THEATER_COUNT,
     99 	CNC_THEATER_FIRST=0
    100 };
    101 
    102 
    103 struct CNCMapDataStruct {
    104 	int	MapCellX;
    105 	int	MapCellY;
    106 	int	MapCellWidth;
    107 	int	MapCellHeight;
    108 	int	OriginalMapCellX;
    109 	int	OriginalMapCellY;
    110 	int	OriginalMapCellWidth;
    111 	int	OriginalMapCellHeight;
    112 
    113 	CnCTheaterType Theater;
    114 	char ScenarioName[_MAX_FNAME+_MAX_EXT];
    115 	
    116 	CNCStaticCellStruct StaticCells[MAX_EXPORT_CELLS];
    117 };
    118 
    119 
    120 
    121 
    122 /**************************************************************************************
    123 ** 
    124 **  Object type enum
    125 ** 
    126 ** 
    127 */
    128 #define DLL_LAYER_COUNT 3
    129 
    130 enum DllObjectTypeEnum {
    131 	UNKNOWN,
    132 	INFANTRY,
    133 	UNIT,
    134 	AIRCRAFT,
    135 	BUILDING,
    136 	TERRAIN,
    137 	ANIM,
    138 	BULLET,
    139 	OVERLAY,
    140 	SMUDGE,
    141 	OBJECT,
    142 	SPECIAL,
    143 	INFANTRY_TYPE,
    144 	UNIT_TYPE,
    145 	AIRCRAFT_TYPE,
    146 	BUILDING_TYPE,
    147 	VESSEL,
    148 	VESSEL_TYPE
    149 };	
    150  
    151 
    152 
    153 /**************************************************************************************
    154 **
    155 **  Object action types
    156 **
    157 **
    158 */
    159 enum DllActionTypeEnum : unsigned char {
    160 	DAT_NONE,
    161 	DAT_MOVE,
    162 	DAT_NOMOVE,
    163 	DAT_ENTER,
    164 	DAT_SELF,
    165 	DAT_ATTACK,
    166 	DAT_ATTACK_OUT_OF_RANGE,
    167 	DAT_GUARD,
    168 	DAT_SELECT,
    169 	DAT_CAPTURE,
    170 	DAT_SABOTAGE,
    171 	DAT_HEAL,
    172 	DAT_DAMAGE,
    173 	DAT_TOGGLE_PRIMARY,
    174 	DAT_CANT_DEPLOY,
    175 	DAT_REPAIR,
    176 	DAT_CANT_REPAIR
    177 };
    178 
    179 
    180 
    181 
    182 
    183 
    184 /**************************************************************************************
    185 ** 
    186 **  Object state data
    187 ** 
    188 ** 
    189 */
    190 #define MAX_OCCUPY_CELLS 36
    191 #define MAX_OBJECT_PIPS 18
    192 #define MAX_OBJECT_LINES 3
    193 #define MAX_HOUSES 32
    194 
    195 struct CNCObjectLineStruct {
    196 	int X;
    197 	int Y;
    198 	int X1;
    199 	int Y1;
    200 	int Frame;
    201 	unsigned char Color;
    202 };
    203 
    204 #define CNC_OBJECT_ASSET_NAME_LENGTH 16
    205 struct CNCObjectStruct {
    206 	void				*CNCInternalObjectPointer;
    207 	char				TypeName[CNC_OBJECT_ASSET_NAME_LENGTH];
    208 	char 				AssetName[CNC_OBJECT_ASSET_NAME_LENGTH];		// CNC uses 8.3 filenames, so it shouldn't need to be bigger than 9
    209 	DllObjectTypeEnum	Type;	
    210 	int					ID;
    211 	int					BaseObjectID;
    212 	DllObjectTypeEnum	BaseObjectType;	
    213 	int					PositionX;
    214 	int					PositionY;
    215 	int					Width;
    216 	int					Height;
    217 	int					Altitude;
    218 	int					SortOrder;
    219 	int					Scale;
    220 	int					DrawFlags;
    221 	short				MaxStrength;
    222 	short				Strength;
    223 	unsigned short		ShapeIndex;
    224 	unsigned short		CellX;
    225 	unsigned short		CellY;
    226 	unsigned short		CenterCoordX;
    227 	unsigned short		CenterCoordY;
    228 	short				SimLeptonX;
    229 	short				SimLeptonY;
    230 	unsigned char		DimensionX;
    231 	unsigned char		DimensionY;
    232 	unsigned char		Rotation;
    233 	unsigned char		MaxSpeed;
    234 	char				Owner;
    235 	char				RemapColor;
    236 	char				SubObject;
    237 	bool				IsSelectable;
    238 	unsigned int		IsSelectedMask;
    239 	bool				IsRepairing;
    240 	bool				IsDumping;
    241 	bool				IsTheaterSpecific;
    242 	unsigned int		FlashingFlags;
    243 	unsigned char		Cloak;
    244 	bool				CanRepair;
    245 	bool				CanDemolish;
    246 	bool				CanDemolishUnit;
    247 	short				OccupyList[MAX_OCCUPY_CELLS];
    248 	int					OccupyListLength;
    249 	int					Pips[MAX_OBJECT_PIPS];
    250 	int					NumPips;
    251 	int					MaxPips;
    252 	CNCObjectLineStruct	Lines[MAX_OBJECT_LINES];
    253 	int					NumLines;
    254 	bool				RecentlyCreated;
    255 	bool				IsALoaner;
    256 	bool				IsFactory;
    257 	bool				IsPrimaryFactory;
    258 	bool				IsDeployable;
    259 	bool				IsAntiGround;
    260 	bool				IsAntiAircraft;
    261 	bool				IsSubSurface;
    262 	bool				IsNominal;
    263 	bool				IsDog;
    264 	bool				IsIronCurtain;
    265 	bool				IsInFormation;
    266 	bool				CanMove[MAX_HOUSES];
    267 	bool				CanFire[MAX_HOUSES];
    268 	bool				CanDeploy;
    269 	bool				CanHarvest;
    270 	bool				CanPlaceBombs;
    271 	bool				IsFixedWingedAircraft;
    272 	bool				IsFake;
    273 	unsigned char		ControlGroup;
    274 	unsigned int		VisibleFlags;
    275 	unsigned int		SpiedByFlags;
    276 	char 				ProductionAssetName[CNC_OBJECT_ASSET_NAME_LENGTH];
    277 	const char*			OverrideDisplayName;
    278 	DllActionTypeEnum	ActionWithSelected[MAX_HOUSES];
    279 
    280 	static const unsigned int VISIBLE_FLAGS_ALL = 0xffffffff;
    281 };
    282 
    283 struct CNCObjectListStruct {
    284 	int					Count;
    285 	CNCObjectStruct	Objects[1];		// Variable length
    286 };
    287 
    288 
    289 
    290 
    291 /**************************************************************************************
    292 ** 
    293 **  Placement validity data
    294 ** 
    295 **  Used to pass back info about tructure placement validity
    296 */
    297 struct CNCPlacementCellInfoStruct {
    298 	bool	PassesProximityCheck;			// If the structure was placed in this cell, does that satisfy the proximity check for the whole structure?
    299 	bool	GenerallyClear;					// Is this cell generally clear of obstructions that would prevent placement?
    300 };
    301 
    302 struct CNCPlacementInfoStruct {
    303 	int								Count;
    304 	CNCPlacementCellInfoStruct CellInfo[1];		// Variable length
    305 };
    306 
    307 
    308 
    309 
    310 
    311 /**************************************************************************************
    312 ** 
    313 **  Sidebar/construction state data
    314 ** 
    315 ** 
    316 */
    317 enum DllSuperweaponTypeEnum {
    318 	SW_NONE,
    319 	SW_UNKNOWN,
    320 
    321 	//TD values
    322 	SW_NUKE,
    323 	SW_AIR_STRIKE,
    324 	SW_ION_CANNON,
    325 
    326 	//RA values
    327 	SW_SONAR_PULSE,
    328 	SW_CHRONOSPHERE,
    329 	SW_PARA_BOMB,
    330 	SW_PARA_INFANTRY,
    331 	SW_SPY_MISSION,
    332 	SW_IRON_CURTAIN,
    333 	SW_GPS,
    334 	SW_CHRONOSPHERE_DESTINATION
    335 };
    336 
    337 struct CNCSidebarEntryStruct {
    338 	char							AssetName[16];						// CNC uses 8.3 filenames, so it shouldn't need to be bigger than 9
    339 	int							BuildableType;						// This is the original buildable type that should be passed back if we want to start/cancel construction
    340 	int							BuildableID;	   				// This is the original buildable id that should be passed back if we want to start/cancel construction
    341 	DllObjectTypeEnum			Type;									// Type converted to shared enum
    342 	DllSuperweaponTypeEnum	SuperWeaponType;
    343 	int							Cost;									// Cost to construct
    344 	int							PowerProvided;						// Power cost to construct
    345 	int							BuildTime;							// Cost to construct
    346 	float							Progress;							// Construction progress (0.0 - 1.0)
    347 	short							PlacementList[MAX_OCCUPY_CELLS];	// Which cells this structure occupies for placement (if structure)
    348 	int							PlacementListLength;					// How many cells
    349 	bool							Completed;							// Construction has completed
    350 	bool							Constructing;						// Is it currently constructing
    351 	bool							ConstructionOnHold;				// Is the current construction on hold
    352 	bool							Busy;									// Is the associated factory busy
    353 	bool							BuildableViaCapture;				// Is this buildable due to the capture of a structure of a different faction. This will be false for captured structures of the same faction (ActLike)
    354 	bool							Fake;									// Is this a fake structure?
    355 };
    356 
    357 
    358 struct CNCSidebarStruct {
    359 	int							EntryCount[2];			// Counts for the left and right columns
    360 	int							Credits;					// Amount of currency available (excluding Tiberium)
    361 	int							CreditsCounter;		// Visible credits to display in the sidebar (includes count up/down logic)
    362 	int							Tiberium;				// Amount of Tiberium in reserve
    363 	int							MaxTiberium;			// Maximum amount of Tiberium storage available
    364 	int							PowerProduced;
    365 	int							PowerDrained;
    366 	int							MissionTimer;
    367 	unsigned int	  			UnitsKilled;				// Total count of enemy units killed by this player; Includes Infantry, Vehicles, Aircraft
    368 	unsigned int	  			BuildingsKilled;        // Total count of enemy structures killed by this player
    369 	unsigned int	  			UnitsLost;              // Total count player-owned units killed/lost           
    370 	unsigned int	  			BuildingsLost;          // Total count player-owned structures killed/lost      
    371 	unsigned int 				TotalHarvestedCredits;  // Complete total of gained credits over the match (does not include starting credits)
    372 	bool							RepairBtnEnabled;
    373 	bool							SellBtnEnabled;
    374 	bool							RadarMapActive;
    375 
    376 	CNCSidebarEntryStruct	Entries[1];			// Variable length column entries
    377 };
    378 
    379 
    380 
    381 enum SidebarRequestEnum {
    382 	SIDEBAR_REQUEST_START_CONSTRUCTION,
    383 	SIDEBAR_REQUEST_HOLD_CONSTRUCTION,
    384 	SIDEBAR_REQUEST_CANCEL_CONSTRUCTION,
    385 	SIDEBAR_REQUEST_START_PLACEMENT,
    386 	SIDEBAR_REQUEST_PLACE,
    387 	SIDEBAR_CANCEL_PLACE,
    388 	SIDEBAR_CLICK_REPAIR,
    389 	SIDEBAR_REQUEST_ENABLE_QUEUE,
    390 	SIDEBAR_REQUEST_DISABLE_QUEUE,
    391 	SIDEBAR_REQUEST_START_CONSTRUCTION_MULTI,
    392 	SIDEBAR_REQUEST_CANCEL_CONSTRUCTION_MULTI
    393 };	
    394 
    395 enum SuperWeaponRequestEnum {
    396 	SUPERWEAPON_REQUEST_PLACE_SUPER_WEAPON
    397 };
    398 
    399 enum ControlGroupRequestEnum {
    400 	CONTROL_GROUP_REQUEST_CREATE,
    401 	CONTROL_GROUP_REQUEST_TOGGLE,
    402 	CONTROL_GROUP_REQUEST_ADDITIVE_SELECTION,
    403 };
    404 
    405 
    406 
    407 /**************************************************************************************
    408 ** 
    409 **  Input events sent into the DLL
    410 ** 
    411 ** 
    412 */
    413 enum InputRequestEnum {
    414 	INPUT_REQUEST_NONE,
    415 	INPUT_REQUEST_MOUSE_MOVE,
    416 	INPUT_REQUEST_MOUSE_LEFT_CLICK,
    417 	INPUT_REQUEST_MOUSE_RIGHT_DOWN,
    418 	INPUT_REQUEST_MOUSE_RIGHT_CLICK,
    419 	INPUT_REQUEST_MOUSE_AREA,
    420 	INPUT_REQUEST_MOUSE_AREA_ADDITIVE,
    421 	INPUT_REQUEST_SELL_AT_POSITION,
    422 	INPUT_REQUEST_SELECT_AT_POSITION,
    423 	INPUT_REQUEST_COMMAND_AT_POSITION,
    424 	INPUT_REQUEST_SPECIAL_KEYS,
    425 	INPUT_REQUEST_MOD_GAME_COMMAND_1_AT_POSITION,
    426 	INPUT_REQUEST_MOD_GAME_COMMAND_2_AT_POSITION,
    427 	INPUT_REQUEST_MOD_GAME_COMMAND_3_AT_POSITION,
    428 	INPUT_REQUEST_MOD_GAME_COMMAND_4_AT_POSITION,
    429 };
    430 
    431 
    432 /**************************************************************************************
    433 **
    434 **  Structure Requests Repair, Sell
    435 **
    436 **
    437 */
    438 enum StructureRequestEnum {
    439 	INPUT_STRUCTURE_NONE,
    440 	INPUT_STRUCTURE_REPAIR_START,
    441 	INPUT_STRUCTURE_REPAIR,
    442 	INPUT_STRUCTURE_SELL_START,
    443 	INPUT_STRUCTURE_SELL,
    444 	INPUT_STRUCTURE_CANCEL,
    445 };
    446 
    447 
    448 /**************************************************************************************
    449 **
    450 **  Unit Requests Scatter, Select Next, Select Previous, Guard Mode, Stop
    451 **
    452 **
    453 */
    454 enum UnitRequestEnum {
    455 	INPUT_UNIT_NONE,
    456 	INPUT_UNIT_SCATTER,
    457 	INPUT_UNIT_SELECT_NEXT,
    458 	INPUT_UNIT_SELECT_PREVIOUS,
    459 	INPUT_UNIT_GUARD_MODE,
    460 	INPUT_UNIT_STOP,
    461 	INPUT_UNIT_FORMATION_TOGGLE,		// RA Only
    462 	INPUT_UNIT_QUEUED_MOVEMENT_ON, 	// RA Only
    463 	INPUT_UNIT_QUEUED_MOVEMENT_OFF,	// RA Only
    464 };
    465 
    466 
    467 /**************************************************************************************
    468 **
    469 **  Game Action Requests
    470 **
    471 **
    472 */
    473 enum GameRequestEnum {
    474 	INPUT_GAME_MOVIE_DONE,
    475 	INPUT_GAME_LOADING_DONE,
    476 };
    477 
    478 
    479 /**************************************************************************************
    480 **
    481 **  Beacon Requests
    482 **
    483 **
    484 */
    485 enum BeaconRequestEnum {
    486 	INPUT_BEACON_NONE,
    487 	INPUT_BEACON_PLACE,
    488 };
    489 
    490 
    491 
    492 /**************************************************************************************
    493 **
    494 **  Special Keys
    495 **
    496 **
    497 */
    498 enum SpecialKeyRequestEnum {
    499 	INPUT_SPECIAL_KEY_CTRL =	0b00000001,
    500 	INPUT_SPECIAL_KEY_ALT =		0b00000010,
    501 	INPUT_SPECIAL_KEY_SHIFT =	0b00000100,
    502 };
    503 
    504 
    505 
    506 /**************************************************************************************
    507 ** 
    508 **  Non-static map data.
    509 ** 
    510 **  Per-cell smudges and overlays. Smudges are used for things like craters and structure bibs that draw under units. 
    511 **  Overlays are things like walls and tiberium that can't move from the cell but aren't flat like smudges.
    512 ** 
    513 ** 
    514 */
    515 struct CNCDynamicMapEntryStruct {
    516 	char						AssetName[16];
    517 	int						PositionX;
    518 	int						PositionY;
    519 	int						Width;
    520 	int						Height;
    521 	short						Type;
    522 	char						Owner;
    523 	int						DrawFlags;
    524 	unsigned char			CellX;
    525 	unsigned char			CellY;
    526 	unsigned char			ShapeIndex;
    527 	bool						IsSmudge;
    528 	bool						IsOverlay;
    529 	bool						IsResource;
    530 	bool						IsSellable;
    531 	bool						IsTheaterShape;
    532 	bool						IsFlag;
    533 };
    534 
    535 struct CNCDynamicMapStruct {
    536 	bool							VortexActive;
    537 	int								VortexX;
    538 	int								VortexY;
    539 	int								VortexWidth;
    540 	int								VortexHeight;
    541 	int								Count;
    542 	CNCDynamicMapEntryStruct	Entries[1];			// Variable length
    543 };
    544 
    545 
    546 
    547 
    548 
    549 /**************************************************************************************
    550 ** 
    551 **  Event data
    552 ** 
    553 **  Used to call back into the GlyphX engine for one-time events like sound effect triggers
    554 ** 
    555 ** 
    556 */
    557 enum EventCallbackType {
    558 	CALLBACK_EVENT_INVALID = -1,
    559 	CALLBACK_EVENT_SOUND_EFFECT = 0,
    560 	CALLBACK_EVENT_SPEECH,
    561 	CALLBACK_EVENT_GAME_OVER,
    562 	CALLBACK_EVENT_DEBUG_PRINT,
    563 	CALLBACK_EVENT_MOVIE,
    564 	CALLBACK_EVENT_MESSAGE,
    565 	CALLBACK_EVENT_UPDATE_MAP_CELL,
    566 	CALLBACK_EVENT_ACHIEVEMENT,
    567 	CALLBACK_EVENT_STORE_CARRYOVER_OBJECTS,
    568 	CALLBACK_EVENT_SPECIAL_WEAPON_TARGETTING,
    569 	CALLBACK_EVENT_BRIEFING_SCREEN,
    570 	CALLBACK_EVENT_CENTER_CAMERA,
    571 	CALLBACK_EVENT_PING
    572 };
    573 
    574 
    575 struct GameOverMultiPlayerStatsStruct
    576 {
    577 	GameOverMultiPlayerStatsStruct()
    578 	:
    579 		GlyphXPlayerID( 0 ),
    580 		IsHuman( false ),
    581 		WasHuman( false ),
    582 		IsWinner( false ),
    583 		ResourcesGathered( 0 ),
    584 		TotalUnitsKilled( 0 ),
    585 		TotalStructuresKilled( 0 ),
    586 		Efficiency( 0 ),
    587 		Score( 0 )
    588 	{
    589 	}
    590 	__int64 GlyphXPlayerID;
    591 	bool IsHuman;
    592 	bool WasHuman;
    593 	bool IsWinner;
    594 	int ResourcesGathered;
    595 	int TotalUnitsKilled;
    596 	int TotalStructuresKilled;
    597 	int Efficiency; // AKA Economy	
    598 	int Score;
    599 };
    600 
    601 #define GAME_OVER_MULTIPLAYER_MAX_PLAYERS_TRACKED	8
    602 
    603 enum EventCallbackMessageEnum {
    604 	MESSAGE_TYPE_DIRECT = 0,
    605 	MESSAGE_TYPE_PLAYER_DEFEATED,
    606 	MESSAGE_TYPE_COMPUTER_TAUNT,
    607 	MESSAGE_TYPE_PLAYER_DISCONNECTED
    608 };
    609 
    610 struct EventCallbackStruct {
    611 
    612 	EventCallbackStruct::EventCallbackStruct(void) : EventType(CALLBACK_EVENT_INVALID), GlyphXPlayerID(0) { }
    613 
    614 	EventCallbackType EventType;
    615 
    616 	__int64 GlyphXPlayerID;
    617 
    618 	union {
    619 		
    620 		struct SoundEffectEvent {
    621 			int SFXIndex;
    622 			int Variation;
    623 			int PixelX;
    624 			int PixelY;
    625 			int PlayerID;		//TO_FIX
    626 			char SoundEffectName[ 16 ];
    627 			int SoundEffectPriority;
    628 			int SoundEffectContext;
    629 		} SoundEffect;
    630 		
    631 		struct SpeechEvent {
    632 			int SpeechIndex;
    633 			int PlayerID;		//TO_FIX
    634 			char SpeechName[ 16 ];
    635 		} Speech;
    636 			  
    637 		struct GameOverEvent {
    638 			bool Multiplayer;
    639 			//
    640 			// Single-player data
    641 			//
    642 			bool IsHuman;
    643 			bool PlayerWins;
    644 			const char* MovieName;
    645 			const char* MovieName2;
    646 			const char* MovieName3;
    647 			const char* MovieName4;
    648 			const char* AfterScoreMovieName;
    649 			int Score;
    650 			int Leadership;
    651 			int Efficiency;
    652 			int CategoryTotal;
    653 			int NODKilled;
    654 			int GDIKilled;
    655 			int CiviliansKilled;
    656 			int NODBuildingsDestroyed;
    657 			int GDIBuildingsDestroyed;
    658 			int CiviliansBuildingsDestroyed;
    659 			int RemainingCredits;
    660 			int SabotagedStructureType;
    661 			int TimerRemaining;
    662  			//
    663 			// Multi-player data
    664 			//
    665   		int MultiPlayerTotalPlayers;
    666 			GameOverMultiPlayerStatsStruct MultiPlayerPlayersData[ GAME_OVER_MULTIPLAYER_MAX_PLAYERS_TRACKED ];
    667 		} GameOver;
    668 		
    669 		struct DebugPrintEvent {
    670 			const char *PrintString;
    671 		} DebugPrint;
    672 
    673 		struct MovieEvent {
    674 			const char* MovieName;
    675 			int Theme;
    676 			bool Immediate;
    677 		} Movie;
    678 
    679 		struct MessageEvent {
    680 			const char* Message;
    681 			float TimeoutSeconds;
    682 			EventCallbackMessageEnum MessageType;
    683 			__int64 MessageParam1;
    684 		} Message;
    685 
    686 		struct UpdateMapCellEvent {
    687 			int CellX;
    688 			int CellY;
    689 			char TemplateTypeName[32];
    690 		} UpdateMapCell;
    691 
    692 		struct AchievementEvent {
    693 			const char* AchievementType;
    694 			const char* AchievementReason;
    695 		} Achievement;
    696 
    697 		struct StoreCarryoverObjectsEvent {
    698 			CarryoverObjectStruct* CarryoverList;
    699 		} StoreCarryoverObjects;
    700 
    701 		struct SpecialWeaponTargettingEvent {
    702 			int Type;
    703 			int ID;
    704 			char Name[16];
    705 			DllSuperweaponTypeEnum WeaponType;
    706 		} SpecialWeaponTargetting;
    707 
    708 		struct CenterCameraEvent {
    709 			int CoordX;
    710 			int CoordY;
    711 		} CenterCamera;
    712 
    713 		struct PingEvent {
    714 			int CoordX;
    715 			int CoordY;
    716 		} Ping;
    717 	};
    718 
    719 };
    720 
    721 
    722 
    723 
    724 
    725 
    726 
    727 
    728 /**************************************************************************************
    729 ** 
    730 **  Multiplayer setup data
    731 ** 
    732 **  Used to pass multiplayer setup info into the C&C code from the GlyphX engine
    733 ** 
    734 ** 
    735 */
    736 
    737 
    738 
    739 struct CNCMultiplayerOptionsStruct {
    740 	//int MPlayerPrefColor;				// preferred color index for this player
    741 	//int MPlayerColorIdx;					// actual color index of this player
    742 	//CnCHousesType MPlayerHouse;		// House of this player (GDI/NOD)
    743 	//unsigned char MPlayerLocalID;		// ID of this player
    744 	int MPlayerCount;						// # of human players in this game
    745 	int MPlayerBases;						// 1 = bases are on for this scenario
    746 	int MPlayerCredits;					// # credits everyone gets
    747 	int MPlayerTiberium;					// >0 = tiberium enabled for this scenario
    748 	int MPlayerGoodies;					// 1 = goodies enabled for this scenario
    749 	int MPlayerGhosts;					// 1 = houses with no players will still play
    750 	int MPlayerSolo;						// 1 = allows a single-player net game
    751 	int MPlayerUnitCount;				// # units for non-base multiplayer scenarios
    752 	bool IsMCVDeploy;						// MCV undeploys instead of selling
    753 	bool SpawnVisceroids;				// Do visceroids spawn
    754 	bool EnableSuperweapons;			// Are superweapons available
    755 	bool MPlayerShadowRegrow;
    756 	bool MPlayerAftermathUnits;
    757 	bool CaptureTheFlag;
    758 	bool DestroyStructures;				// New early win condition via destroying all a player's structures
    759 	bool ModernBalance;
    760 };
    761 
    762 
    763 
    764 struct CNCSpiedInfoStruct {
    765 	int Power;
    766 	int Drain;
    767 	int Money;
    768 };
    769 
    770 
    771 struct CNCPlayerInfoStruct {
    772 	char					Name[64];
    773 	unsigned char		House;
    774 	int					ColorIndex;
    775 	unsigned __int64	GlyphxPlayerID;
    776 	int					Team;
    777 	int					StartLocationIndex;
    778 	unsigned char		HomeCellX;
    779 	unsigned char		HomeCellY;
    780 	bool					IsAI;
    781 	unsigned int		AllyFlags;
    782 	bool					IsDefeated;
    783 	unsigned int		SpiedPowerFlags;
    784 	unsigned int		SpiedMoneyFlags;
    785 	CNCSpiedInfoStruct	SpiedInfo[MAX_HOUSES];
    786 	int					SelectedID;
    787 	DllObjectTypeEnum	SelectedType;
    788 	DllActionTypeEnum	ActionWithSelected[MAX_EXPORT_CELLS];
    789 	unsigned int		ActionWithSelectedCount;
    790 	unsigned int		ScreenShake;
    791 	bool				IsRadarJammed;
    792 };
    793 
    794 
    795 
    796 
    797 //
    798 enum GameRequestType {
    799 	GAME_REQUEST_MOVIE_DONE,
    800 };
    801 
    802 
    803 
    804 
    805 /**************************************************************************************
    806 **
    807 **  Rules configuration data
    808 **
    809 **
    810 */
    811 struct CNCDifficultyDataStruct
    812 {
    813 	float FirepowerBias;
    814 	float GroundspeedBias;
    815 	float AirspeedBias;
    816 	float ArmorBias;
    817 	float ROFBias;
    818 	float CostBias;
    819 	float BuildSpeedBias;
    820 
    821 	float RepairDelay;
    822 	float BuildDelay;
    823 
    824 	bool IsBuildSlowdown;
    825 	bool IsWallDestroyer;
    826 	bool IsContentScan;
    827 };
    828 
    829 struct CNCRulesDataStruct
    830 {
    831 	CNCDifficultyDataStruct Difficulties[3];
    832 };
    833 
    834 
    835 
    836 
    837 /**************************************************************************************
    838 ** 
    839 **  Debug input interface
    840 ** 
    841 ** 
    842 */
    843 
    844 enum DebugRequestEnum {
    845 	DEBUG_REQUEST_SPAWN_OBJECT,
    846 	DEBUG_REQUEST_END_GAME,
    847 	DEBUG_REQUEST_UNSHROUD,
    848 	DEBUG_REQUEST_SUPERWEAPON_RECHARGE,
    849 	DEBUG_REQUEST_KILL_OBJECT,
    850 	DEBUG_REQUEST_END_PRODUCTION,
    851 	DEBUG_REQUEST_ADD_RESOURCES,
    852 	DEBUG_REQUEST_UNLOCK_BUILDABLES,
    853 	DEBUG_REQUEST_FORCE_CRASH,
    854 	DEBUG_REQUEST_SET_GLOBAL_FLAG,
    855 };	
    856 
    857 
    858 
    859 
    860 
    861 
    862 /**************************************************************************************
    863 ** 
    864 **  Shroud data.
    865 ** 
    866 **  Per-cell shroud info
    867 ** 
    868 ** 
    869 */
    870 struct CNCShroudEntryStruct {
    871 	char			ShadowIndex;
    872 	bool			IsVisible;
    873 	bool			IsMapped;
    874 	bool			IsJamming;
    875 };
    876 
    877 struct CNCShroudStruct {
    878 	int							Count;
    879 	CNCShroudEntryStruct		Entries[1];			// Variable length
    880 };
    881 
    882 
    883 
    884 
    885 
    886 
    887 /**************************************************************************************
    888 **
    889 **  Occupier data.
    890 **
    891 **  Per-cell occupier info
    892 **
    893 **
    894 */
    895 struct CNCOccupierObjectStruct {
    896 	DllObjectTypeEnum			Type;
    897 	int							ID;
    898 };
    899 
    900 struct CNCOccupierEntryHeaderStruct {
    901 	int							Count;
    902 };
    903 
    904 struct CNCOccupierHeaderStruct {
    905 	int							Count;
    906 };
    907 
    908 
    909 
    910 
    911 /**************************************************************************************
    912 **
    913 **  Carryover object.
    914 **
    915 **  Used to store object data that persists between missions
    916 **
    917 **
    918 */
    919 struct CarryoverObjectStruct
    920 {
    921 	CarryoverObjectStruct() : Next(0) {}
    922 
    923 	CarryoverObjectStruct* Next;
    924 
    925 	int RTTI;
    926 	int Type;
    927 	int Cell;
    928 	int Strength;
    929 	int House;
    930 };
    931 
    932 
    933 
    934 
    935 
    936 /*
    937 ** End of strict structure packing
    938 ** 
    939 ** 
    940 */
    941 #pragma pack(pop)
    942 
    943 
    944 
    945 #endif //DLL_INTERFACE_H