#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 Type : atUint32 { MOBlueDoor = 0, MOShieldDoor = 1, MOIceDoor = 2, MOWaveDoor = 3, MOPlasmaDoor = 4, MOBigDoor1 = 5, MOBigDoor2 = 6, MOIceDoorCeiling = 7, MOIceDoorFloor = 8, MOWaveDoorCeiling = 9, MOWaveDoorFloor = 10, MOIceDoorFloor2 = 13, MOWaveDoorFloor2 = 14, MODownArrowYellow = 27, /* Maintenance Tunnel */ MOUpArrowYellow = 28, /* Phazon Processing Center */ MODownArrowGreen = 29, /* Elevator A */ MOUpArrowGreen = 30, /* Elite Control Access */ MODownArrowRed = 31, /* Elevator B */ MOUpArrowRed = 32, /* Fungal Hall Access */ MOTransportLift = 33, MOSaveStation = 34, MOMissileStation = 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