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 <vector>
|
|
|
|
|
|
|
|
#include "DataSpec/DNACommon/ParticleCommon.hpp"
|
|
|
|
#include "DataSpec/DNACommon/PAK.hpp"
|
|
|
|
|
|
|
|
#include <athena/FileWriter.hpp>
|
|
|
|
|
|
|
|
namespace hecl {
|
|
|
|
class ProjectPath;
|
|
|
|
}
|
2016-02-02 04:29:58 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec::DNAParticle {
|
2020-03-29 06:56:54 +00:00
|
|
|
|
2016-03-09 04:49:44 +00:00
|
|
|
template <class IDType>
|
2020-03-29 06:56:54 +00:00
|
|
|
struct _ELSM {
|
|
|
|
static constexpr ParticleType Type = ParticleType::ELSM;
|
|
|
|
|
|
|
|
#define INT_ENTRY(name, identifier) IntElementFactory identifier;
|
|
|
|
#define REAL_ENTRY(name, identifier) RealElementFactory identifier;
|
|
|
|
#define COLOR_ENTRY(name, identifier) ColorElementFactory identifier;
|
|
|
|
#define EMITTER_ENTRY(name, identifier) EmitterElementFactory identifier;
|
|
|
|
#define RES_ENTRY(name, identifier) ChildResourceFactory<IDType> identifier;
|
|
|
|
#define BOOL_ENTRY(name, identifier) bool identifier = false;
|
|
|
|
#include "ELSC.def"
|
|
|
|
|
|
|
|
template<typename _Func>
|
|
|
|
void constexpr Enumerate(_Func f) {
|
|
|
|
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
|
|
|
|
#include "ELSC.def"
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _Func>
|
|
|
|
bool constexpr Lookup(FourCC fcc, _Func f) {
|
|
|
|
switch (fcc.toUint32()) {
|
|
|
|
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
|
|
|
|
#include "ELSC.def"
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
}
|
2016-03-09 04:49:44 +00:00
|
|
|
};
|
2020-03-29 06:56:54 +00:00
|
|
|
template <class IDType>
|
|
|
|
using ELSM = PPImpl<_ELSM<IDType>>;
|
2016-03-09 04:49:44 +00:00
|
|
|
|
|
|
|
template <class IDType>
|
|
|
|
bool ExtractELSM(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
|
|
|
|
|
|
|
|
template <class IDType>
|
|
|
|
bool WriteELSM(const ELSM<IDType>& elsm, const hecl::ProjectPath& outPath);
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace DataSpec::DNAParticle
|