2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-02-02 04:29:58 +00:00
|
|
|
|
2019-08-23 23:24:04 +00:00
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
|
|
|
#include "DataSpec/DNACommon/ParticleCommon.hpp"
|
|
|
|
|
|
|
|
namespace DataSpec {
|
|
|
|
class PAKEntryReadStream;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace hecl {
|
|
|
|
class ProjectPath;
|
|
|
|
}
|
2016-02-02 04:29:58 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec::DNAParticle {
|
2016-02-02 04:29:58 +00:00
|
|
|
|
|
|
|
template <class IDType>
|
2020-03-29 06:56:54 +00:00
|
|
|
struct _GPSM {
|
|
|
|
static constexpr ParticleType Type = ParticleType::GPSM;
|
|
|
|
|
|
|
|
#define INT_ENTRY(name, identifier) IntElementFactory identifier;
|
|
|
|
#define REAL_ENTRY(name, identifier) RealElementFactory identifier;
|
|
|
|
#define VECTOR_ENTRY(name, identifier) VectorElementFactory identifier;
|
|
|
|
#define MOD_VECTOR_ENTRY(name, identifier) ModVectorElementFactory identifier;
|
|
|
|
#define COLOR_ENTRY(name, identifier) ColorElementFactory identifier;
|
|
|
|
#define EMITTER_ENTRY(name, identifier) EmitterElementFactory identifier;
|
|
|
|
#define UV_ENTRY(name, identifier) UVElementFactory<IDType> identifier;
|
|
|
|
#define RES_ENTRY(name, identifier) ChildResourceFactory<IDType> identifier;
|
|
|
|
#define KSSM_ENTRY(name, identifier) SpawnSystemKeyframeData<IDType> identifier;
|
|
|
|
#define BOOL_ENTRY(name, identifier, def) bool identifier = def;
|
|
|
|
#include "PART.def"
|
|
|
|
|
2021-06-07 19:29:18 +00:00
|
|
|
template <typename _Func>
|
2020-03-29 06:56:54 +00:00
|
|
|
void constexpr Enumerate(_Func f) {
|
|
|
|
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
|
|
|
|
#define BOOL_ENTRY(name, identifier, def) f(FOURCC(name), identifier, def);
|
|
|
|
#include "PART.def"
|
|
|
|
}
|
|
|
|
|
2021-06-07 19:29:18 +00:00
|
|
|
template <typename _Func>
|
2020-03-29 06:56:54 +00:00
|
|
|
bool constexpr Lookup(FourCC fcc, _Func f) {
|
|
|
|
switch (fcc.toUint32()) {
|
2021-06-07 19:29:18 +00:00
|
|
|
#define ENTRY(name, identifier) \
|
|
|
|
case SBIG(name): \
|
|
|
|
f(identifier); \
|
|
|
|
return true;
|
2020-03-29 06:56:54 +00:00
|
|
|
#include "PART.def"
|
2021-06-07 19:29:18 +00:00
|
|
|
default:
|
|
|
|
return false;
|
2020-03-29 06:56:54 +00:00
|
|
|
}
|
|
|
|
}
|
2016-02-02 04:29:58 +00:00
|
|
|
};
|
2020-03-29 06:56:54 +00:00
|
|
|
template <class IDType>
|
|
|
|
using GPSM = PPImpl<_GPSM<IDType>>;
|
2016-02-02 04:29:58 +00:00
|
|
|
|
2016-02-03 03:58:33 +00:00
|
|
|
template <class IDType>
|
2016-03-05 00:03:41 +00:00
|
|
|
bool ExtractGPSM(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
|
2016-02-03 03:58:33 +00:00
|
|
|
|
2016-02-04 00:55:39 +00:00
|
|
|
template <class IDType>
|
2016-03-05 00:03:41 +00:00
|
|
|
bool WriteGPSM(const GPSM<IDType>& gpsm, const hecl::ProjectPath& outPath);
|
2016-02-04 00:55:39 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace DataSpec::DNAParticle
|