metaforce/DataSpec/DNAMP3/MLVL.hpp

88 lines
2.5 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2018-06-29 20:21:36 +00:00
#include "DataSpec/DNACommon/PAK.hpp"
#include "DataSpec/DNACommon/MLVL.hpp"
#include "DNAMP3.hpp"
2018-12-08 05:30:43 +00:00
namespace DataSpec::DNAMP3 {
struct MLVL : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> magic;
Value<atUint32> version;
UniqueID64 worldNameId;
Value<atUint32> unk;
UniqueID64 saveWorldId;
UniqueID64 worldSkyboxId;
Value<atUint32> areaCount;
struct Area : BigDNA {
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2018-12-08 05:30:43 +00:00
UniqueID64 areaNameId;
Value<atVec4f> transformMtx[3];
Value<atVec3f> aabb[2];
UniqueID64 areaMREAId;
Value<atUint64> areaId;
Value<atUint32> attachedAreaCount;
Vector<atUint16, AT_DNA_COUNT(attachedAreaCount)> attachedAreas;
Value<atUint32> dockCount;
struct Dock : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> endpointCount;
struct Endpoint : BigDNA {
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2018-12-08 05:30:43 +00:00
Value<atUint32> areaIdx;
Value<atUint32> dockIdx;
};
Vector<Endpoint, AT_DNA_COUNT(endpointCount)> endpoints;
2018-12-08 05:30:43 +00:00
Value<atUint32> planeVertCount;
Vector<atVec3f, AT_DNA_COUNT(planeVertCount)> planeVerts;
};
2018-12-08 05:30:43 +00:00
Vector<Dock, AT_DNA_COUNT(dockCount)> docks;
2018-12-08 05:30:43 +00:00
String<-1> internalAreaName;
};
Vector<Area, AT_DNA_COUNT(areaCount)> areas;
2018-12-08 05:30:43 +00:00
UniqueID64 worldMap;
Value<atUint8> unknown2;
Value<atUint32> unknown3;
2018-12-08 05:30:43 +00:00
Value<atUint32> layerFlagCount;
struct LayerFlags : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> layerCount;
Value<atUint64> flags;
};
Vector<LayerFlags, AT_DNA_COUNT(layerFlagCount)> layerFlags;
2015-09-23 06:35:07 +00:00
2018-12-08 05:30:43 +00:00
Value<atUint32> layerNameCount;
Vector<String<-1>, AT_DNA_COUNT(layerNameCount)> layerNames;
2018-12-08 05:30:43 +00:00
Value<atUint32> layerIDCount;
struct LayerID : BigDNA {
AT_DECL_DNA_YAML
Value<atUint64> id[2];
};
Vector<LayerID, AT_DNA_COUNT(layerIDCount)> layerIDs;
Value<atUint32> layerNameOffsetCount;
Vector<atUint32, AT_DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
std::function<void(const char*)> fileChanged) {
2018-12-08 05:30:43 +00:00
MLVL mlvl;
mlvl.read(rs);
athena::io::FileWriter writer(outPath.getWithExtension(".yaml", true).getAbsolutePath());
2018-12-08 05:30:43 +00:00
athena::io::ToYAMLStream(mlvl, writer);
hecl::blender::Connection& conn = btok.getBlenderConnection();
return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter, entry, force, fileChanged);
}
};
2018-12-08 05:30:43 +00:00
} // namespace DataSpec::DNAMP3