DLLInterface.h 20 KB

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