NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_anmvis.h
1#ifndef NW4R_G3D_ANM_VIS_H
2#define NW4R_G3D_ANM_VIS_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/g3d_anmobj.h>
6#include <nw4r/g3d/res/g3d_resanmvis.h>
7
8namespace nw4r {
9namespace g3d {
10
11// Forward declarations
12class AnmObjVisRes;
13class AnmObjVis;
14class ResMdl;
15
16void ApplyVisAnmResult(ResMdl mdl, AnmObjVis* pObj);
17void ApplyVisAnmResult(u8* pByteVec, ResMdl mdl, AnmObjVis* pObj);
18
19/******************************************************************************
20 *
21 * AnmObjVis
22 *
23 ******************************************************************************/
24class AnmObjVis : public AnmObj {
25public:
26 AnmObjVis(MEMAllocator* pAllocator, u16* pBindingBuf, int numBinding);
27 virtual void G3dProc(ulong task, ulong param, void* pInfo); // at 0xC
28 virtual ~AnmObjVis() {} // at 0x10
29
30 virtual void SetFrame(f32 frame) = 0; // at 0x1C
31 virtual f32 GetFrame() const = 0; // at 0x20
32 virtual void UpdateFrame() = 0; // at 0x24
33
34 virtual void SetUpdateRate(f32 rate) = 0; // at 0x28
35 virtual f32 GetUpdateRate() const = 0; // at 0x2C
36
37 virtual bool Bind(const ResMdl mdl) = 0; // at 0x30
38 virtual void Release(); // at 0x34
39
40 virtual bool GetResult(ulong idx) = 0; // at 0x38
41
42 virtual AnmObjVisRes* Attach(int idx, AnmObjVisRes* pRes); // at 0x3C
43 virtual AnmObjVisRes* Detach(int idx); // at 0x40
44 void DetachAll();
45
46 bool TestExistence(ulong idx) const;
47 bool TestDefined(ulong idx) const;
48
49protected:
50 enum BindingFlag {
51 BINDING_ID_MASK = (1 << 14) - 1,
52 BINDING_INVALID = (1 << 14),
53 BINDING_UNDEFINED = (1 << 15),
54 };
55
56protected:
57 static const int MAX_CHILD = 4;
58
59protected:
60 int mNumBinding; // at 0x10
61 u16* const mpBinding; // at 0x14
62
63 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjVis, AnmObj);
64};
65
66/******************************************************************************
67 *
68 * AnmObjVisNode
69 *
70 ******************************************************************************/
71class AnmObjVisNode : public AnmObjVis {
72public:
73 AnmObjVisNode(MEMAllocator* pAllocator, u16* pBindingBuf, int numBinding);
74 virtual void G3dProc(ulong task, ulong param, void* pInfo); // at 0xC
75 virtual ~AnmObjVisNode(); // at 0x10
76
77 virtual void SetFrame(f32 frame); // at 0x1C
78 virtual f32 GetFrame() const; // at 0x20
79 virtual void UpdateFrame(); // at 0x24
80
81 virtual void SetUpdateRate(f32 rate); // at 0x28
82 virtual f32 GetUpdateRate() const; // at 0x2C
83
84 virtual bool Bind(const ResMdl mdl); // at 0x30
85 virtual void Release(); // at 0x34
86
87 virtual bool GetResult(ulong idx) = 0; // at 0x38
88
89 virtual AnmObjVisRes* Attach(int idx, AnmObjVisRes* pRes); // at 0x3C
90 virtual AnmObjVisRes* Detach(int idx); // at 0x40
91
92protected:
93 AnmObjVisRes* mpChildren[MAX_CHILD]; // at 0x18
94
95 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjVisNode, AnmObjVis);
96};
97
98/******************************************************************************
99 *
100 * AnmObjVisOR
101 *
102 ******************************************************************************/
103class AnmObjVisOR : public AnmObjVisNode {
104public:
105 static AnmObjVisOR* Construct(MEMAllocator* pAllocator, ulong* pSize,
106 ResMdl mdl);
107
108 AnmObjVisOR(MEMAllocator* pAllocator, u16* pBindingBuf, int numBinding)
109 : AnmObjVisNode(pAllocator, pBindingBuf, numBinding) {}
110
111 virtual ~AnmObjVisOR() {} // at 0x10
112
113 virtual bool GetResult(ulong idx); // at 0x38
114
115 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjVisOR, AnmObjVisNode);
116};
117
118/******************************************************************************
119 *
120 * AnmObjVisRes
121 *
122 ******************************************************************************/
123class AnmObjVisRes : public AnmObjVis, protected FrameCtrl {
124public:
125 static AnmObjVisRes* Construct(MEMAllocator* pAllocator, size_t* pSize,
126 ResAnmVis vis, ResMdl mdl);
127
128 AnmObjVisRes(MEMAllocator* pAllocator, ResAnmVis vis, u16* pBindingBuf,
129 int numBinding);
130 virtual ~AnmObjVisRes() {} // at 0x10
131
132 virtual void SetFrame(f32 frame); // at 0x1C
133 virtual f32 GetFrame() const; // at 0x20
134 virtual void UpdateFrame(); // at 0x24
135
136 virtual void SetUpdateRate(f32 rate); // at 0x28
137 virtual f32 GetUpdateRate() const; // at 0x2C
138
139 virtual bool Bind(const ResMdl mdl); // at 0x30
140
141 virtual bool GetResult(ulong idx); // at 0x38
142
143 ResAnmVis GetResAnm() {
144 return mRes;
145 }
146
147 void SetPlayPolicy(PlayPolicyFunc pFunc) {
148 FrameCtrl::SetPlayPolicy(pFunc);
149 }
150
151private:
152 ResAnmVis mRes; // at 0x2C
153
154 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjVisRes, AnmObjVis);
155};
156
157} // namespace g3d
158} // namespace nw4r
159
160#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10