Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DSys.h
Go to the documentation of this file.
1#ifndef J3DSYS_H
2#define J3DSYS_H
3
4#include "dolphin/gx.h"
5
6// Perhaps move to a new J3DEnum.h?
11
16
17class J3DMtxCalc;
18class J3DModel;
19class J3DMatPacket;
20class J3DShapePacket;
21class J3DShape;
22class J3DDrawBuffer;
23class J3DTexture;
24
30 /* 0x0 */ u16 field_0x00;
31 /* 0x2 */ u16 field_0x02;
32 /* 0x4 */ u16 field_0x04;
33 /* 0x6 */ u16 field_0x06;
34};
35
40};
41
46struct J3DSys {
47 /* 0x000 */ Mtx mViewMtx;
49 /* 0x034 */ u32 mFlags;
50 /* 0x038 */ J3DModel* mModel;
53 /* 0x044 */ J3DShape* mShape;
54 /* 0x048 */ J3DDrawBuffer* mDrawBuffer[2];
55 /* 0x050 */ u32 mDrawMode;
56 /* 0x054 */ u32 mMaterialMode;
57 /* 0x058 */ J3DTexture* mTexture;
58 /* 0x05C */ u8 field_0x5c[0x04];
61 /* 0x0E4 */ u8 field_0xe4[0x20];
62 /* 0x104 */ Mtx* mModelDrawMtx;
63 /* 0x108 */ Mtx33* mModelNrmMtx;
64 /* 0x10C */ void* mVtxPos;
65 /* 0x110 */ void* mVtxNrm;
66 /* 0x114 */ _GXColor* mVtxCol;
67 /* 0x118 */ Vec* mNBTScale;
68
69 /* 8030FDE8 */ J3DSys();
70 /* 8030FEC0 */ void loadPosMtxIndx(int, u16) const;
71 /* 8030FEE4 */ void loadNrmMtxIndx(int, u16) const;
72 /* 8030FF0C */ void setTexCacheRegion(_GXTexCacheSize);
73 /* 803100BC */ void drawInit();
74 /* 8031073C */ void reinitGX();
75 /* 8031079C */ void reinitGenMode();
76 /* 803107E8 */ void reinitLighting();
77 /* 80310894 */ void reinitTransform();
78 /* 80310998 */ void reinitTexture();
79 /* 80310A3C */ void reinitTevStages();
80 /* 80310D44 */ void reinitIndStages();
81 /* 80310E3C */ void reinitPixelProc();
82
83 enum DrawMode {
84 /* 0x3 */ OPA_TEX_EDGE = 3,
85 /* 0x4 */ XLU,
86 };
87
88 MtxP getViewMtx() { return mViewMtx; }
89
91
93
94 void* getVtxPos() const { return mVtxPos; }
95 void setVtxPos(void* pVtxPos) { mVtxPos = pVtxPos; }
96
97 void* getVtxNrm() const { return mVtxNrm; }
98 void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; }
99
100 void* getVtxCol() const { return mVtxCol; }
102
107 void setMaterialMode(u32 mode) { mMaterialMode = mode; }
108
111
114
115 void setNBTScale(Vec* scale) { mNBTScale = scale; }
116 Vec* getNBTScale() { return mNBTScale; }
117
118 void onFlag(u32 flag) { mFlags |= flag; }
119
121
122 bool checkFlag(u32 flag) { return mFlags & flag; }
123
128
133
134 // Type 0: Opa Buffer
135 // Type 1: Xlu Buffer
137
138 // Type 0: Opa Buffer
139 // Type 1: Xlu Buffer
140 J3DDrawBuffer* getDrawBuffer(int type) { return mDrawBuffer[type]; }
141
144
146
147 J3DModel* getModel() { return mModel; }
148
151 static Vec mParentS;
153};
154
155extern u32 j3dDefaultViewNo;
156extern J3DSys j3dSys;
157
158#endif /* J3DSYS_H */
void GXSetArray(GXAttr attr, void *basePtr, u8 stride)
Definition GXAttr.c:590
@ GX_NRM_MTX_ARRAY
Definition GXEnum.h:220
@ GX_POS_MTX_ARRAY
Definition GXEnum.h:219
_GXTexCacheSize
Definition GXEnum.h:707
J3DSysFlag
Definition J3DSys.h:36
@ J3DSysFlag_SkinNrmCpu
Definition J3DSys.h:38
@ J3DSysFlag_SkinPosCpu
Definition J3DSys.h:37
@ J3DSysFlag_PostTexMtx
Definition J3DSys.h:39
J3DSysDrawBuffer
Definition J3DSys.h:12
@ J3DSys_XLU_BUFFER_e
Definition J3DSys.h:14
@ J3DSys_OPA_BUFFER_e
Definition J3DSys.h:13
u32 j3dDefaultViewNo
Definition J3DSys.cpp:400
J3DError
Definition J3DSys.h:7
@ kJ3DError_Success
Definition J3DSys.h:8
@ kJ3DError_Alloc
Definition J3DSys.h:9
J3DSys j3dSys
Definition J3DSys.cpp:39
static OSTime buffer
Definition ai.c:202
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition J3DDrawBuffer.h:43
Definition J3DPacket.h:206
Definition J3DPacket.h:174
Definition J3DShape.h:82
Definition J3DTexture.h:12
static volatile BOOL flag
Definition dspproc.cpp:20
int m
Definition e_atan2.c:62
f32 Mtx33[3][3]
Definition mtx.h:16
f32(* MtxP)[4]
Definition mtx.h:18
f32 Mtx[3][4]
Definition mtx.h:15
Definition d_a_ep.cpp:155
Definition d_a_hozelda.cpp:217
Definition d_a_hozelda.cpp:192
J3DDrawBuffer * mDrawBuffer[2]
Definition J3DSys.h:54
void reinitTevStages()
Definition J3DSys.cpp:318
Mtx * mModelDrawMtx
Definition J3DSys.h:62
J3DModel * getModel()
Definition J3DSys.h:147
Mtx33 * mModelNrmMtx
Definition J3DSys.h:63
J3DShape * mShape
Definition J3DSys.h:53
static Mtx mCurrentMtx
Definition J3DSys.h:149
void * mVtxNrm
Definition J3DSys.h:65
void offFlag(u32 flag)
Definition J3DSys.h:120
void * getVtxPos() const
Definition J3DSys.h:94
u8 field_0x5c[0x04]
Definition J3DSys.h:58
Mtx & getModelDrawMtx(u16 no) const
Definition J3DSys.h:142
void setVtxNrm(void *pVtxNrm)
Definition J3DSys.h:98
void reinitLighting()
Definition J3DSys.cpp:279
void setDrawModeXlu()
Definition J3DSys.h:92
J3DMatPacket * mMatPacket
Definition J3DSys.h:51
J3DMtxCalc * mCurrentMtxCalc
Definition J3DSys.h:48
void reinitTexture()
Definition J3DSys.cpp:304
DrawMode
Definition J3DSys.h:83
@ OPA_TEX_EDGE
Definition J3DSys.h:84
@ XLU
Definition J3DSys.h:85
void setShapePacket(J3DShapePacket *pPacket)
Definition J3DSys.h:104
void setCurrentMtxCalc(J3DMtxCalc *pCalc)
Definition J3DSys.h:109
void * mVtxPos
Definition J3DSys.h:64
void reinitIndStages()
Definition J3DSys.cpp:368
_GXColor * mVtxCol
Definition J3DSys.h:66
void setDrawBuffer(J3DDrawBuffer *buffer, int type)
Definition J3DSys.h:136
void * getVtxNrm() const
Definition J3DSys.h:97
u8 field_0xe4[0x20]
Definition J3DSys.h:61
void setNBTScale(Vec *scale)
Definition J3DSys.h:115
MtxP getViewMtx()
Definition J3DSys.h:88
void onFlag(u32 flag)
Definition J3DSys.h:118
void loadNrmMtxIndx(int, u16) const
Definition J3DSys.cpp:91
u32 mTexCacheRegionNum
Definition J3DSys.h:59
Mtx mViewMtx
Definition J3DSys.h:47
void * getVtxCol() const
Definition J3DSys.h:100
void setMatPacket(J3DMatPacket *pPacket)
Definition J3DSys.h:105
void loadPosMtxIndx(int, u16) const
Definition J3DSys.cpp:86
J3DDrawBuffer * getDrawBuffer(int type)
Definition J3DSys.h:140
void setModelDrawMtx(Mtx *pMtxArr)
Definition J3DSys.h:124
void setModelNrmMtx(Mtx33 *pMtxArr)
Definition J3DSys.h:129
void reinitGX()
Definition J3DSys.cpp:250
u32 mMaterialMode
Definition J3DSys.h:56
Vec * getNBTScale()
Definition J3DSys.h:116
J3DMtxCalc * getCurrentMtxCalc() const
Definition J3DSys.h:110
GXTexRegion mTexCacheRegion[8]
Definition J3DSys.h:60
void setMaterialMode(u32 mode)
Definition J3DSys.h:107
static Vec mCurrentS
Definition J3DSys.h:150
void setVtxPos(void *pVtxPos)
Definition J3DSys.h:95
J3DTexture * mTexture
Definition J3DSys.h:57
void setViewMtx(Mtx m)
Definition J3DSys.h:145
void drawInit()
Definition J3DSys.cpp:144
J3DSys()
Definition J3DSys.cpp:54
J3DModel * mModel
Definition J3DSys.h:50
void reinitPixelProc()
Definition J3DSys.cpp:387
u32 mFlags
Definition J3DSys.h:49
void reinitGenMode()
Definition J3DSys.cpp:262
Vec * mNBTScale
Definition J3DSys.h:67
J3DMatPacket * getMatPacket()
Definition J3DSys.h:106
void setModel(J3DModel *pModel)
Definition J3DSys.h:103
static J3DTexCoordScaleInfo sTexCoordScaleTable[8]
Definition J3DSys.h:152
u32 mDrawMode
Definition J3DSys.h:55
bool checkFlag(u32 flag)
Definition J3DSys.h:122
J3DTexture * getTexture()
Definition J3DSys.h:113
void setVtxCol(_GXColor *pVtxCol)
Definition J3DSys.h:101
J3DShapePacket * getShapePacket() const
Definition J3DSys.h:143
J3DShapePacket * mShapePacket
Definition J3DSys.h:52
void setTexCacheRegion(_GXTexCacheSize)
Definition J3DSys.cpp:97
void setDrawModeOpaTexEdge()
Definition J3DSys.h:90
static Vec mParentS
Definition J3DSys.h:151
void reinitTransform()
Definition J3DSys.cpp:291
void setTexture(J3DTexture *pTex)
Definition J3DSys.h:112
Definition J3DSys.h:29
u16 field_0x06
Definition J3DSys.h:33
u16 field_0x02
Definition J3DSys.h:31
u16 field_0x04
Definition J3DSys.h:32
u16 field_0x00
Definition J3DSys.h:30
Definition d_a_hozelda.cpp:18
Definition d_a_ep.cpp:68
Definition GXStruct.h:95
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8