2015-07-13 06:29:12 +00:00
|
|
|
#ifndef __DNAMP3_MLVL_HPP__
|
|
|
|
#define __DNAMP3_MLVL_HPP__
|
|
|
|
|
2015-09-23 06:35:07 +00:00
|
|
|
#include "../DNACommon/PAK.hpp"
|
2015-11-25 00:21:58 +00:00
|
|
|
#include "../DNACommon/MLVL.hpp"
|
|
|
|
#include "DNAMP3.hpp"
|
2015-07-13 06:29:12 +00:00
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace DataSpec
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
|
|
|
namespace DNAMP3
|
|
|
|
{
|
|
|
|
|
2015-09-23 06:35:07 +00:00
|
|
|
struct MLVL : BigYAML
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-09-23 06:35:07 +00:00
|
|
|
DECL_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;
|
2015-09-23 06:35:07 +00:00
|
|
|
struct Area : BigYAML
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-09-23 06:35:07 +00:00
|
|
|
DECL_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;
|
|
|
|
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
|
|
|
|
|
|
|
Value<atUint32> dockCount;
|
2015-09-23 06:35:07 +00:00
|
|
|
struct Dock : BigYAML
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-09-23 06:35:07 +00:00
|
|
|
DECL_YAML
|
2015-07-13 06:29:12 +00:00
|
|
|
Value<atUint32> endpointCount;
|
2015-09-23 06:35:07 +00:00
|
|
|
struct Endpoint : BigYAML
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-09-23 06:35:07 +00:00
|
|
|
DECL_YAML
|
2015-07-13 06:29:12 +00:00
|
|
|
Value<atUint32> areaIdx;
|
|
|
|
Value<atUint32> dockIdx;
|
|
|
|
};
|
|
|
|
Vector<Endpoint, DNA_COUNT(endpointCount)> endpoints;
|
|
|
|
|
|
|
|
Value<atUint32> planeVertCount;
|
|
|
|
Vector<atVec3f, DNA_COUNT(planeVertCount)> planeVerts;
|
|
|
|
};
|
|
|
|
Vector<Dock, DNA_COUNT(dockCount)> docks;
|
|
|
|
|
|
|
|
String<-1> internalAreaName;
|
|
|
|
};
|
2015-07-14 00:38:48 +00:00
|
|
|
Vector<Area, DNA_COUNT(areaCount)> areas;
|
2015-07-13 06:29:12 +00:00
|
|
|
|
|
|
|
UniqueID64 worldMap;
|
|
|
|
Value<atUint8> unknown2;
|
|
|
|
Value<atUint32> unknown3;
|
|
|
|
|
|
|
|
Value<atUint32> layerFlagCount;
|
2015-09-23 06:35:07 +00:00
|
|
|
struct LayerFlags : BigYAML
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-09-23 06:35:07 +00:00
|
|
|
DECL_YAML
|
2015-07-13 06:29:12 +00:00
|
|
|
Value<atUint32> layerCount;
|
|
|
|
Value<atUint64> flags;
|
|
|
|
};
|
|
|
|
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
|
|
|
|
|
|
|
|
Value<atUint32> layerNameCount;
|
|
|
|
Vector<String<-1>, DNA_COUNT(layerNameCount)> layerNames;
|
|
|
|
|
|
|
|
Value<atUint32> layerIDCount;
|
2016-03-04 04:39:51 +00:00
|
|
|
struct LayerID : BigYAML
|
|
|
|
{
|
|
|
|
DECL_YAML
|
|
|
|
Value<atUint64> id[2];
|
|
|
|
};
|
|
|
|
Vector<LayerID, DNA_COUNT(layerIDCount)> layerIDs;
|
2015-07-13 06:29:12 +00:00
|
|
|
|
|
|
|
Value<atUint32> layerNameOffsetCount;
|
|
|
|
Vector<atUint32, 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,
|
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);
|
2016-03-04 23:04:53 +00:00
|
|
|
FILE* fp = hecl::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("wb"));
|
2015-09-23 06:35:07 +00:00
|
|
|
mlvl.toYAMLFile(fp);
|
|
|
|
fclose(fp);
|
2016-03-04 23:04:53 +00:00
|
|
|
hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __DNAMP3_MLVL_HPP__
|