#ifndef __OD2SRC_RESOURCEEXE_H__ #define __OD2SRC_RESOURCEEXE_H__ 1 /* OD2 - Dune II Clone * * Copyright (C) 2009 Robert Crossfield * 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 . * * * $Id$ * */ struct sGameVersions { uint32_t offName; // 'DUNE2.EXE' location uint32_t offUnits, offStructs, offHouses; // Units / Structures/ Houses uint32_t offReferences; // Subtraction from string references uint32_t offMapOffsets, offTerrainSpice; // Terrain Generation / Spice Generation data uint32_t offSin, offCos; // Precalculated sin/cos uint32_t offFiles; // File Table uint32_t offMapScales; // Map scale levels uint32_t offMapTileColors; // Minimap Tile Colors uint32_t offActions; // Unit Action Table uint32_t offFoundationSizes; // Foundation Sizes uint32_t offFoundationMapMod; // Map-Foundation Modifier (structure tile placement) uint32_t offUnitAngleFrameAdjust; // Unit-gfx Angle Frame adjustment uint32_t offUnitFrameAdjust; // Unit-gfx frame adjust uint32_t offUnitSiegeTurretFrameAdjust; // SiegeTank frame adjustments uint32_t offFoundationSizeAdd; // Foundation position lookup table uint32_t offAngleTable; // Angles uint32_t offMovementNames; // movement name offsets uint32_t offMovementTile; // movement tile amount uint32_t offMapMoveMod; uint32_t offMovementUnk1; uint32_t offAnimPtrs; // Animation Ptrs }; PACK struct sExeHouseData { dword houseName; word Weakness; word LemonFactor; word buildingDecay; word color; word PalaceUnitRecharge; word FrigateTime; word houseLetter; word PalaceMode; word missionWinMusic; word missionLoseMusic; word missionBriefMusic; dword houseVoice; } GNUC_ATTRIBUTE((packed)); PACK PACK struct sExeStructureData { word idShort; dword Name; word idLong; dword Picture; word buildOpts; word infantrySpawn; // Chance to spawn infantry on building destruction word HitPoints; word Sight; word sidebarIconID; word Cost; word BuildTime; word Techlevel; dword PreReqs; byte buildOrder; byte CYUpgradesNeeded; byte field_22; byte field_23; byte field_24; byte field_25; byte field_26; byte field_27; byte field_28; byte field_29; byte field_2A; word structureID; word weaponDamage; word weaponDamageAdd; byte Owner; dword UnitsCanEnter; word SpiceStorage; word PowerUsage; word FoundationSize; word structureGfxID; dword field_3E; dword field_42; dword field_46; word constructOpt1; word constructOpt2; word constructOpt3; word constructOpt4; word constructOpt5; word constructOpt6; word constructOpt7; word constructOpt8; word techUpgrade1; word techUpgrade2; word techUpgrade3; }GNUC_ATTRIBUTE((packed)); PACK PACK struct sExeUnitData { word stringID; dword Name; word stringLongID; dword Picture; word options1; word infantrySpawn; word HitPoints; word Sight; word sidebarIconID; word Cost; word buildTime; word TechLevel; dword PreReqs; byte buildOrder; byte UpgradesNeeded; word sidebarCommand1; word sidebarCommand2; word sidebarCommand3; word sidebarCommand4; byte field_2A; word field_2B; word field_2D; word Aggressivity; byte Owner; word indexMin; word indexMax; word optsFitW; byte field_38; byte field_39; word field_3A; word MovementType; word MovementPerFrame; word Speed; word turningSpeed; word UnitGfxID; word turretGfxID; word AICommand; word frameAngleMode; word deathAnim; word weaponRateFire; word weaponRange; word weaponDamage; word field_54; word weaponType; word weaponSound; }GNUC_ATTRIBUTE((packed)); PACK PACK struct sExeFileData { dword fileName; word field_4; word field_6; word field_8; word field_A; word field_C; word field_E; byte parentIndex; byte field_11; byte fileType; }GNUC_ATTRIBUTE((packed)); PACK PACK struct sExeActionData { word field_0; dword Name; word interruptAction; word sidebarMode; word responseSound; }GNUC_ATTRIBUTE((packed)); PACK class cResourceExe : public cBase { private: byte *_bufferExe; const sGameVersions *_version; bool versionCheck(); public: cResourceExe( cOD2 *pEngine, const char *pExe ); ~cResourceExe(); sExeActionData actionGet( uint32_t pIndex ); sExeHouseData houseGet( eHouse pHouse ); // Get house data at index sExeStructureData structureGet( uint32_t pIndex ); // Get structure data at index sExeUnitData unitGet( uint32_t pIndex); // Get unit data at index word *animPtrGet( uint32_t pAddress ); word *animPtrsGet( uint32_t pIndex ); word *angleTableGet(); sExeFileData *fileTableGet( ); word *foundationSizesGet( ); word *foundationMapModGet( ); byte *foundationSizeAdd( ); byte *framesGet( uint32_t pAddress ); byte *mapOffsetsGet( uint32_t pIndex ); // Get the map generator offsets byte *mapTerrainSpiceGet(); byte *mapSinTableGet(); byte *mapCosTableGet(); byte *mapTileColorGet(); byte *mapScalesGet(); byte *mapMoveMod(); byte *movementNames( ); byte *movementTileGet(); byte *movementUnk1Get(); byte *unitAngleFrameAdjustGet(); byte *unitFrameAdjustGet(); byte *UnitSiegeTurretFrameGet(); string stringGet( uint32_t pAddress ); // Takes an internal string reference ptr and returns the string }; #endif // __OD2SRC_RESOURCEEXE_H__