NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_resvtx.h
1#ifndef NW4R_G3D_RES_RES_VTX_H
2#define NW4R_G3D_RES_RES_VTX_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/res/g3d_rescommon.h>
6
7#include <nw4r/math.h>
8
9#include <revolution/GX.h>
10
11namespace nw4r {
12namespace g3d {
13
14/******************************************************************************
15 *
16 * ResVtxPos
17 *
18 ******************************************************************************/
20 ulong size; // at 0x0
21 s32 toResMdlData; // at 0x4
22 s32 toVtxPosArray; // at 0x8
23 s32 name; // at 0xC
24 ulong id; // at 0x10
25 GXCompCnt cmpcnt; // at 0x14
26 GXCompType tp; // at 0x18
27 u8 frac; // at 0x1C
28 u8 stride; // at 0x1D
29 u16 numPos; // at 0x1E
30 math::_VEC3 min; // at 0x20
31 math::_VEC3 max; // at 0x2C
32};
33
34class ResVtxPos : public ResCommon<ResVtxPosData> {
35public:
36 NW4R_G3D_RESOURCE_FUNC_DEF(ResVtxPos);
37
38 void Init() {
39 DCStore(false);
40 }
41
42 void SetArray();
43 void GetArray(const void** ppBase, u8* pStride) const;
44
45 void CopyTo(void* pDst) const;
46 void DCStore(bool sync);
47
48 ulong GetSize() const {
49 return ref().size;
50 }
51
52 void* GetData() {
53 return ofs_to_ptr<void>(ref().toVtxPosArray);
54 }
55 const void* GetData() const {
56 return ofs_to_ptr<void>(ref().toVtxPosArray);
57 }
58
59 ulong GetID() const {
60 return ref().id;
61 }
62
63 u16 GetNumVtxPos() const {
64 return ref().numPos;
65 }
66};
67
68/******************************************************************************
69 *
70 * ResVtxNrm
71 *
72 ******************************************************************************/
74 ulong size; // at 0x0
75 s32 toResMdlData; // at 0x4
76 s32 toVtxNrmArray; // at 0x8
77 s32 name; // at 0xC
78 ulong id; // at 0x10
79 GXCompCnt cmpcnt; // at 0x14
80 GXCompType tp; // at 0x18
81 u8 frac; // at 0x1C
82 u8 stride; // at 0x1D
83 u16 numNrm; // at 0x1E
84};
85
86class ResVtxNrm : public ResCommon<ResVtxNrmData> {
87public:
88 NW4R_G3D_RESOURCE_FUNC_DEF(ResVtxNrm);
89
90 void Init() {
91 DCStore(false);
92 }
93
94 void SetArray();
95 void GetArray(const void** ppBase, u8* pStride) const;
96
97 void CopyTo(void* pDst) const;
98 void DCStore(bool);
99
100 ulong GetSize() const {
101 return ref().size;
102 }
103
104 void* GetData() {
105 return ofs_to_ptr<void>(ref().toVtxNrmArray);
106 }
107 const void* GetData() const {
108 return ofs_to_ptr<void>(ref().toVtxNrmArray);
109 }
110
111 ulong GetID() const {
112 return ref().id;
113 }
114
115 u16 GetNumVtxNrm() const {
116 return ref().numNrm;
117 }
118};
119
120/******************************************************************************
121 *
122 * ResVtxClr
123 *
124 ******************************************************************************/
126 ulong size; // at 0x0
127 s32 toResMdlData; // at 0x4
128 s32 toVtxClrArray; // at 0x8
129 s32 name; // at 0xC
130 ulong id; // at 0x10
131 GXCompCnt cmpcnt; // at 0x14
132 GXCompType tp; // at 0x18
133 u8 stride; // at 0x1C
134 u8 PADDING_0x1D; // at 0x1D
135 u16 numClr; // at 0x1E
136};
137
138class ResVtxClr : public ResCommon<ResVtxClrData> {
139public:
140 NW4R_G3D_RESOURCE_FUNC_DEF(ResVtxClr);
141
142 void Init() {
143 DCStore(false);
144 }
145
146 void SetArray(GXAttr attr);
147 void GetArray(const void** ppBase, u8* pStride) const;
148
149 void CopyTo(void* pDst) const;
150 void DCStore(bool sync);
151
152 ulong GetSize() const {
153 return ref().size;
154 }
155
156 void* GetData() {
157 return ofs_to_ptr<void>(ref().toVtxClrArray);
158 }
159 const void* GetData() const {
160 return ofs_to_ptr<void>(ref().toVtxClrArray);
161 }
162
163 ulong GetID() const {
164 return ref().id;
165 }
166
167 u16 GetNumVtxClr() const {
168 return ref().numClr;
169 }
170};
171
172/******************************************************************************
173 *
174 * ResVtxTexCoord
175 *
176 ******************************************************************************/
178 ulong size; // at 0x0
179 s32 toResMdlData; // at 0x4
180 s32 toTexCoordArray; // at 0x8
181 s32 name; // at 0xC
182 ulong id; // at 0x10
183 GXCompCnt cmpcnt; // at 0x14
184 GXCompType tp; // at 0x18
185 u8 frac; // at 0x1C
186 u8 stride; // at 0x1D
187 u16 numTexCoord; // at 0x1E
188 math::_VEC2 min; // at 0x20
189 math::_VEC2 max; // at 0x2C
190};
191
192class ResVtxTexCoord : public ResCommon<ResVtxTexCoordData> {
193public:
194 NW4R_G3D_RESOURCE_FUNC_DEF(ResVtxTexCoord);
195
196 void Init() {
197 DCStore(false);
198 }
199
200 void GetArray(const void** ppBase, u8* pStride) const;
201 void DCStore(bool sync);
202
203 ulong GetSize() const {
204 return ref().size;
205 }
206
207 void* GetData() {
208 return ofs_to_ptr<void>(ref().toTexCoordArray);
209 }
210 const void* GetData() const {
211 return ofs_to_ptr<void>(ref().toTexCoordArray);
212 }
213
214 ulong GetID() const {
215 return ref().id;
216 }
217
218 u16 GetNumTexCoord() const {
219 return ref().numTexCoord;
220 }
221};
222
223} // namespace g3d
224} // namespace nw4r
225
226#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10