#ifndef __DNAMP1_MAPA_HPP__ #define __DNAMP1_MAPA_HPP__ #include #include "../DNACommon/PAK.hpp" #include "../DNACommon/MAPA.hpp" #include "DNAMP1.hpp" namespace Retro { namespace DNAMP1 { struct MAPA : BigDNA { DECL_DNA Value magic; Value version; Value unknown1; Value unknown2; Value aabbMin; Value aabbMax; Value mappableObjectCount; Value vertexCount; Value surfaceCount; struct MappableObject : BigDNA { DECL_DNA enum class Type : atUint32 { BlueDoor = 0, ShieldDoor = 1, IceDoor = 2, WaveDoor = 3, PlasmaDoor = 4, BigDoor1 = 5, BigDoor2 = 6, IceDoorCeiling = 7, IceDoorFloor = 8, WaveDoorCeiling = 9, WaveDoorFloor = 10, IceDoorFloor2 = 13, WaveDoorFloor2 = 14, DownArrowYellow = 27, /* Maintenance Tunnel */ UpArrowYellow = 28, /* Phazon Processing Center */ DownArrowGreen = 29, /* Elevator A */ UpArrowGreen = 30, /* Elite Control Access */ DownArrowRed = 31, /* Elevator B */ UpArrowRed = 32, /* Fungal Hall Access */ TransportLift = 33, SaveStation = 34, MissileStation = 37 }; Value type; Value unknown1; Value sclyId; Seek seek1; Value transformMtx[3]; Seek seek2; }; Vector mappableObjects; Vector vertices; struct SurfaceHeader : BigDNA { DECL_DNA Value normal; Value centroid; Value polyOff; Value edgeOff; }; Vector surfaceHeaders; struct Surface : BigDNA { DECL_DNA Value primitiveCount; struct Primitive : BigDNA { DECL_DNA Value type; Value indexCount; Vector indices; Align<4> align; }; Vector primitives; Value borderCount; struct Border : BigDNA { DECL_DNA Value indexCount; Vector indices; Align<4> align; }; Vector borders; }; Vector surfaces; static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, std::function fileChanged) { MAPA mapa; mapa.read(rs); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force); } }; } } #endif