#pragma once #include "DataSpec/DNACommon/PAK.hpp" #include "DataSpec/DNACommon/MLVL.hpp" #include "DNAMP1.hpp" namespace DataSpec::DNAMP1 { struct MLVL : BigDNA { AT_DECL_DNA_YAML Value magic; Value version; UniqueID32 worldNameId; UniqueID32 saveWorldId; UniqueID32 worldSkyboxId; Value memRelayLinkCount; struct MemRelayLink : BigDNA { AT_DECL_DNA_YAML Value memRelayId; Value targetId; Value msg; Value active; }; Vector memRelayLinks; Value areaCount; Value unknown1; struct Area : BigDNA { AT_DECL_DNA_YAML UniqueID32 areaNameId; Value transformMtx[3]; Value aabb[2]; UniqueID32 areaMREAId; Value areaId; Value attachedAreaCount; Vector attachedAreas; struct Dependency : BigDNA { AT_DECL_DNA_YAML UniqueID32 id; DNAFourCC type; Dependency() = default; Dependency(const UniqueID32& idin, const hecl::FourCC& fcc) : id(idin), type(fcc) {} }; Value lazyDepCount; Vector lazyDeps; Value depCount; Vector deps; Value depLayerCount; Vector depLayers; Value dockCount; struct Dock : BigDNA { AT_DECL_DNA_YAML Value endpointCount; struct Endpoint : BigDNA { AT_DECL_DNA_YAML Value areaIdx; Value dockIdx; }; Vector endpoints; Value planeVertCount; Vector planeVerts; }; Vector docks; }; Vector areas; void finishLastArea() { if (areas.size()) { MLVL::Area& areaLast = areas.back(); areaLast.attachedAreaCount = areaLast.attachedAreas.size(); areaLast.lazyDepCount = areaLast.lazyDeps.size(); areaLast.depCount = areaLast.deps.size(); areaLast.depLayerCount = areaLast.depLayers.size(); areaLast.dockCount = areaLast.docks.size(); } } UniqueID32 worldMap; Value unknown2; Value unknown3; Value audioGroupCount; struct AudioGroup : BigDNA { AT_DECL_DNA_YAML Value groupId; UniqueID32 agscId; }; Vector audioGroups; String<-1> unkString; Value layerFlagCount; struct LayerFlags : BigDNA { AT_DECL_DNA_YAML Value layerCount; Value flags; }; Vector layerFlags; Value layerNameCount; Vector, AT_DNA_COUNT(layerNameCount)> layerNames; Value layerNameOffsetCount; Vector layerNameOffsets; void readMeta(athena::io::YAMLDocReader& __dna_docin) { /* worldSkyboxId */ __dna_docin.enumerate("worldSkyboxId", worldSkyboxId); /* audioGroupCount squelched */ /* audioGroups */ audioGroupCount = __dna_docin.enumerate("audioGroups", audioGroups); } void writeMeta(athena::io::YAMLDocWriter& __dna_docout) const { /* worldSkyboxId */ __dna_docout.enumerate("worldSkyboxId", worldSkyboxId); /* audioGroupCount squelched */ /* audioGroups */ __dna_docout.enumerate("audioGroups", audioGroups); } static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok, std::function fileChanged); static bool ExtractMAPW(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); static bool ExtractSAVW(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); using World = hecl::blender::World; static bool Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const World& wld, hecl::blender::Token& btok); static bool CookMAPW(const hecl::ProjectPath& outPath, const World& wld); static bool CookSAVW(const hecl::ProjectPath& outPath, const World& wld); }; } // namespace DataSpec::DNAMP1