#ifndef __DNAMP1_MLVL_HPP__ #define __DNAMP1_MLVL_HPP__ #include "../DNACommon/PAK.hpp" #include "../DNACommon/MLVL.hpp" #include "DNAMP1.hpp" namespace DataSpec { namespace DNAMP1 { struct MLVL : BigYAML { DECL_YAML Value magic; Value version; UniqueID32 worldNameId; UniqueID32 saveWorldId; UniqueID32 worldSkyboxId; Value memRelayLinkCount; struct MemRelayLink : BigYAML { DECL_YAML Value memRelayId; Value targetId; Value msg; Value active; }; Vector memRelayLinks; Value areaCount; Value unknown1; struct Area : BigYAML { DECL_YAML UniqueID32 areaNameId; Value transformMtx[3]; Value aabb[2]; UniqueID32 areaMREAId; UniqueID32 areaId; Value attachedAreaCount; Vector attachedAreas; Value padding; Value depCount; struct Dependency : BigYAML { DECL_YAML UniqueID32 id; DNAFourCC type; }; Vector deps; Value depLayerCount; Vector depLayers; Value dockCount; struct Dock : BigYAML { DECL_YAML Value endpointCount; struct Endpoint : BigYAML { DECL_YAML Value areaIdx; Value dockIdx; }; Vector endpoints; Value planeVertCount; Vector planeVerts; }; Vector docks; }; Vector areas; UniqueID32 worldMap; Value unknown2; Value unknown3; Value audioGroupCount; struct AudioGroup : BigYAML { DECL_YAML Value unknown; UniqueID32 agscId; }; Vector audioGroups; String<-1> unkString; Value layerFlagCount; struct LayerFlags : BigYAML { DECL_YAML Value layerCount; Value flags; }; Vector layerFlags; Value layerNameCount; Vector, DNA_COUNT(layerNameCount)> layerNames; Value layerNameOffsetCount; Vector layerNameOffsets; static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, std::function fileChanged) { MLVL mlvl; mlvl.read(rs); FILE* fp = HECL::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("w")); mlvl.toYAMLFile(fp); fclose(fp); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter, entry, force, fileChanged); } }; } } #endif // __DNAMP1_MLVL_HPP__