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