Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DDrawBuffer.h
Go to the documentation of this file.
1#ifndef J3DDRAWBUFFER_H
2#define J3DDRAWBUFFER_H
3
5
6// matches debug
7inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
8 register f32 temp_f4;
9 register f32 out;
10 register f32 temp_f0;
11 register f32 temp_f2;
12 register f32 temp_f1 = 1.0f;
13
14 // clang-format off
15 asm {
16 psq_l temp_f0, 0(v), 0, 0 /* qr0 */
17 lfs temp_f2, 8(v)
18 psq_l temp_f4, 32(m), 0, 0 /* qr0 */
19 psq_l out, 40(m), 0, 0 /* qr0 */
24 }
25 // clang-format on
26
27 return out;
28}
29
30class J3DDrawBuffer;
31class J3DPacket;
32class J3DDrawPacket;
33class J3DMatPacket;
34class J3DShapePacket;
35
38
44public:
49
58
61 void initialize();
63 void frameInit();
70 int entryImm(J3DPacket* pPacket, u16 index);
71 void draw() const;
72 void drawHead() const;
73 void drawTail() const;
74
76
77 inline void calcZRatio();
78 void setNonSort() { mSortType = 5; }
79 void setZSort() { mSortType = 2; }
80 void setZMtx(MtxP mtx) { mpZMtx = mtx; }
81
82public:
83 /* 0x00 */ J3DPacket** mpBuf;
84 /* 0x04 */ u32 mBufSize;
85 /* 0x08 */ u32 mDrawType;
86 /* 0x0C */ u32 mSortType;
87 /* 0x10 */ f32 mZNear;
88 /* 0x14 */ f32 mZFar;
89 /* 0x18 */ f32 mZRatio;
90 /* 0x1C */ MtxP mpZMtx;
92
93 static sortFunc sortFuncTable[6];
94 static drawFunc drawFuncTable[2];
95 static int entryNum;
96};
97
98#endif /* J3DDRAWBUFFER_H */
void(J3DDrawBuffer::* drawFunc)() const
Definition J3DDrawBuffer.h:37
int(J3DDrawBuffer::* sortFunc)(J3DMatPacket *)
Definition J3DDrawBuffer.h:36
f32 J3DCalcZValue(register MtxP m, register Vec v)
Definition J3DDrawBuffer.h:7
J3DError
Definition J3DSys.h:7
static Mtx mtx[10]
Definition c_lib.cpp:347
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition J3DDrawBuffer.h:43
EDrawType
Definition J3DDrawBuffer.h:45
@ DRAW_HEAD
Definition J3DDrawBuffer.h:46
@ DRAW_TAIL
Definition J3DDrawBuffer.h:47
~J3DDrawBuffer()
Definition J3DDrawBuffer.cpp:36
static int entryNum
Definition J3DDrawBuffer.h:95
int entryMatSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:54
void calcZRatio()
Definition J3DDrawBuffer.cpp:10
int entryNonSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:183
static drawFunc drawFuncTable[2]
Definition J3DDrawBuffer.h:207
void initialize()
Definition J3DDrawBuffer.cpp:14
void setZSort()
Definition J3DDrawBuffer.h:79
f32 mZRatio
Definition J3DDrawBuffer.h:89
void draw() const
Definition J3DDrawBuffer.cpp:213
void drawTail() const
Definition J3DDrawBuffer.cpp:231
u32 getEntryTableSize()
Definition J3DDrawBuffer.h:75
int entryMatAnmSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:95
u32 mDrawType
Definition J3DDrawBuffer.h:85
void setZMtx(MtxP mtx)
Definition J3DDrawBuffer.h:80
ESortType
Definition J3DDrawBuffer.h:50
@ SORT_Z
Definition J3DDrawBuffer.h:53
@ SORT_MODEL
Definition J3DDrawBuffer.h:54
@ SORT_MAT
Definition J3DDrawBuffer.h:51
@ SORT_MAT_ANM
Definition J3DDrawBuffer.h:52
@ SORT_INVALID
Definition J3DDrawBuffer.h:55
@ SORT_NON
Definition J3DDrawBuffer.h:56
J3DError allocBuffer(u32)
Definition J3DDrawBuffer.cpp:25
J3DDrawBuffer()
Definition J3DDrawBuffer.h:59
int entryZSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:126
u32 mSortType
Definition J3DDrawBuffer.h:86
int entryImm(J3DPacket *pPacket, u16 index)
Definition J3DDrawBuffer.cpp:193
int entryModelSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:157
void setNonSort()
Definition J3DDrawBuffer.h:78
void drawHead() const
Definition J3DDrawBuffer.cpp:219
int entryInvalidSort(J3DMatPacket *)
Definition J3DDrawBuffer.cpp:171
MtxP mpZMtx
Definition J3DDrawBuffer.h:90
f32 mZNear
Definition J3DDrawBuffer.h:87
void frameInit()
Definition J3DDrawBuffer.cpp:44
f32 mZFar
Definition J3DDrawBuffer.h:88
J3DPacket * mpCallBackPacket
Definition J3DDrawBuffer.h:91
static sortFunc sortFuncTable[6]
Definition J3DDrawBuffer.h:201
J3DPacket ** mpBuf
Definition J3DDrawBuffer.h:83
u32 mBufSize
Definition J3DDrawBuffer.h:84
Definition J3DPacket.h:135
Definition J3DPacket.h:206
Definition J3DPacket.h:100
Definition J3DPacket.h:174
int m
Definition e_atan2.c:62
double v
Definition e_pow.c:163
f32(* MtxP)[4]
Definition mtx.h:18
Definition d_a_hozelda.cpp:18
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
unsigned short u16
Definition types.h:9