#ifndef __DNACOMMON_MAPA_HPP__ #define __DNACOMMON_MAPA_HPP__ #include "DNACommon.hpp" #include "GX.hpp" namespace DataSpec { namespace DNAMAPA { struct MAPA : BigDNA { Delete _d; Value magic; Value version; struct IMAPAHeader : BigDNA { Delete _d; virtual atUint32 mappableObjectCount() const=0; virtual atUint32 vertexCount() const=0; virtual atUint32 surfaceCount() const=0; }; struct HeaderMP1 : IMAPAHeader { DECL_DNA Value unknown1; Value unknown2; Value boundingBox[2]; Value moCount; Value vtxCount; Value surfCount; virtual atUint32 mappableObjectCount() const { return moCount;} virtual atUint32 vertexCount() const { return vtxCount; } virtual atUint32 surfaceCount() const { return surfCount; } }; struct HeaderMP2 : IMAPAHeader { DECL_DNA Value unknown1; Value unknown2; Value boundingBox[2]; Value unknown3; Value unknown4; Value unknown5; Value moCount; Value vtxCount; Value surfCount; atUint32 mappableObjectCount() const { return moCount;} atUint32 vertexCount() const { return vtxCount; } atUint32 surfaceCount() const { return surfCount; } }; struct HeaderMP3 : IMAPAHeader { DECL_DNA Value unknown1; Value unknown2; Value boundingBox[2]; Value unknown3; Value unknown4; Value unknown5; Value unknown6; Value moCount; Value vtxCount; Value surfCount; Value internalNameLength; Value unknown7; String internalName; atUint32 mappableObjectCount() const { return moCount;} atUint32 vertexCount() const { return vtxCount; } atUint32 surfaceCount() const { return surfCount; } }; void read(athena::io::IStreamReader& __dna_reader); void write(athena::io::IStreamWriter& __dna_writer) const; size_t binarySize(size_t __isz) const; std::unique_ptr header; struct IMappableObject : BigDNA { 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 }; virtual ~IMappableObject() {} }; struct MappableObjectMP1_2 : IMappableObject { DECL_DNA Value type; Value unknown1; Value sclyId; Seek seek1; Value transformMtx[3]; Seek seek2; virtual ~MappableObjectMP1_2() {} }; struct MappableObjectMP3 : IMappableObject { DECL_DNA Value type; Value unknown1; Value sclyId; Buffer unknownHash; Seek seek1; Value transformMtx[3]; Seek seek2; virtual ~MappableObjectMP3() {} }; std::vector> mappableObjects; VectorvertexCount())> vertices; struct SurfaceHeader : BigDNA { DECL_DNA Value normal; Value centroid; Value polyOff; Value edgeOff; }; VectorsurfaceCount())> 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; }; VectorsurfaceCount())> surfaces; }; template bool ReadMAPAToBlender(hecl::BlenderConnection& conn, const MAPA& mapa, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, bool force); } } #endif // __DNACOMMON_MAPA_HPP__