#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; } }; std::unique_ptr widgetInfo; Value isWorker; Value workerId; Value origin; Value basis[3]; Value rotationCenter; Value msgCount; Value funcDefCount; Value animControllerCount; struct BWIGInfo : IWidgetInfo { Delete _d; }; struct HWIGInfo : IWidgetInfo { Delete _d; }; 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; }; struct MODLInfo : IWidgetInfo { DECL_DNA UniqueID32 model; enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive }; Value blendMode; Value lightMask; }; 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 */ }; struct ENRGInfo : IWidgetInfo { DECL_DNA UniqueID32 texture; }; struct METRInfo : IWidgetInfo { DECL_DNA Value unk1; Value value1; Value value2; }; struct GRUPInfo : IWidgetInfo { DECL_DNA Value defaultWorker; Value unk3; }; struct TBGPInfo : IWidgetInfo { DECL_DNA Value unk1; Value unk2; Value unkEnum; Value unk3; Value un4; Value unk5; Value unk6; Value unkFloat1; Value unkFloat2; Value unk7; Value unkFloat3; Value unk8; Value unk9; Value unk10; Value unk11; }; struct SLGPInfo : IWidgetInfo { DECL_DNA Value min; Value max; Value cur; Value increment; }; struct TXPNInfo : IWidgetInfo { enum class Justification : atUint32 { Left = 0, Center, Right, Full, NLeft, NCenter, NRight, Seven, Eight, Nine }; enum class VerticalJustification : atUint32 { Top = 0, Center, Bottom, Full, NTop, NCenter, NBottom, Seven, Eight, Nine }; 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]; }; struct IMGPInfo : IWidgetInfo { DECL_DNA UniqueID32 texture; Value unk1; Value unk2; Value quadCoordCount; Vector quadCoords; Value uvCoordCount; Vector uvCoords; }; }; Vector widgets; static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, std::function fileChanged); }; } } #endif // _DNAMP1_FRME_HPP_