2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-03-29 00:07:38 +00:00
|
|
|
|
2019-08-23 23:24:04 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
|
|
|
#include "DataSpec/DNACommon/ParticleCommon.hpp"
|
|
|
|
|
|
|
|
#include <athena/FileWriter.hpp>
|
|
|
|
|
|
|
|
namespace DataSpec {
|
|
|
|
class PAKEntryReadStream;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace hecl {
|
|
|
|
class ProjectPath;
|
|
|
|
}
|
2016-03-29 00:07:38 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec::DNAParticle {
|
2016-03-29 00:07:38 +00:00
|
|
|
|
|
|
|
template <class IDType>
|
2020-03-29 06:56:54 +00:00
|
|
|
struct _DPSM {
|
|
|
|
static constexpr ParticleType Type = ParticleType::DPSM;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
|
|
|
struct SQuadDescr {
|
|
|
|
IntElementFactory x0_LFT;
|
|
|
|
RealElementFactory x4_SZE;
|
|
|
|
RealElementFactory x8_ROT;
|
|
|
|
VectorElementFactory xc_OFF;
|
|
|
|
ColorElementFactory x10_CLR;
|
|
|
|
UVElementFactory<IDType> x14_TEX;
|
2020-03-29 06:56:54 +00:00
|
|
|
bool x18_ADD = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
SQuadDescr x0_quad;
|
|
|
|
SQuadDescr x1c_quad;
|
|
|
|
ChildResourceFactory<IDType> x38_DMDL;
|
|
|
|
IntElementFactory x48_DLFT;
|
|
|
|
VectorElementFactory x4c_DMOP;
|
|
|
|
VectorElementFactory x50_DMRT;
|
|
|
|
VectorElementFactory x54_DMSC;
|
|
|
|
ColorElementFactory x58_DMCL;
|
|
|
|
|
2020-03-29 06:56:54 +00:00
|
|
|
bool x5c_24_DMAB = false;
|
|
|
|
bool x5c_25_DMOO = false;
|
|
|
|
|
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);
|
|
|
|
#include "DPSC.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 "DPSC.def"
|
2021-06-07 19:29:18 +00:00
|
|
|
default:
|
|
|
|
return false;
|
2020-03-29 06:56:54 +00:00
|
|
|
}
|
|
|
|
}
|
2016-03-29 00:07:38 +00:00
|
|
|
};
|
2020-03-29 06:56:54 +00:00
|
|
|
template <class IDType>
|
|
|
|
using DPSM = PPImpl<_DPSM<IDType>>;
|
2016-03-29 00:07:38 +00:00
|
|
|
|
|
|
|
template <class IDType>
|
|
|
|
bool ExtractDPSM(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
|
|
|
|
|
|
|
|
template <class IDType>
|
|
|
|
bool WriteDPSM(const DPSM<IDType>& dpsm, const hecl::ProjectPath& outPath);
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace DataSpec::DNAParticle
|