#pragma once #include #include #include #include "DataSpec/DNACommon/DNACommon.hpp" #include "DataSpec/DNACommon/ParticleCommon.hpp" #include namespace DataSpec { class PAKEntryReadStream; } namespace hecl { class ProjectPath; } namespace DataSpec::DNAParticle { template struct _CRSM { static constexpr ParticleType Type = ParticleType::CRSM; #define RES_ENTRY(name, identifier) ChildResourceFactory identifier; #define U32_ENTRY(name, identifier) uint32_t identifier = ~0; #define FLOAT_ENTRY(name, identifier) float identifier = 0.f; #include "CRSC.def" template void constexpr Enumerate(_Func f) { #define ENTRY(name, identifier) f(FOURCC(name), identifier); #include "CRSC.def" } template bool constexpr Lookup(FourCC fcc, _Func f) { switch (fcc.toUint32()) { #define ENTRY(name, identifier) case SBIG(name): f(identifier); return true; #include "CRSC.def" default: return false; } } }; template using CRSM = PPImpl<_CRSM>; template bool ExtractCRSM(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); template bool WriteCRSM(const CRSM& crsm, const hecl::ProjectPath& outPath); } // namespace DataSpec::DNAParticle