Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DPacket.h
Go to the documentation of this file.
1#ifndef J3DPACKET_H
2#define J3DPACKET_H
3
5#include "dolphin/gd/GDBase.h"
6
7class J3DMatPacket;
8
9class J3DDrawBuffer;
10class J3DMaterial;
11class J3DMaterialAnm;
12class J3DModel;
13class J3DMtxBuffer;
14class J3DShape;
15class J3DTexMtx;
16class J3DTexMtxObj;
17class J3DTexture;
18
20 return (param_1 & 0xf0) >> 4;
21}
22
24 return (param_1 & 0xf00) >> 8;
25}
26
28 return param_1 * 0x35;
29}
30
32 return param_1 * 0x3d + 10;
33}
34
36 return (param_1 & 0xf0000) >> 0x10;
37}
38
40 return param_1 * 0x37;
41}
42
44 u32 res = param_1 * 0x37;
45 res += ((param_1 + 1) >> 1) * 0x37;
46 return res;
47}
48
50 return (param_1 & 0xf00000) >> 0x14;
51}
52
54 return param_1 * 10;
55}
56
58 return param_1 * 5;
59}
60
66public:
68 mpData[0] = NULL;
69 mpData[1] = NULL;
70 mSize = 0;
71 mCapacity = 0;
72 }
73
77 void setSingleDisplayList(void*, u32);
78 void swapBuffer();
79 void callDL() const;
80 void beginDL();
81 u32 endDL();
82 void beginPatch();
83 u32 endPatch();
84
85 u8* getDisplayList(int idx) const { return (u8*)mpData[idx]; }
86 u32 getDisplayListSize() const { return mSize; }
87
90
91 /* 0x0 */ void* mpData[2];
92 /* 0x8 */ u32 mSize;
93 /* 0xC */ u32 mCapacity;
94}; // Size: 0x10
95
101public:
107
109
112
113 void drawClear() {
116 }
117
118 void* getUserArea() { return mpUserData; }
119 void setUserArea(u32 area) { mpUserData = (void*)area; }
120
121 virtual int entry(J3DDrawBuffer*);
122 virtual void draw();
123 virtual ~J3DPacket() {}
124
125public:
128 /* 0x0C */ void* mpUserData;
129}; // Size: 0x10
130
135class J3DDrawPacket : public J3DPacket {
136public:
141 virtual void draw();
142
145
148
149 void callDL() const { getDisplayListObj()->callDL(); }
150
151 enum {
152 LOCKED = 0x01,
153 };
154
155 bool checkFlag(u32 flag) const { return (mFlags & flag) != 0; }
156 void onFlag(u32 flag) { mFlags |= flag; }
158 void lock() { onFlag(LOCKED); }
159 void unlock() { offFlag(LOCKED); }
161 bool isLocked() const { return checkFlag(1); }
162
163public:
164 /* 0x10 */ u32 mFlags;
165 /* 0x14 */ char mPad0[0x0C]; // unk
168}; // Size: 0x28
169
175public:
179 void prepareDraw() const;
180 void drawFast();
181
182 virtual ~J3DShapePacket();
183 virtual void draw();
184
189
190 J3DShape* getShape() const { return mpShape; }
191 J3DModel* getModel() const { return mpModel; }
192 Mtx* getBaseMtxPtr() const { return mpBaseMtxPtr; }
193
194public:
195 /* 0x28 */ J3DShape* mpShape;
197 /* 0x30 */ Mtx* mpBaseMtxPtr;
198 /* 0x34 */ u32 mDiffFlag;
199 /* 0x38 */ J3DModel* mpModel;
200}; // Size: 0x3C
201
207public:
208 J3DMatPacket();
210 void beginDiff();
211 void endDiff();
212 bool isSame(J3DMatPacket*) const;
213
214 J3DMaterial* getMaterial() const { return mpMaterial; }
222 bool isChanged() const { return mDiffFlag & 0x80000000; }
224
225 virtual ~J3DMatPacket();
226 virtual int entry(J3DDrawBuffer*);
227 virtual void draw();
228
229public:
233 /* 0x34 */ u32 mDiffFlag;
236}; // Size: 0x40
237
238#endif /* J3DPACKET_H */
int calcDifferedBufferSize_TexNoSize(int param_1)
Definition J3DPacket.h:39
u32 calcDifferedBufferSize_TexNoAndTexCoordScaleSize(u32 param_1)
Definition J3DPacket.h:43
int calcDifferedBufferSize_TexGenSize(int param_1)
Definition J3DPacket.h:31
int calcDifferedBufferSize_TexMtxSize(int param_1)
Definition J3DPacket.h:27
u32 getDiffFlag_TexNoNum(u32 param_1)
Definition J3DPacket.h:35
u32 getDiffFlag_LightObjNum(u32 param_1)
Definition J3DPacket.h:19
u32 getDiffFlag_TexGenNum(u32 param_1)
Definition J3DPacket.h:23
u32 getDiffFlag_TevStageNum(u32 param_1)
Definition J3DPacket.h:49
int calcDifferedBufferSize_TevStageSize(int param_1)
Definition J3DPacket.h:53
int calcDifferedBufferSize_TevStageDirectSize(int param_1)
Definition J3DPacket.h:57
J3DError
Definition J3DSys.h:7
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition J3DPacket.h:65
J3DError single_To_Double()
Definition J3DPacket.cpp:35
void callDL() const
Definition J3DPacket.cpp:62
static s32 sInterruptFlag
Definition J3DPacket.h:89
void * mpData[2]
Definition J3DPacket.h:91
static GDLObj sGDLObj
Definition J3DPacket.h:88
void beginDL()
Definition J3DPacket.cpp:75
u32 mCapacity
Definition J3DPacket.h:93
u32 endPatch()
Definition J3DPacket.cpp:99
void beginPatch()
Definition J3DPacket.cpp:94
u8 * getDisplayList(int idx) const
Definition J3DPacket.h:85
J3DError newDisplayList(u32)
Definition J3DPacket.cpp:10
void setSingleDisplayList(void *, u32)
Definition J3DPacket.cpp:49
u32 getDisplayListSize() const
Definition J3DPacket.h:86
J3DDisplayListObj()
Definition J3DPacket.h:67
J3DError newSingleDisplayList(u32)
Definition J3DPacket.cpp:22
u32 mSize
Definition J3DPacket.h:92
u32 endDL()
Definition J3DPacket.cpp:83
void swapBuffer()
Definition J3DPacket.cpp:56
Definition J3DDrawBuffer.h:43
Definition J3DPacket.h:135
void beginPatch()
Definition J3DPacket.h:146
char mPad0[0x0C]
Definition J3DPacket.h:165
J3DTexMtxObj * mpTexMtxObj
Definition J3DPacket.h:167
void lock()
Definition J3DPacket.h:158
void offFlag(u32 flag)
Definition J3DPacket.h:157
J3DDrawPacket()
Definition J3DPacket.cpp:131
~J3DDrawPacket()
Definition J3DPacket.cpp:138
J3DError newSingleDisplayList(u32)
Definition J3DPacket.cpp:156
J3DDisplayListObj * mpDisplayListObj
Definition J3DPacket.h:166
u32 mFlags
Definition J3DPacket.h:164
void endPatch()
Definition J3DPacket.h:147
void callDL() const
Definition J3DPacket.h:149
J3DTexMtxObj * getTexMtxObj() const
Definition J3DPacket.h:160
J3DDisplayListObj * getDisplayListObj() const
Definition J3DPacket.h:143
void setDisplayListObj(J3DDisplayListObj *pObj)
Definition J3DPacket.h:144
bool isLocked() const
Definition J3DPacket.h:161
bool checkFlag(u32 flag) const
Definition J3DPacket.h:155
virtual void draw()
Definition J3DPacket.cpp:169
J3DError newDisplayList(u32)
Definition J3DPacket.cpp:142
@ LOCKED
Definition J3DPacket.h:152
void onFlag(u32 flag)
Definition J3DPacket.h:156
void unlock()
Definition J3DPacket.h:159
Definition J3DPacket.h:206
void endDiff()
Definition J3DPacket.cpp:199
bool isEnabled_Diff() const
Definition J3DPacket.h:223
virtual ~J3DMatPacket()
Definition J3DPacket.cpp:184
J3DShapePacket * mpShapePacket
Definition J3DPacket.h:231
bool isSame(J3DMatPacket *) const
Definition J3DPacket.cpp:204
void setMaterialID(u32 id)
Definition J3DPacket.h:220
J3DShapePacket * getShapePacket() const
Definition J3DPacket.h:215
void addShapePacket(J3DShapePacket *)
Definition J3DPacket.cpp:186
void beginDiff()
Definition J3DPacket.cpp:195
J3DMaterial * mpMaterial
Definition J3DPacket.h:232
J3DMatPacket()
Definition J3DPacket.cpp:174
J3DShapePacket * mpInitShapePacket
Definition J3DPacket.h:230
J3DMaterial * getMaterial() const
Definition J3DPacket.h:214
bool isChanged() const
Definition J3DPacket.h:222
void setMaterial(J3DMaterial *pMaterial)
Definition J3DPacket.h:217
J3DMaterialAnm * mpMaterialAnm
Definition J3DPacket.h:235
void setShapePacket(J3DShapePacket *packet)
Definition J3DPacket.h:216
J3DTexture * mpTexture
Definition J3DPacket.h:234
void setTexture(J3DTexture *pTexture)
Definition J3DPacket.h:218
void setInitShapePacket(J3DShapePacket *packet)
Definition J3DPacket.h:219
u32 mDiffFlag
Definition J3DPacket.h:233
void setMaterialAnmID(J3DMaterialAnm *materialAnm)
Definition J3DPacket.h:221
virtual int entry(J3DDrawBuffer *)
Definition J3DPacket.cpp:400
virtual void draw()
Definition J3DPacket.cpp:214
Definition J3DMtxBuffer.h:12
Definition J3DPacket.h:100
virtual ~J3DPacket()
Definition J3DPacket.h:123
virtual int entry(J3DDrawBuffer *)
Definition J3DPacket.cpp:106
virtual void draw()
Definition J3DPacket.cpp:397
J3DPacket * mpFirstChild
Definition J3DPacket.h:127
J3DPacket * getNextPacket() const
Definition J3DPacket.h:110
void setUserArea(u32 area)
Definition J3DPacket.h:119
void * mpUserData
Definition J3DPacket.h:128
void addChildPacket(J3DPacket *)
Definition J3DPacket.cpp:110
void * getUserArea()
Definition J3DPacket.h:118
J3DPacket()
Definition J3DPacket.h:102
void drawClear()
Definition J3DPacket.h:113
void setNextPacket(J3DPacket *i_packet)
Definition J3DPacket.h:111
J3DPacket * mpNextPacket
Definition J3DPacket.h:126
Definition J3DPacket.h:174
J3DError newDifferedDisplayList(u32)
Definition J3DPacket.cpp:308
J3DModel * getModel() const
Definition J3DPacket.h:191
void setModel(J3DModel *pModel)
Definition J3DPacket.h:186
u32 calcDifferedBufferSize(u32)
Definition J3DPacket.cpp:248
void drawFast()
Definition J3DPacket.cpp:380
J3DShapePacket()
Definition J3DPacket.cpp:235
J3DModel * mpModel
Definition J3DPacket.h:199
Mtx * getBaseMtxPtr() const
Definition J3DPacket.h:192
Mtx * mpBaseMtxPtr
Definition J3DPacket.h:197
virtual void draw()
Definition J3DPacket.cpp:359
void setShape(J3DShape *pShape)
Definition J3DPacket.h:185
void setBaseMtxPtr(Mtx *pMtx)
Definition J3DPacket.h:188
J3DShape * getShape() const
Definition J3DPacket.h:190
J3DShape * mpShape
Definition J3DPacket.h:195
virtual ~J3DShapePacket()
Definition J3DPacket.cpp:244
void prepareDraw() const
Definition J3DPacket.cpp:322
u32 mDiffFlag
Definition J3DPacket.h:198
void setMtxBuffer(J3DMtxBuffer *pMtxBuffer)
Definition J3DPacket.h:187
J3DMtxBuffer * mpMtxBuffer
Definition J3DPacket.h:196
Definition J3DShape.h:82
Definition J3DShapeMtx.h:13
Definition J3DTexture.h:40
Definition J3DTexture.h:12
static SECTION_RODATA u8 const id[8]
Definition d_a_npc_bans.cpp:1309
static volatile BOOL flag
Definition dspproc.cpp:20
f32 Mtx[3][4]
Definition mtx.h:15
Definition GDBase.h:10
Definition d_a_hozelda.cpp:229
Definition d_a_hozelda.cpp:93
Definition d_a_ep.cpp:155
unsigned long u32
Definition types.h:10
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8