#ifndef _DNAMP1_FRME_HPP_ #define _DNAMP1_FRME_HPP_ #include "../DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" #include namespace DataSpec { namespace DNAMP1 { struct FRME : BigDNA { DECL_EXPLICIT_DNA Value version; Value unk1; Value modelCount; // Matches MODL widgets Value unk3; Value widgetCount; struct Widget : BigDNA { DECL_EXPLICIT_DNA FRME* owner; DNAFourCC type; struct WidgetHeader : BigDNA { DECL_DNA String<-1> name; String<-1> parent; Value useAnimController; Value defaultVisible; Value defaultActive; Value cullFaces; Value color; Value modelDrawFlags; } header; struct IWidgetInfo : BigDNA { Delete _d; virtual void read(athena::io::IStreamReader&) {} void write(athena::io::IStreamWriter&) const {} size_t binarySize(size_t __isz) const { return __isz; } 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 { Delete _d; FourCC fourcc() const { return FOURCC('BWIG'); } }; struct HWIGInfo : IWidgetInfo { Delete _d; FourCC fourcc() const { return FOURCC('HWIG'); } }; struct CAMRInfo : IWidgetInfo { DECL_EXPLICIT_DNA enum class ProjectionType { Perspective, Orthographic }; Value projectionType; struct IProjection : BigDNA { Delete _d; const ProjectionType type; IProjection(ProjectionType t) : type(t) {} }; struct PerspectiveProjection : IProjection { DECL_DNA PerspectiveProjection() : IProjection(ProjectionType::Perspective) {} Value fov; Value aspect; Value znear; Value zfar; }; struct OrthographicProjection : IProjection { DECL_DNA OrthographicProjection() : IProjection(ProjectionType::Orthographic) {} Value left; Value right; Value top; Value bottom; Value znear; Value zfar; }; std::unique_ptr projection; FourCC fourcc() const { return FOURCC('CAMR'); } }; struct MODLInfo : IWidgetInfo { DECL_DNA UniqueID32 model; enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive }; Value blendMode; Value lightMask; FourCC fourcc() const { return FOURCC('MODL'); } }; struct LITEInfo : IWidgetInfo { DECL_EXPLICIT_DNA 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 { return FOURCC('LITE'); } }; struct ENRGInfo : IWidgetInfo { DECL_DNA UniqueID32 texture; FourCC fourcc() const { return FOURCC('ENRG'); } }; struct METRInfo : IWidgetInfo { DECL_DNA Value unk1; Value noRoundUp; Value maxCapacity; Value workerCount; FourCC fourcc() const { return FOURCC('METR'); } }; struct GRUPInfo : IWidgetInfo { DECL_DNA Value defaultWorker; Value unk3; FourCC fourcc() const { return FOURCC('GRUP'); } }; struct TBGPInfo : IWidgetInfo { DECL_DNA 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 { return FOURCC('TBGP'); } }; struct SLGPInfo : IWidgetInfo { DECL_DNA Value min; Value max; Value cur; Value increment; FourCC fourcc() const { return FOURCC('SLGP'); } }; struct PANEInfo : IWidgetInfo { DECL_DNA Value xDim; Value zDim; Value scaleCenter; FourCC fourcc() const { return FOURCC('PANE'); } }; struct TXPNInfo : IWidgetInfo { 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 }; DECL_EXPLICIT_DNA atUint32 version = 0; TXPNInfo() {} TXPNInfo(atUint32 version) : version(version) {} Value xDim; Value zDim; Value scaleCenter; UniqueID32 font; Value wordWrap; Value vertical; 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 { return FOURCC('TXPN'); } }; struct IMGPInfo : IWidgetInfo { DECL_DNA UniqueID32 texture; Value unk1; Value unk2; Value quadCoordCount; Vector quadCoords; Value uvCoordCount; Vector uvCoords; FourCC fourcc() const { 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::BlenderToken& btok, std::function fileChanged); }; } } #endif // _DNAMP1_FRME_HPP_