lyt_window templated

This commit is contained in:
elijah-thomas774
2024-05-27 17:22:36 -04:00
parent 484d0be7ea
commit 5829b09fbb
7 changed files with 307 additions and 26 deletions
+2 -2
View File
@@ -107,8 +107,8 @@ public:
virtual ~Pane(); // at 0x8
NW4R_UT_RTTI_DECL(Pane); // at 0x0C
virtual void CalculateMtx(const DrawInfo &drawInfo); // at 0x10
virtual void Draw(const DrawInfo &); // at 0x14
virtual void DrawSelf(const DrawInfo &); // at 0x18
virtual void Draw(const DrawInfo &drawInfo); // at 0x14
virtual void DrawSelf(const DrawInfo &drawInfo); // at 0x18
virtual void Animate(u32); // at 0x1C
virtual void AnimateSelf(u32); // at 0x20
virtual ut::Color GetVtxColor(u32 idx) const; // at 0x24
+13
View File
@@ -155,6 +155,19 @@ struct Window : Pane {
u32 frameOffsetTableOffset; // at 0x64
};
struct WindowFrame {
u16 materialIdx; // at 0x0
u8 textureFlip; // at 0x2
u8 padding1; // at 0x3
};
struct WindowContent {
u32 vtxCols[4]; // at 0x00
u16 materialIdx; // at 0x10
u8 texCoordNum; // at 0x12
u8 padding[1]; // at 0x13
};
struct AnimationBlock {
DataBlockHeader blockHeader; // at 0x00
u16 frameSize; // at 0x08
+43 -14
View File
@@ -10,17 +10,7 @@ namespace nw4r {
namespace lyt {
struct Content {
ut::Color vtxColors[4]; // at 0x00
detail::TexCoordAry texCoordAry; // at 0x10
};
struct Frame {
bool textureFlip; // at 0x00
Material *pMaterial; // at 0x04
};
struct WindowFramSize {
struct WindowFrameSize {
f32 l; // at 0x00
f32 r; // at 0x04
f32 t; // at 0x08
@@ -29,9 +19,48 @@ struct WindowFramSize {
class Window : public Pane {
public:
Window(const res::Window *, const ResBlockSet &ResBlockSet);
virtual ~Window();
NW4R_UT_RTTI_DECL(Window);
struct Content {
Content() {}
ut::Color vtxColors[4]; // at 0x00
detail::TexCoordAry texCoordAry; // at 0x10
};
struct Frame {
bool textureFlip; // at 0x00
Material *pMaterial; // at 0x04
};
Window(const res::Window *pBlock, const ResBlockSet &ResBlockSet);
void InitContent(u8 texNum);
void InitFrame(u8 frameNum);
void ReserveTexCoord(u8 num);
AnimationLink *FindAnimationLink(AnimTransform *pAnimTrans);
void SetAnimationEnable(AnimTransform *pAnimTrans, bool, bool);
static WindowFrameSize GetFrameSize(u8 frameNum, const Frame *frames);
Material *GetFrameMaterial(u32 frameIdx) const;
Material *GetContentMaterial() const;
virtual ~Window(); // at 0x08
NW4R_UT_RTTI_DECL(Window); // at 0x0C
virtual void DrawSelf(const DrawInfo &drawInfo); // at 0x18
virtual void AnimateSelf(u32 option); // at 0x20
virtual ut::Color GetVtxColor(u32 idx) const; // at 0x24
virtual void SetVtxColor(u32 idx, ut::Color value); // at 0x28
virtual u8 GetVtxColorElement(u32 idx) const; // at 0x34
virtual void SetVtxColorElement(u32 idx, u8 value); // at 0x38
virtual Material *FindMaterialByName(const char *findName, bool bRecursive); // at 0x40
virtual void UnbindAnimationSelf(AnimTransform *pAnimTrans); // at 0x50
virtual u8 GetMaterialNum() const; // at 0x64
virtual Material *GetMaterial(u32 idx) const; // at 0x6C
virtual void DrawContent(const math::VEC2 &basePt, const WindowFrameSize &frameSize, u8 alpha); // at 0x74
virtual void DrawFrame(const math::VEC2 &basePt, const Frame &frame, const WindowFrameSize &frameSize, //
u8 alpha); // at 0x78
virtual void DrawFrame4(const math::VEC2 &basePt, const Frame *frame, const WindowFrameSize &frameSize, //
u8 alpha); // at 0x7C
virtual void DrawFrame8(const math::VEC2 &basePt, const Frame *frame, const WindowFrameSize &frameSize, //
u8 alpha); // at 0x80
private:
res::InflationLRTB mContentInflation; // at 0x0D8