metaforce/DataSpec/DNAMP1/EVNT.hpp

112 lines
2.7 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-15 04:12:15 +00:00
2018-06-29 20:21:36 +00:00
#include "DataSpec/DNACommon/DNACommon.hpp"
2016-01-19 05:32:34 +00:00
#include "DNAMP1.hpp"
2015-08-15 04:12:15 +00:00
2017-12-29 08:08:12 +00:00
namespace DataSpec::DNAMP1
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
struct EVNT : BigDNA
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_EXPLICIT_DNA_YAML
2015-08-15 04:12:15 +00:00
Value<atUint32> version;
2018-02-22 07:24:51 +00:00
struct POINode : BigDNA
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2015-08-15 04:12:15 +00:00
Value<atUint16> unk0;
String<-1> name;
Value<atUint16> type;
2018-02-22 07:24:51 +00:00
struct CharAnimTime : BigDNA
{
2016-04-11 07:10:28 +00:00
enum class Type : atUint32
{
NonZero,
ZeroIncreasing,
ZeroSteady,
ZeroDecreasing,
Infinity
};
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
Value<float> time;
2016-04-11 07:10:28 +00:00
Value<Type> type;
};
CharAnimTime animTime;
2015-08-15 04:12:15 +00:00
Value<atUint32> idx;
Value<bool> unk2;
2016-04-28 04:52:41 +00:00
Value<float> weight;
Value<atUint32> charIdx;
Value<atUint32> flags;
2015-08-15 04:12:15 +00:00
};
struct BoolPOINode : POINode
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
Value<atUint8> value;
2015-08-15 04:12:15 +00:00
};
2018-02-22 07:24:51 +00:00
Value<atUint32> boolPOICount;
2018-02-25 08:23:27 +00:00
Vector<BoolPOINode, AT_DNA_COUNT(boolPOICount)> boolPOINodes;
2015-08-15 04:12:15 +00:00
struct Int32POINode : POINode
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
Value<atUint32> value;
2016-05-03 08:27:28 +00:00
String<-1> locator;
2015-08-15 04:12:15 +00:00
};
2018-02-22 07:24:51 +00:00
Value<atUint32> int32POICount;
2018-02-25 08:23:27 +00:00
Vector<Int32POINode, AT_DNA_COUNT(int32POICount)> int32POINodes;
2015-08-15 04:12:15 +00:00
struct ParticlePOINode : POINode
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
Value<atUint32> duration;
2017-11-26 03:04:25 +00:00
DNAFourCC ptype;
2016-05-03 08:27:28 +00:00
UniqueID32 id;
String<-1> locator;
2015-08-15 04:12:15 +00:00
Value<float> scale;
Value<atUint32> parentMode;
};
2018-02-22 07:24:51 +00:00
Value<atUint32> particlePOICount;
2018-02-25 08:23:27 +00:00
Vector<ParticlePOINode, AT_DNA_COUNT(particlePOICount)> particlePOINodes;
2015-08-15 04:12:15 +00:00
struct SoundPOINode : POINode
2015-08-15 04:12:15 +00:00
{
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2015-08-15 04:12:15 +00:00
Value<atUint32> soundId;
Value<float> falloff;
Value<float> maxDist;
2015-08-15 04:12:15 +00:00
};
2018-02-22 07:24:51 +00:00
Value<atUint32> soundPOICount;
2018-02-25 08:23:27 +00:00
Vector<SoundPOINode, AT_DNA_COUNT(soundPOICount)> soundPOINodes;
2016-01-19 05:32:34 +00:00
2016-03-04 23:04:53 +00:00
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
2016-01-19 05:32:34 +00:00
{
EVNT evnt;
evnt.read(rs);
2016-08-22 03:47:48 +00:00
athena::io::FileWriter writer(outPath.getAbsolutePath());
2018-02-22 07:24:51 +00:00
athena::io::ToYAMLStream(evnt, writer);
2016-01-19 05:32:34 +00:00
return true;
}
static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath)
{
EVNT evnt;
athena::io::FileReader reader(inPath.getAbsolutePath());
2018-02-22 07:24:51 +00:00
athena::io::FromYAMLStream(evnt, reader);
athena::io::FileWriter ws(outPath.getAbsolutePath());
evnt.write(ws);
return true;
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
{
for (const ParticlePOINode& node : particlePOINodes)
g_curSpec->flattenDependencies(node.id, pathsOut);
}
2015-08-15 04:12:15 +00:00
};
}