NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_resanmclr.h
1#ifndef NW4R_G3D_RES_RES_ANM_CLR_H
2#define NW4R_G3D_RES_RES_ANM_CLR_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/res/g3d_resanm.h>
6#include <nw4r/g3d/res/g3d_rescommon.h>
7#include <nw4r/g3d/res/g3d_resdict.h>
8
9namespace nw4r {
10namespace g3d {
11
12/******************************************************************************
13 *
14 * ClrAnmResult
15 *
16 ******************************************************************************/
18 enum ColorAnim {
19 CLA_CLR0,
20 CLA_CLR1,
21 CLA_AMB0,
22 CLA_AMB1,
23
24 CLA_TEV0,
25 CLA_TEV1,
26 CLA_TEV2,
27
28 CLA_TEVK0,
29 CLA_TEVK1,
30 CLA_TEVK2,
31 CLA_TEVK3,
32
33 CLA_MAX
34 };
35
36 ulong bRgbaExist; // at 0x0
37 ulong rgba[CLA_MAX]; // at 0x4
38 ulong rgbaMask[CLA_MAX]; // at 0x30
39};
40
41/******************************************************************************
42 *
43 * ResAnmClr
44 *
45 ******************************************************************************/
47 ulong mask; // at 0x0
48 ResColorAnmData color; // at 0x4
49};
50
52 enum Flag {
53 FLAG_ANM_EXISTS = (1 << 0),
54 FLAG_ANM_CONSTANT = (1 << 1),
55
56 // Two bits in 'flags' for each animation
57 NUM_OF_FLAGS = 2
58 };
59
60 s32 name; // at 0x0
61 ulong flags; // at 0x4
62 ResAnmClrAnmData anms[1]; // at 0x8
63};
64
66 u16 numFrame; // at 0x0
67 u16 numMaterial; // at 0x2
68 AnmPolicy policy; // at 0x4
69};
70
72 ResBlockHeaderData header; // at 0x0
73 ulong revision; // at 0x8
74 s32 toResFileData; // at 0xC
75 s32 toClrDataDic; // at 0x10
76 s32 toResUserData; // at 0x14
77 s32 name; // at 0x18
78 s32 original_path; // at 0x1C
79 ResAnmClrInfoData info; // at 0x20
80};
81
82class ResAnmClr : public ResCommon<ResAnmClrData> {
83public:
84 static const ulong SIGNATURE = 'CLR0';
85 static const int REVISION = 3;
86
87public:
88 NW4R_G3D_RESOURCE_FUNC_DEF(ResAnmClr);
89
90 ulong GetRevision() const {
91 return ref().revision;
92 }
93
94 bool CheckRevision() const {
95 return GetRevision() == REVISION;
96 }
97
98 void GetAnmResult(ClrAnmResult* pResult, ulong idx, f32 frame) const;
99
100 const ResAnmClrMatData* GetMatAnm(int idx) const {
101 return static_cast<ResAnmClrMatData*>(
102 ofs_to_obj<ResDic>(ref().toClrDataDic)[idx]);
103 }
104 const ResAnmClrMatData* GetMatAnm(ulong idx) const {
105 return static_cast<ResAnmClrMatData*>(
106 ofs_to_obj<ResDic>(ref().toClrDataDic)[idx]);
107 }
108
109 int GetNumFrame() const {
110 return ref().info.numFrame;
111 }
112
113 int GetNumMaterial() const {
114 return ref().info.numMaterial;
115 }
116
117 AnmPolicy GetAnmPolicy() const {
118 return ref().info.policy;
119 }
120};
121
122} // namespace g3d
123} // namespace nw4r
124
125#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10