summaryrefslogtreecommitdiff
path: root/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h
blob: 59375ef26d7330fdb3dff0b15f224aed781bdcf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#ifndef J3DMATERIALANM_H
#define J3DMATERIALANM_H

#include "JSystem/J3DGraphAnimator/J3DAnimation.h"

typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DMatColorAnm {
public:
    /* 8003B2B8 */ ~J3DMatColorAnm() {};
    /* 8003B2F4 */ J3DMatColorAnm() : field_0x0(0), mAnmFlag(1), mAnmColor(NULL) {};
    J3DMatColorAnm(u16 param_1, J3DAnmColor* param_2) {
        field_0x0 = param_1;
        mAnmFlag = 1;
        mAnmColor = param_2;
    }

    void operator=(J3DMatColorAnm const& other) {
        mAnmColor = other.mAnmColor;
        field_0x0 = other.field_0x0;
        mAnmFlag = other.mAnmFlag;
    }

    void setAnmFlag(bool flag) { mAnmFlag = flag; }
    bool getAnmFlag() const { return mAnmFlag; }
    void calc(_GXColor* pColor) const { mAnmColor->getColor(field_0x0, pColor); }

private:
    /* 0x0 */ u16 field_0x0;
    /* 0x2 */ u16 mAnmFlag;
    /* 0x4 */ J3DAnmColor* mAnmColor;
};  // Size: 0x8

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DTexNoAnm {
public:
    /* 8003B1F8 */ ~J3DTexNoAnm() {};
    /* 8003B240 */ J3DTexNoAnm() : field_0x4(0), mAnmFlag(1), mAnmTexPattern(NULL) {};
    J3DTexNoAnm(u16 param_1, J3DAnmTexPattern* param_2) {
        field_0x4 = param_1;
        mAnmFlag = 1;
        mAnmTexPattern = param_2;
    }
    /* 8003C82C */ virtual void calc(u16* param_0) const { mAnmTexPattern->getTexNo(field_0x4, param_0); }

    void operator=(J3DTexNoAnm const& other) {
        mAnmTexPattern = other.mAnmTexPattern;
        field_0x4 = other.field_0x4;
        mAnmFlag = other.mAnmFlag;
    }

    void setAnmFlag(bool flag) { mAnmFlag = flag; }
    bool getAnmFlag() const { return mAnmFlag; }
    J3DAnmTexPattern* getAnmTexPattern() { return mAnmTexPattern; }

private:
    /* 0x4 */ u16 field_0x4;
    /* 0x6 */ u16 mAnmFlag;
    /* 0x8 */ J3DAnmTexPattern* mAnmTexPattern;
};  // Size: 0xC

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DTexMtxAnm {
public:
    /* 8003B264 */ ~J3DTexMtxAnm() {};
    /* 8003B2A0 */ J3DTexMtxAnm() : field_0x0(0), mAnmFlag(1), mAnmTransform(NULL) {};
    J3DTexMtxAnm(u16 param_1, J3DAnmTextureSRTKey* param_2) {
        field_0x0 = param_1;
        mAnmFlag = 1;
        mAnmTransform = param_2;
    }

    void operator=(J3DTexMtxAnm const& other) {
        mAnmTransform = other.mAnmTransform;
        field_0x0 = other.field_0x0;
        mAnmFlag = other.mAnmFlag;
    }

    void setAnmFlag(bool flag) { mAnmFlag = flag; }
    void calc(J3DTextureSRTInfo* pSRTInfo) const {
        mAnmTransform->getTransform(field_0x0, pSRTInfo);
    }
    bool getAnmFlag() const { return mAnmFlag; }

private:
    /* 0x0 */ u16 field_0x0;
    /* 0x2 */ u16 mAnmFlag;
    /* 0x4 */ J3DAnmTextureSRTKey* mAnmTransform;
};  // Size: 0x8

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DTevKColorAnm {
public:
    /* 8003B150 */ ~J3DTevKColorAnm() {}
    /* 8003B18C */ J3DTevKColorAnm() : field_0x0(0), mAnmFlag(1), mAnmTevReg(NULL) {}
    J3DTevKColorAnm(u16 param_1, J3DAnmTevRegKey* param_2) {
        field_0x0 = param_1;
        mAnmFlag = 1;
        mAnmTevReg = param_2;
    }

    void operator=(J3DTevKColorAnm const& other) {
        mAnmTevReg = other.mAnmTevReg;
        field_0x0 = other.field_0x0;
        mAnmFlag = other.mAnmFlag;
    }

    void setAnmFlag(bool flag) { mAnmFlag = flag; }
    bool getAnmFlag() const { return mAnmFlag; }
    void calc(_GXColor* pColor) const { mAnmTevReg->getTevKonstReg(field_0x0, pColor); }

private:
    /* 0x0 */ u16 field_0x0;
    /* 0x2 */ u16 mAnmFlag;
    /* 0x4 */ J3DAnmTevRegKey* mAnmTevReg;
};  // Size: 0x8

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DTevColorAnm {
public:
    /* 8003B1A4 */ ~J3DTevColorAnm() {}
    /* 8003B1E0 */ J3DTevColorAnm() : field_0x0(0), mAnmFlag(1), mAnmTevReg(NULL) {}
    J3DTevColorAnm(u16 param_1, J3DAnmTevRegKey* param_2) {
        field_0x0 = param_1;
        mAnmFlag = 1;
        mAnmTevReg = param_2;
    }

    void operator=(J3DTevColorAnm const& other) {
        mAnmTevReg = other.mAnmTevReg;
        field_0x0 = other.field_0x0;
        mAnmFlag = other.mAnmFlag;
    }

    void setAnmFlag(bool flag) { mAnmFlag = flag; }
    bool getAnmFlag() const { return mAnmFlag; }
    void calc(_GXColorS10* pColor) const { mAnmTevReg->getTevColorReg(field_0x0, pColor); }

private:
    /* 0x0 */ u16 field_0x0;
    /* 0x2 */ u16 mAnmFlag;
    /* 0x4 */ J3DAnmTevRegKey* mAnmTevReg;
};  // Size: 0x8

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DMaterialAnm {
public:
    J3DMaterialAnm() { initialize(); }

    /* 8032C320 */ void initialize();
    /* 8032C5A4 */ void setMatColorAnm(int, J3DMatColorAnm*);
    /* 8032C5E4 */ void setTexMtxAnm(int, J3DTexMtxAnm*);
    /* 8032C624 */ void setTexNoAnm(int, J3DTexNoAnm*);
    /* 8032C664 */ void setTevColorAnm(int, J3DTevColorAnm*);
    /* 8032C6A4 */ void setTevKColorAnm(int, J3DTevKColorAnm*);

    /* 800A4820 */ virtual ~J3DMaterialAnm() {};
    /* 8032C3C4 */ virtual void calc(J3DMaterial*) const;

    const J3DTexMtxAnm& getTexMtxAnm(int i) const { return mTexMtxAnm[i]; }

private:
    /* 0x04 */ J3DMatColorAnm mMatColorAnm[2];
    /* 0x14 */ J3DTexMtxAnm mTexMtxAnm[8];
    /* 0x54 */ J3DTexNoAnm mTexNoAnm[8];
    /* 0xB4 */ J3DTevColorAnm mTevColorAnm[4];
    /* 0xD4 */ J3DTevKColorAnm mTevKColorAnm[4];
};  // Size: 0xF4

#endif /* J3DMATERIALANM_H */