Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DMaterialFactory.h
Go to the documentation of this file.
1#ifndef J3DMATERIALFACTORY_H
2#define J3DMATERIALFACTORY_H
3
7
8class J3DMaterial;
9
15 /* 0x000 */ u8 mMaterialMode;
16 /* 0x001 */ u8 mCullModeIdx;
17 /* 0x002 */ u8 mColorChanNumIdx;
18 /* 0x003 */ u8 mTexGenNumIdx;
19 /* 0x004 */ u8 mTevStageNumIdx;
20 /* 0x005 */ u8 mZCompLocIdx;
21 /* 0x006 */ u8 mZModeIdx;
22 /* 0x007 */ u8 mDitherIdx;
23 /* 0x008 */ u16 mMatColorIdx[2];
24 /* 0x00C */ u16 mColorChanIdx[4];
25 /* 0x014 */ u16 mAmbColorIdx[2];
26 /* 0x018 */ u8 field_0x018[0x10];
27 /* 0x028 */ u16 mTexCoordIdx[8];
28 /* 0x038 */ u8 field_0x038[0x10];
29 /* 0x048 */ u16 mTexMtxIdx[8];
30 /* 0x058 */ u8 field_0x058[0x2c];
31 /* 0x084 */ u16 mTexNoIdx[8];
32 /* 0x094 */ u16 mTevKColorIdx[4];
33 /* 0x09C */ u8 mTevKColorSel[0x10];
34 /* 0x0AC */ u8 mTevKAlphaSel[0x10];
35 /* 0x0BC */ u16 mTevOrderIdx[0x10];
36 /* 0x0DC */ u16 mTevColorIdx[4];
37 /* 0x0E4 */ u16 mTevStageIdx[0x10];
38 /* 0x104 */ u16 mTevSwapModeIdx[0x10];
39 /* 0x124 */ u16 mTevSwapModeTableIdx[4];
40 /* 0x12C */ u8 field_0x12c[0x18];
41 /* 0x144 */ u16 mFogIdx;
42 /* 0x146 */ u16 mAlphaCompIdx;
43 /* 0x148 */ u16 mBlendIdx;
44 /* 0x14A */ u16 mNBTScaleIdx;
45}; // size 0x14C
46
52 /* 0x000 */ bool mEnabled;
53 /* 0x001 */ u8 mIndTexStageNum;
54 /* 0x002 */ u8 field_0x002[2];
56 /* 0x010 */ u8 field_0x010[4];
59 /* 0x074 */ u8 field_0x074[4];
61}; // size 0x138
62
70 /* 0x4 */ u16 mTexMtxOffset;
71 /* 0x6 */ u16 mTexNoOffset;
72 /* 0x8 */ u16 mTevRegOffset;
73 /* 0xA */ u16 mFogOffset;
74 /* 0xC */ u8 field_0xc[4];
75}; // size 0x10
76
82 /* 0x0 */ u32 mOffset;
83 /* 0x4 */ u32 field_0x4;
84}; // size 8
85
86struct J3DTexCoord2Info;
88
94public:
100
101 /* 80330234 */ J3DMaterialFactory(J3DMaterialDLBlock const&);
102 /* 8032FFEC */ J3DMaterialFactory(J3DMaterialBlock const&);
103 /* 803302BC */ u16 countUniqueMaterials();
104 /* 80330304 */ u32 countTexGens(int) const;
105 /* 8033033C */ u32 countStages(int) const;
106 /* 803303C4 */ J3DMaterial* create(J3DMaterial*, MaterialType, int, u32) const;
107 /* 80330440 */ J3DMaterial* createNormalMaterial(J3DMaterial*, int, u32) const;
108 /* 80330D84 */ J3DMaterial* createPatchedMaterial(J3DMaterial*, int, u32) const;
109 /* 8033168C */ void modifyPatchedCurrentMtx(J3DMaterial*, int) const;
110 /* 803317D4 */ J3DMaterial* createLockedMaterial(J3DMaterial*, int, u32) const;
111 /* 80331A7C */ u32 calcSize(J3DMaterial*, MaterialType, int, u32) const;
112 /* 80331AFC */ u32 calcSizeNormalMaterial(J3DMaterial*, int, u32) const;
113 /* 80331C30 */ u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
114 /* 80331D00 */ u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
115 /* 80331D18 */ J3DGXColor newMatColor(int, int) const;
116 /* 80331D74 */ u8 newColorChanNum(int) const;
117 /* 80331DAC */ J3DColorChan newColorChan(int, int) const;
118 /* 80331F50 */ J3DGXColor newAmbColor(int, int) const;
119 /* 80331FAC */ u32 newTexGenNum(int) const;
120 /* 80331FE4 */ J3DTexCoord newTexCoord(int, int) const;
121 /* 80332044 */ J3DTexMtx* newTexMtx(int, int) const;
122 /* 803320CC */ u8 newCullMode(int) const;
123 /* 8033210C */ u16 newTexNo(int, int) const;
124 /* 80332154 */ J3DTevOrder newTevOrder(int, int) const;
125 /* 803321A0 */ J3DGXColorS10 newTevColor(int, int) const;
126 /* 80332210 */ J3DGXColor newTevKColor(int, int) const;
127 /* 8033226C */ u8 newTevStageNum(int) const;
128 /* 803322A4 */ J3DTevStage newTevStage(int, int) const;
129 /* 80332304 */ J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
130 /* 803323A0 */ u8 newIndTexStageNum(int) const;
131 /* 803323C8 */ J3DIndTexOrder newIndTexOrder(int, int) const;
132 /* 8033240C */ J3DIndTexMtx newIndTexMtx(int, int) const;
133 /* 803324B4 */ J3DIndTevStage newIndTevStage(int, int) const;
134 /* 80332648 */ J3DIndTexCoordScale newIndTexCoordScale(int, int) const;
135 /* 8033268C */ J3DFog newFog(int) const;
136 /* 80332768 */ J3DAlphaComp newAlphaComp(int) const;
137 /* 803327E8 */ J3DBlend newBlend(int) const;
138 /* 8033282C */ J3DZMode newZMode(int) const;
139 /* 8033288C */ u8 newZCompLoc(int) const;
140 /* 803328C4 */ u8 newDither(int) const;
141 /* 803328FC */ J3DNBTScale newNBTScale(int) const;
142
143 u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
145
146 static int getMdlDataFlag_TevStageNum(u32 flags) { return (flags >> 0x10) & 0x1f; }
147 static int getMdlDataFlag_TexGenFlag(u32 flags) { return flags & 0x0c000000; }
148 static u32 getMdlDataFlag_ColorFlag(u32 flags) { return flags & 0xc0000000; }
149 static u32 getMdlDataFlag_PEFlag(u32 flags) { return flags & 0x30000000; }
150
151 /* 0x00 */ u16 mMaterialNum;
153 /* 0x08 */ u16* mpMaterialID;
155 /* 0x10 */ GXColor* mpMatColor;
156 /* 0x14 */ u8* mpColorChanNum;
158 /* 0x1C */ GXColor* mpAmbColor;
160 /* 0x24 */ u8* mpTexGenNum;
165 /* 0x38 */ u16* mpTexNo;
169 /* 0x48 */ GXColor* mpTevKColor;
170 /* 0x4C */ u8* mpTevStageNum;
178 /* 0x6C */ u8* mpZCompLoc;
179 /* 0x70 */ u8* mpDither;
184 /* 0x84 */ u8* mpMaterialMode;
185};
186
187#endif /* J3DMATERIALFACTORY_H */
enum _GXCullMode GXCullMode
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition J3DShape.h:12
Definition J3DStruct.h:12
Definition J3DMaterialFactory.h:93
J3DMaterial * create(J3DMaterial *, MaterialType, int, u32) const
Definition J3DMaterialFactory.cpp:391
u32 calcSizeNormalMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:693
u8 * mpTexGenNum
Definition J3DMaterialFactory.h:160
u16 getMaterialID(int idx) const
Definition J3DMaterialFactory.h:143
J3DTexMtxInfo * field_0x34
Definition J3DMaterialFactory.h:164
u8 newTevStageNum(int) const
Definition J3DMaterialFactory.cpp:902
J3DZModeInfo * mpZModeInfo
Definition J3DMaterialFactory.h:177
J3DTexCoordInfo * mpTexCoordInfo
Definition J3DMaterialFactory.h:161
J3DPatchingInfo * mpPatchingInfo
Definition J3DMaterialFactory.h:182
J3DTexMtx * newTexMtx(int, int) const
Definition J3DMaterialFactory.cpp:833
u32 countStages(int) const
Definition J3DMaterialFactory.cpp:366
J3DGXColor newTevKColor(int, int) const
Definition J3DMaterialFactory.cpp:891
u8 * mpDither
Definition J3DMaterialFactory.h:179
J3DTevOrder newTevOrder(int, int) const
Definition J3DMaterialFactory.cpp:864
J3DIndTexMtx newIndTexMtx(int, int) const
Definition J3DMaterialFactory.cpp:953
J3DAlphaComp newAlphaComp(int) const
Definition J3DMaterialFactory.cpp:995
J3DIndTexCoordScale newIndTexCoordScale(int, int) const
Definition J3DMaterialFactory.cpp:974
u8 newZCompLoc(int) const
Definition J3DMaterialFactory.cpp:1027
J3DTevSwapModeInfo * mpTevSwapModeInfo
Definition J3DMaterialFactory.h:172
J3DMaterial * createLockedMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:641
u8 * mpZCompLoc
Definition J3DMaterialFactory.h:178
J3DBlendInfo * mpBlendInfo
Definition J3DMaterialFactory.h:176
u8 getMaterialMode(int idx) const
Definition J3DMaterialFactory.h:144
u8 newDither(int) const
Definition J3DMaterialFactory.cpp:1038
J3DFogInfo * mpFogInfo
Definition J3DMaterialFactory.h:174
GXColor * mpAmbColor
Definition J3DMaterialFactory.h:158
GXColor * mpMatColor
Definition J3DMaterialFactory.h:155
u32 calcSizeLockedMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:752
J3DGXColorS10 newTevColor(int, int) const
Definition J3DMaterialFactory.cpp:877
J3DGXColor newMatColor(int, int) const
Definition J3DMaterialFactory.cpp:766
J3DMaterialInitData * mpMaterialInitData
Definition J3DMaterialFactory.h:152
u8 newIndTexStageNum(int) const
Definition J3DMaterialFactory.cpp:934
J3DAlphaCompInfo * mpAlphaCompInfo
Definition J3DMaterialFactory.h:175
u16 mMaterialNum
Definition J3DMaterialFactory.h:151
u16 * mpMaterialID
Definition J3DMaterialFactory.h:153
J3DCurrentMtxInfo * mpCurrentMtxInfo
Definition J3DMaterialFactory.h:183
J3DLightInfo * mpLightInfo
Definition J3DMaterialFactory.h:159
u16 * mpTexNo
Definition J3DMaterialFactory.h:165
J3DFog newFog(int) const
Definition J3DMaterialFactory.cpp:984
J3DIndInitData * mpIndInitData
Definition J3DMaterialFactory.h:154
J3DTevSwapModeTable newTevSwapModeTable(int, int) const
Definition J3DMaterialFactory.cpp:923
J3DMaterial * createPatchedMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:528
u8 newColorChanNum(int) const
Definition J3DMaterialFactory.cpp:777
J3DTevStageInfo * mpTevStageInfo
Definition J3DMaterialFactory.h:171
J3DTevStage newTevStage(int, int) const
Definition J3DMaterialFactory.cpp:912
J3DIndTevStage newIndTevStage(int, int) const
Definition J3DMaterialFactory.cpp:963
static u32 getMdlDataFlag_PEFlag(u32 flags)
Definition J3DMaterialFactory.h:149
u16 countUniqueMaterials()
Definition J3DMaterialFactory.cpp:344
GXColorS10 * mpTevColor
Definition J3DMaterialFactory.h:168
void modifyPatchedCurrentMtx(J3DMaterial *, int) const
Definition J3DMaterialFactory.cpp:619
u8 * mpTevStageNum
Definition J3DMaterialFactory.h:170
u8 * mpColorChanNum
Definition J3DMaterialFactory.h:156
J3DNBTScale newNBTScale(int) const
Definition J3DMaterialFactory.cpp:1048
MaterialType
Definition J3DMaterialFactory.h:95
@ MATERIAL_TYPE_LOCKED
Definition J3DMaterialFactory.h:97
@ MATERIAL_TYPE_PATCHED
Definition J3DMaterialFactory.h:98
@ MATERIAL_TYPE_NORMAL
Definition J3DMaterialFactory.h:96
GXColor * mpTevKColor
Definition J3DMaterialFactory.h:169
u8 * mpMaterialMode
Definition J3DMaterialFactory.h:184
J3DTexMtxInfo * mpTexMtxInfo
Definition J3DMaterialFactory.h:163
J3DColorChanInfo * mpColorChanInfo
Definition J3DMaterialFactory.h:157
static u32 getMdlDataFlag_ColorFlag(u32 flags)
Definition J3DMaterialFactory.h:148
static int getMdlDataFlag_TexGenFlag(u32 flags)
Definition J3DMaterialFactory.h:147
J3DBlend newBlend(int) const
Definition J3DMaterialFactory.cpp:1006
GXCullMode * mpCullMode
Definition J3DMaterialFactory.h:166
J3DMaterial * createNormalMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:412
J3DIndTexOrder newIndTexOrder(int, int) const
Definition J3DMaterialFactory.cpp:943
J3DTevOrderInfo * mpTevOrderInfo
Definition J3DMaterialFactory.h:167
J3DGXColor newAmbColor(int, int) const
Definition J3DMaterialFactory.cpp:801
J3DZMode newZMode(int) const
Definition J3DMaterialFactory.cpp:1017
J3DTevSwapModeTableInfo * mpTevSwapModeTableInfo
Definition J3DMaterialFactory.h:173
u8 newCullMode(int) const
Definition J3DMaterialFactory.cpp:843
J3DNBTScaleInfo * mpNBTScaleInfo
Definition J3DMaterialFactory.h:180
J3DTexCoord newTexCoord(int, int) const
Definition J3DMaterialFactory.cpp:822
J3DTexCoord2Info * mpTexCoord2Info
Definition J3DMaterialFactory.h:162
u16 newTexNo(int, int) const
Definition J3DMaterialFactory.cpp:854
J3DColorChan newColorChan(int, int) const
Definition J3DMaterialFactory.cpp:788
u32 newTexGenNum(int) const
Definition J3DMaterialFactory.cpp:812
u32 calcSizePatchedMaterial(J3DMaterial *, int, u32) const
Definition J3DMaterialFactory.cpp:730
u32 countTexGens(int) const
Definition J3DMaterialFactory.cpp:357
u32 calcSize(J3DMaterial *, MaterialType, int, u32) const
Definition J3DMaterialFactory.cpp:673
J3DDisplayListInit * mpDisplayListInit
Definition J3DMaterialFactory.h:181
static int getMdlDataFlag_TevStageNum(u32 flags)
Definition J3DMaterialFactory.h:146
Definition J3DTexture.h:40
Definition J3DMatBlock.h:735
Definition J3DMatBlock.h:761
Definition J3DMatBlock.h:680
Definition J3DMatBlock.h:696
Definition J3DMatBlock.h:1123
Definition J3DMatBlock.h:1147
Definition J3DMaterialFactory.h:81
u32 mOffset
Definition J3DMaterialFactory.h:82
u32 field_0x4
Definition J3DMaterialFactory.h:83
Definition J3DStruct.h:120
Definition J3DMatBlock.h:719
Definition J3DMatBlock.h:12
Definition J3DMatBlock.h:30
Definition J3DMaterialFactory.h:51
J3DIndTexOrderInfo mIndTexOrderInfo[3]
Definition J3DMaterialFactory.h:55
bool mEnabled
Definition J3DMaterialFactory.h:52
u8 mIndTexStageNum
Definition J3DMaterialFactory.h:53
u8 field_0x002[2]
Definition J3DMaterialFactory.h:54
u8 field_0x010[4]
Definition J3DMaterialFactory.h:56
J3DIndTevStageInfo mIndTevStageInfo[0x10]
Definition J3DMaterialFactory.h:60
J3DIndTexCoordScaleInfo mIndTexCoordScaleInfo[3]
Definition J3DMaterialFactory.h:58
u8 field_0x074[4]
Definition J3DMaterialFactory.h:59
J3DIndTexMtxInfo mIndTexMtxInfo[3]
Definition J3DMaterialFactory.h:57
Definition J3DTevs.h:163
Definition J3DTevs.h:182
Definition J3DMatBlock.h:974
Definition J3DMatBlock.h:987
Definition J3DStruct.h:110
Definition J3DMatBlock.h:1007
Definition J3DMatBlock.h:1020
Definition J3DMatBlock.h:1033
Definition J3DModelLoader.h:93
Definition J3DModelLoader.h:166
Definition J3DMaterialFactory.h:14
u8 mTevStageNumIdx
Definition J3DMaterialFactory.h:19
u8 mTexGenNumIdx
Definition J3DMaterialFactory.h:18
u8 mZModeIdx
Definition J3DMaterialFactory.h:21
u16 mTexCoordIdx[8]
Definition J3DMaterialFactory.h:27
u16 mNBTScaleIdx
Definition J3DMaterialFactory.h:44
u8 field_0x12c[0x18]
Definition J3DMaterialFactory.h:40
u16 mAmbColorIdx[2]
Definition J3DMaterialFactory.h:25
u16 mBlendIdx
Definition J3DMaterialFactory.h:43
u16 mTevSwapModeIdx[0x10]
Definition J3DMaterialFactory.h:38
u16 mTevOrderIdx[0x10]
Definition J3DMaterialFactory.h:35
u16 mTevKColorIdx[4]
Definition J3DMaterialFactory.h:32
u16 mTevStageIdx[0x10]
Definition J3DMaterialFactory.h:37
u16 mFogIdx
Definition J3DMaterialFactory.h:41
u16 mMatColorIdx[2]
Definition J3DMaterialFactory.h:23
u8 field_0x058[0x2c]
Definition J3DMaterialFactory.h:30
u8 mMaterialMode
Definition J3DMaterialFactory.h:15
u16 mTexNoIdx[8]
Definition J3DMaterialFactory.h:31
u16 mTevSwapModeTableIdx[4]
Definition J3DMaterialFactory.h:39
u16 mTevColorIdx[4]
Definition J3DMaterialFactory.h:36
u8 mCullModeIdx
Definition J3DMaterialFactory.h:16
u16 mTexMtxIdx[8]
Definition J3DMaterialFactory.h:29
u16 mAlphaCompIdx
Definition J3DMaterialFactory.h:42
u8 mTevKColorSel[0x10]
Definition J3DMaterialFactory.h:33
u8 mZCompLocIdx
Definition J3DMaterialFactory.h:20
u8 mDitherIdx
Definition J3DMaterialFactory.h:22
u8 field_0x018[0x10]
Definition J3DMaterialFactory.h:26
u16 mColorChanIdx[4]
Definition J3DMaterialFactory.h:24
u8 mColorChanNumIdx
Definition J3DMaterialFactory.h:17
u8 mTevKAlphaSel[0x10]
Definition J3DMaterialFactory.h:34
u8 field_0x038[0x10]
Definition J3DMaterialFactory.h:28
Definition d_a_hozelda.cpp:93
Definition J3DStruct.h:138
Definition J3DMatBlock.h:51
Definition J3DMaterialFactory.h:67
u8 field_0xc[4]
Definition J3DMaterialFactory.h:74
u16 mTexMtxOffset
Definition J3DMaterialFactory.h:70
u16 mFogOffset
Definition J3DMaterialFactory.h:73
u16 mColorChanOffset
Definition J3DMaterialFactory.h:69
u16 mMatColorOffset
Definition J3DMaterialFactory.h:68
u16 mTexNoOffset
Definition J3DMaterialFactory.h:71
u16 mTevRegOffset
Definition J3DMaterialFactory.h:72
Definition J3DTevs.h:217
Definition J3DTevs.h:234
Definition J3DTevs.h:12
Definition J3DTevs.h:67
Definition J3DTevs.h:54
Definition J3DTevs.h:41
Definition J3DTevs.h:249
Definition J3DTexture.h:68
Definition J3DTexture.h:81
Definition J3DStruct.h:93
Definition J3DMatBlock.h:632
Definition J3DMatBlock.h:645
Definition d_a_obj_sekizoa.cpp:191
Definition d_a_ep.cpp:68
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8