#pragma once #include #include #include "DataSpec/DNACommon/DNACommon.hpp" namespace hecl { class ProjectPath; } namespace hecl::blender { class Connection; struct MapArea; } // namespace hecl::blender namespace DataSpec::DNAMAPA { struct MAPA : BigDNA { AT_DECL_EXPLICIT_DNA Value magic; Value version; struct IMAPAHeader : BigDNAV { Delete _d; virtual atUint32 visMode() const = 0; virtual atUint32 mappableObjectCount() const = 0; virtual atUint32 vertexCount() const = 0; virtual atUint32 surfaceCount() const = 0; }; struct HeaderMP1 : IMAPAHeader { AT_DECL_DNAV Value unknown1 = 0; Value mapVisMode = 0; Value boundingBox[2] = {}; Value moCount = 0; Value vtxCount = 0; Value surfCount = 0; atUint32 visMode() const override { return mapVisMode; } atUint32 mappableObjectCount() const override { return moCount; } atUint32 vertexCount() const override { return vtxCount; } atUint32 surfaceCount() const override { return surfCount; } }; struct HeaderMP2 : IMAPAHeader { AT_DECL_DNAV Value unknown1 = 0; Value mapVisMode = 0; Value boundingBox[2] = {}; Value unknown3 = 0; Value unknown4 = 0; Value unknown5 = 0; Value moCount = 0; Value vtxCount = 0; Value surfCount = 0; atUint32 visMode() const override { return mapVisMode; } atUint32 mappableObjectCount() const override { return moCount; } atUint32 vertexCount() const override { return vtxCount; } atUint32 surfaceCount() const override { return surfCount; } }; struct HeaderMP3 : IMAPAHeader { AT_DECL_DNAV Value unknown1 = 0; Value mapVisMode = 0; Value boundingBox[2] = {}; Value unknown3 = 0; Value unknown4 = 0; Value unknown5 = 0; Value unknown6 = 0; Value moCount = 0; Value vtxCount = 0; Value surfCount = 0; Value internalNameLength = 0; Value unknown7 = 0; String internalName; atUint32 visMode() const override { return mapVisMode; } atUint32 mappableObjectCount() const override { return moCount; } atUint32 vertexCount() const override { return vtxCount; } atUint32 surfaceCount() const override { return surfCount; } }; std::unique_ptr header; struct IMappableObject : BigDNAV { Delete _d; 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 }; }; struct MappableObjectMP1_2 : IMappableObject { AT_DECL_DNAV Value type; Value visMode; Value sclyId; Value seek1 = -1; Value transformMtx[3]; Value seek2[4] = {-1, -1, -1, -1}; }; struct MappableObjectMP3 : IMappableObject { AT_DECL_DNAV Value type; Value visMode; Value sclyId; Buffer unknownHash; Value seek1 = -1; Value transformMtx[3]; Value seek2[4] = {-1, -1, -1, -1}; }; std::vector> mappableObjects; VectorvertexCount())> vertices; struct SurfaceHeader : BigDNA { AT_DECL_DNA Value normal; Value centroid; Value polyOff; Value edgeOff; }; VectorsurfaceCount())> surfaceHeaders; struct Surface : BigDNA { AT_DECL_DNA Value primitiveCount; struct Primitive : BigDNA { AT_DECL_DNA Value type; Value indexCount; Vector indices; Align<4> align; }; Vector primitives; Value borderCount; struct Border : BigDNA { AT_DECL_DNA Value indexCount; Vector indices; Align<4> align; }; Vector borders; }; VectorsurfaceCount())> surfaces; }; template bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, bool force); template bool Cook(const hecl::blender::MapArea& mapa, const hecl::ProjectPath& out); } // namespace DataSpec::DNAMAPA