metaforce/DataSpec/DNACommon/FSM2.hpp

155 lines
4.3 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-04-11 05:13:16 +00:00
#include "PAK.hpp"
#include "DNACommon.hpp"
#include "athena/FileWriter.hpp"
2017-12-29 08:08:12 +00:00
namespace DataSpec::DNAFSM2
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
struct IFSM : BigDNAVYaml
2016-04-11 05:13:16 +00:00
{
Delete _d;
};
template <class IDType>
2018-02-22 07:24:51 +00:00
struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
struct Header : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
DNAFourCC magic = FOURCC('FSM2');
2016-04-11 05:13:16 +00:00
Value<atUint32> version;
} header;
2018-02-22 07:24:51 +00:00
struct CommonStruct : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknown;
};
struct FSMV1 : IFSM
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
AT_DECL_DNAV
2016-04-11 05:13:16 +00:00
Value<atUint32> stateCount;
Value<atUint32> unknown1Count;
Value<atUint32> unknown2Count;
Value<atUint32> unknown3Count;
2018-02-22 07:24:51 +00:00
struct State : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknownCount;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
2016-04-11 05:13:16 +00:00
};
2018-02-22 07:24:51 +00:00
struct Unknown1 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<float> unknown1;
Value<atUint32> unknown2Count;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknown2Count)> unknown2;
2016-04-11 05:13:16 +00:00
Value<atUint8> unknown3;
};
2018-02-22 07:24:51 +00:00
struct Unknown2 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknownCount;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
2016-04-11 05:13:16 +00:00
};
2018-02-22 07:24:51 +00:00
struct Unknown3 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknownCount;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
2018-02-24 06:17:17 +00:00
Value<IDType> fsmId;
2016-04-11 05:13:16 +00:00
};
2018-02-25 08:23:27 +00:00
Vector<State, AT_DNA_COUNT(stateCount)> states;
Vector<Unknown1, AT_DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, AT_DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, AT_DNA_COUNT(unknown3Count)> unknown3;
2016-04-11 05:13:16 +00:00
};
struct FSMV2 : IFSM
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
AT_DECL_DNAV
2016-04-11 05:13:16 +00:00
Value<atUint32> stateCount;
Value<atUint32> unknown1Count;
Value<atUint32> unknown2Count;
Value<atUint32> unknown3Count;
2018-02-22 07:24:51 +00:00
struct State : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknown1;
Value<atUint32> unknown2;
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
2016-04-11 05:13:16 +00:00
};
2018-02-22 07:24:51 +00:00
struct Unknown1 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknown1;
Value<atUint32> unknown2;
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<float> unknown5;
Value<atUint32> unknown6Count;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknown6Count)> unknown6;
2016-04-11 05:13:16 +00:00
Value<atUint8> unknown7;
};
2018-02-22 07:24:51 +00:00
struct Unknown2 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknown1;
Value<atUint32> unknown2;
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
2016-04-11 05:13:16 +00:00
};
2018-02-22 07:24:51 +00:00
struct Unknown3 : BigDNA
2016-04-11 05:13:16 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2016-04-11 05:13:16 +00:00
String<-1> name;
Value<atUint32> unknown1;
Value<atUint32> unknown2;
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
2018-02-25 08:23:27 +00:00
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
2018-02-24 06:17:17 +00:00
Value<IDType> fsmId;
2016-04-11 05:13:16 +00:00
};
2018-02-25 08:23:27 +00:00
Vector<State, AT_DNA_COUNT(stateCount)> states;
Vector<Unknown1, AT_DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, AT_DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, AT_DNA_COUNT(unknown3Count)> unknown3;
2016-04-11 05:13:16 +00:00
};
std::unique_ptr<IFSM> detail;
2018-02-22 07:24:51 +00:00
AT_DECL_EXPLICIT_DNA_YAML
2016-04-11 05:13:16 +00:00
};
template <class IDType>
bool ExtractFSM2(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
template <class IDType>
bool WriteFSM2(const FSM2<IDType>& fsm2, const hecl::ProjectPath& outPath);
}