#pragma once #include "DataSpec/DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" #include #include "athena/DNAOp.hpp" namespace DataSpec::DNAMP1 { struct FRME : BigDNA { AT_DECL_EXPLICIT_DNA Value version; Value unk1; Value modelCount; // Matches MODL widgets Value unk3; Value widgetCount; struct Widget : BigDNA { AT_DECL_EXPLICIT_DNA FRME* owner; DNAFourCC type; struct WidgetHeader : BigDNA { AT_DECL_DNA String<-1> name; String<-1> parent; Value useAnimController; Value defaultVisible; Value defaultActive; Value cullFaces; Value color; Value modelDrawFlags; } header; struct IWidgetInfo : BigDNAV { Delete _dBase; virtual FourCC fourcc() const = 0; }; std::unique_ptr widgetInfo; Value isWorker; Value workerId = 0; Value origin; Value basis[3]; Value rotationCenter; Value unk1; Value unk2; struct BWIGInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::BWIG"; } FourCC fourcc() const override { return FOURCC('BWIG'); } }; struct HWIGInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::HWIG"; } FourCC fourcc() const override { return FOURCC('HWIG'); } }; struct CAMRInfo : IWidgetInfo { AT_DECL_EXPLICIT_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::CAMR"; } enum class ProjectionType { Perspective, Orthographic }; Value projectionType; struct IProjection : BigDNAV { Delete _d; const ProjectionType type; IProjection(ProjectionType t) : type(t) {} }; struct PerspectiveProjection : IProjection { AT_DECL_DNAV PerspectiveProjection() : IProjection(ProjectionType::Perspective) {} Value fov; Value aspect; Value znear; Value zfar; }; struct OrthographicProjection : IProjection { AT_DECL_DNAV OrthographicProjection() : IProjection(ProjectionType::Orthographic) {} Value left; Value right; Value top; Value bottom; Value znear; Value zfar; }; std::unique_ptr projection; FourCC fourcc() const override { return FOURCC('CAMR'); } }; struct MODLInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::MODL"; } UniqueID32 model; enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive }; Value blendMode; Value lightMask; FourCC fourcc() const override { return FOURCC('MODL'); } }; struct LITEInfo : IWidgetInfo { AT_DECL_EXPLICIT_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::LITE"; } enum class ELightType : atUint32 { Spot = 0, Point = 1, Directional = 2, LocalAmbient = 3, Custom = 4, }; Value type; Value distC; Value distL; Value distQ; Value angC; Value angL; Value angQ; Value loadedIdx; Value cutoff; /* Spot only */ FourCC fourcc() const override { return FOURCC('LITE'); } }; struct ENRGInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::ENRG"; } UniqueID32 texture; FourCC fourcc() const override { return FOURCC('ENRG'); } }; struct METRInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::METR"; } Value unk1; Value noRoundUp; Value maxCapacity; Value workerCount; FourCC fourcc() const override { return FOURCC('METR'); } }; struct GRUPInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::GRUP"; } Value defaultWorker; Value unk3; FourCC fourcc() const override { return FOURCC('GRUP'); } }; struct TBGPInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::TBGP"; } Value elementCount; Value unk2; Value unkEnum; Value defaultSelection; Value un4; Value selectWraparound; Value unk6; Value unkFloat1; Value unkFloat2; Value unk7; Value unkFloat3; Value unk8; Value unk9; Value unk10; Value unk11; FourCC fourcc() const override { return FOURCC('TBGP'); } }; struct SLGPInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::SLGP"; } Value min; Value max; Value cur; Value increment; FourCC fourcc() const override { return FOURCC('SLGP'); } }; struct PANEInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::PANE"; } Value xDim; Value zDim; Value scaleCenter; FourCC fourcc() const override { return FOURCC('PANE'); } }; struct TXPNInfo : IWidgetInfo { const char* DNATypeV() const override { return "FRME::TXPN"; } enum class Justification : atUint32 { Left = 0, Center, Right, Full, NLeft, NCenter, NRight, LeftMono, CenterMono, RightMono }; enum class VerticalJustification : atUint32 { Top = 0, Center, Bottom, Full, NTop, NCenter, NBottom, LeftMono, CenterMono, RightMono }; AT_DECL_EXPLICIT_DNAV_NO_TYPE atUint32 version = 0; TXPNInfo() {} TXPNInfo(atUint32 version) : version(version) {} Value xDim; Value zDim; Value scaleCenter; UniqueID32 font; Value wordWrap; Value horizontal; Value justification; Value verticalJustification; Value fillColor; Value outlineColor; Value blockExtent; /* In points; converted to int by loader */ /* The following is only found in V1 */ UniqueID32 jpnFont; Value jpnPointScale[2] = {}; FourCC fourcc() const override { return FOURCC('TXPN'); } }; struct IMGPInfo : IWidgetInfo { AT_DECL_DNAV_NO_TYPE const char* DNATypeV() const override { return "FRME::IMGP"; } UniqueID32 texture; Value unk1; Value unk2; Value quadCoordCount; Vector quadCoords; Value uvCoordCount; Vector uvCoords; FourCC fourcc() const override { return FOURCC('IMGP'); } }; }; Vector widgets; static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok, std::function fileChanged); }; } // namespace DataSpec::DNAMP1