2015-07-13 06:29:12 +00:00
|
|
|
#ifndef __DNAMP1_MLVL_HPP__
|
|
|
|
#define __DNAMP1_MLVL_HPP__
|
|
|
|
|
2015-08-22 01:58:41 +00:00
|
|
|
#include "../DNACommon/PAK.hpp"
|
2015-10-24 01:23:45 +00:00
|
|
|
#include "../DNACommon/MLVL.hpp"
|
|
|
|
#include "DNAMP1.hpp"
|
2015-06-24 20:56:23 +00:00
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace DataSpec
|
2015-07-01 23:50:39 +00:00
|
|
|
{
|
2015-06-25 19:53:27 +00:00
|
|
|
namespace DNAMP1
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
|
|
|
|
2015-08-01 00:38:35 +00:00
|
|
|
struct MLVL : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-07-13 06:29:12 +00:00
|
|
|
Value<atUint32> magic;
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint32> version;
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 worldNameId;
|
|
|
|
UniqueID32 saveWorldId;
|
|
|
|
UniqueID32 worldSkyboxId;
|
2015-06-24 20:56:23 +00:00
|
|
|
|
|
|
|
Value<atUint32> memRelayLinkCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct MemRelayLink : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint32> memRelayId;
|
|
|
|
Value<atUint32> targetId;
|
|
|
|
Value<atUint16> msg;
|
2015-12-03 04:11:03 +00:00
|
|
|
Value<bool> active;
|
2015-06-24 20:56:23 +00:00
|
|
|
};
|
|
|
|
Vector<MemRelayLink, DNA_COUNT(memRelayLinkCount)> memRelayLinks;
|
|
|
|
|
|
|
|
Value<atUint32> areaCount;
|
|
|
|
Value<atUint32> unknown1;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct Area : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 areaNameId;
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atVec4f> transformMtx[3];
|
|
|
|
Value<atVec3f> aabb[2];
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 areaMREAId;
|
2015-07-14 00:38:48 +00:00
|
|
|
UniqueID32 areaId;
|
2015-06-24 20:56:23 +00:00
|
|
|
|
|
|
|
Value<atUint32> attachedAreaCount;
|
|
|
|
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
|
|
|
Value<atUint32> padding;
|
|
|
|
|
|
|
|
Value<atUint32> depCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct Dependency : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 id;
|
2015-08-23 06:42:29 +00:00
|
|
|
DNAFourCC type;
|
2015-06-24 20:56:23 +00:00
|
|
|
};
|
|
|
|
Vector<Dependency, DNA_COUNT(depCount)> deps;
|
|
|
|
|
|
|
|
Value<atUint32> depLayerCount;
|
|
|
|
Vector<atUint32, DNA_COUNT(depLayerCount)> depLayers;
|
|
|
|
|
|
|
|
Value<atUint32> dockCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct Dock : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint32> endpointCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct Endpoint : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-06-24 20:56:23 +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;
|
|
|
|
};
|
2015-07-12 04:26:26 +00:00
|
|
|
Vector<Area, DNA_COUNT(areaCount)> areas;
|
2015-06-24 20:56:23 +00:00
|
|
|
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 worldMap;
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint8> unknown2;
|
|
|
|
Value<atUint32> unknown3;
|
|
|
|
|
|
|
|
Value<atUint32> audioGroupCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct AudioGroup : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint32> unknown;
|
2015-07-09 06:40:55 +00:00
|
|
|
UniqueID32 agscId;
|
2015-06-24 20:56:23 +00:00
|
|
|
};
|
|
|
|
Vector<AudioGroup, DNA_COUNT(audioGroupCount)> audioGroups;
|
|
|
|
String<-1> unkString;
|
|
|
|
|
|
|
|
Value<atUint32> layerFlagCount;
|
2015-08-01 00:38:35 +00:00
|
|
|
struct LayerFlags : BigYAML
|
2015-06-24 20:56:23 +00:00
|
|
|
{
|
2015-08-01 00:38:35 +00:00
|
|
|
DECL_YAML
|
2015-06-24 20:56:23 +00:00
|
|
|
Value<atUint32> layerCount;
|
|
|
|
Value<atUint64> flags;
|
|
|
|
};
|
|
|
|
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
|
|
|
|
|
|
|
|
Value<atUint32> layerNameCount;
|
2015-06-25 19:53:27 +00:00
|
|
|
Vector<String<-1>, DNA_COUNT(layerNameCount)> layerNames;
|
2015-06-24 20:56:23 +00:00
|
|
|
|
|
|
|
Value<atUint32> layerNameOffsetCount;
|
|
|
|
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
|
2015-08-02 04:25:38 +00:00
|
|
|
|
2015-10-24 01:23:45 +00:00
|
|
|
static bool Extract(const SpecBase& dataSpec,
|
|
|
|
PAKEntryReadStream& rs,
|
|
|
|
const HECL::ProjectPath& outPath,
|
|
|
|
PAKRouter<PAKBridge>& pakRouter,
|
|
|
|
const PAK::Entry& entry,
|
|
|
|
bool force,
|
|
|
|
std::function<void(const HECL::SystemChar*)> fileChanged)
|
2015-08-02 04:25:38 +00:00
|
|
|
{
|
|
|
|
MLVL mlvl;
|
|
|
|
mlvl.read(rs);
|
2015-10-26 02:31:09 +00:00
|
|
|
FILE* fp = HECL::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("w"));
|
|
|
|
mlvl.toYAMLFile(fp);
|
|
|
|
fclose(fp);
|
2015-10-24 01:23:45 +00:00
|
|
|
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
|
|
|
|
return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter,
|
|
|
|
entry, force, fileChanged);
|
2015-08-02 04:25:38 +00:00
|
|
|
}
|
2015-06-24 20:56:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-07-01 23:50:39 +00:00
|
|
|
}
|
2015-07-13 06:29:12 +00:00
|
|
|
|
|
|
|
#endif // __DNAMP1_MLVL_HPP__
|