fopEn_enemy / fix e_wb

This commit is contained in:
TakaRikka
2022-10-04 17:29:53 -07:00
parent 179d4e8df2
commit 31ef090a50
36 changed files with 1057 additions and 836 deletions
+27 -12
View File
@@ -11,22 +11,37 @@ class J3DDrawPacket;
class J3DMatPacket;
class J3DShapePacket;
typedef void (*J3DDrawBuffer_DrawFunc)(const J3DDrawBuffer* this_);
typedef int (J3DDrawBuffer::*sortFunc)(J3DMatPacket*);
typedef void (J3DDrawBuffer::*drawFunc)() const;
class J3DDrawBuffer {
public:
enum EDrawType {
DRAW_HEAD,
DRAW_TAIL,
};
enum ESortType {
SORT_MAT,
SORT_MAT_ANM,
SORT_Z,
SORT_MODEL,
SORT_INVALID,
SORT_NON,
};
J3DDrawBuffer() { initialize(); }
~J3DDrawBuffer();
void initialize();
J3DError allocBuffer(u32);
void frameInit();
void entryMatSort(J3DMatPacket*);
void entryMatAnmSort(J3DMatPacket*);
void entryZSort(J3DMatPacket*);
void entryModelSort(J3DMatPacket*);
void entryInvalidSort(J3DMatPacket*);
bool entryNonSort(J3DMatPacket*);
bool entryImm(J3DPacket* pPacket, u16 index);
int entryMatSort(J3DMatPacket*);
int entryMatAnmSort(J3DMatPacket*);
int entryZSort(J3DMatPacket*);
int entryModelSort(J3DMatPacket*);
int entryInvalidSort(J3DMatPacket*);
int entryNonSort(J3DMatPacket*);
int entryImm(J3DPacket* pPacket, u16 index);
void draw() const;
void drawHead() const;
void drawTail() const;
@@ -43,12 +58,12 @@ public:
/* 0x10 */ f32 mZNear;
/* 0x14 */ f32 mZFar;
/* 0x18 */ f32 mZRatio;
/* 0x1C */ Mtx* mpZMtx;
/* 0x1C */ MtxP mpZMtx;
/* 0x20 */ J3DPacket* mpCallBackPacket;
static u8 sortFuncTable[72];
static u8 drawFuncTable[24];
static u8 entryNum[4 + 4 /* padding */];
static sortFunc sortFuncTable[6];
static drawFunc drawFuncTable[2];
static int entryNum;
};
#endif /* J3DDRAWBUFFER_H */
+3 -1
View File
@@ -57,9 +57,11 @@ public:
}
void addChildPacket(J3DPacket*);
J3DPacket* getNextPacket() const { return mpNextSibling; }
void setNextPacket(J3DPacket* i_packet) { mpNextSibling = i_packet; }
inline void clear() {
void drawClear() {
mpNextSibling = NULL;
mpFirstChild = NULL;
}
+16
View File
@@ -27,6 +27,11 @@ static inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
class J3DCurrentMtx : public J3DCurrentMtxInfo {
public:
J3DCurrentMtx() {
mMtxIdxRegA = 0x3cf3cf00;
mMtxIdxRegB = 0x00f3cf3c;
}
u32 getMtxIdxRegA() const { return mMtxIdxRegA; }
u32 getMtxIdxRegB() const { return mMtxIdxRegB; }
@@ -54,6 +59,14 @@ enum J3DShpFlag {
class J3DShape {
public:
J3DShape() {
initialize();
}
enum {
kVcdVatDLSize = 0xC0,
};
/* 80314B48 */ void initialize();
/* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32);
/* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr);
@@ -93,11 +106,14 @@ public:
inline u32 getMtxGroupNum() const { return mMtxGroupNum; }
inline J3DShapeDraw* getShapeDraw(u32 idx) const { return mShapeDraw[idx]; }
inline J3DShapeMtx* getShapeMtx(u32 idx) const { return mShapeMtx[idx]; }
static void resetVcdVatCache() { sOldVcdVatCmd = NULL; }
static void* sOldVcdVatCmd;
private:
friend struct J3DShapeFactory;
/* 0x04 */ J3DMaterial* mMaterial;
/* 0x08 */ u16 mIndex;
/* 0x0A */ u16 mMtxGroupNum;
+32 -4
View File
@@ -24,6 +24,10 @@ extern u8 struct_804515B0[4];
class J3DShapeMtx {
public:
J3DShapeMtx(u16 useMtxIndex)
: mUseMtxIndex(useMtxIndex)
{}
/* 803130A8 */ void resetMtxLoadCache();
/* 803130E4 */ void loadMtxIndx_PNGP(int, u16) const;
/* 80313128 */ void loadMtxIndx_PCPU(int, u16) const;
@@ -54,6 +58,10 @@ private:
class J3DShapeMtxConcatView : public J3DShapeMtx {
public:
J3DShapeMtxConcatView(u16 useMtxIndex)
: J3DShapeMtx(useMtxIndex)
{}
/* 80314730 */ virtual ~J3DShapeMtxConcatView();
/* 803147E0 */ virtual u32 getType() const;
/* 80313C54 */ virtual void load() const;
@@ -73,6 +81,10 @@ public:
class J3DShapeMtxYBBoardConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxYBBoardConcatView(u16 useMtxIndex)
: J3DShapeMtxConcatView(useMtxIndex)
{}
/* 80314520 */ virtual ~J3DShapeMtxYBBoardConcatView();
/* 803147E0 */ virtual u32 getType() const;
/* 803143E4 */ virtual void load() const;
@@ -80,6 +92,10 @@ public:
class J3DShapeMtxBBoardConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxBBoardConcatView(u16 useMtxIndex)
: J3DShapeMtxConcatView(useMtxIndex)
{}
/* 803145A4 */ virtual ~J3DShapeMtxBBoardConcatView();
/* 803147E0 */ virtual u32 getType() const;
/* 803142D4 */ virtual void load() const;
@@ -87,6 +103,12 @@ public:
class J3DShapeMtxMulti : public J3DShapeMtx {
public:
J3DShapeMtxMulti(u16 useMtxIndex, u16 useMtxNum, u16* useMtxIndexTable)
: J3DShapeMtx(useMtxIndex)
, mUseMtxNum(useMtxNum)
, mUseMtxIndexTable(useMtxIndexTable)
{}
/* 803146B0 */ virtual ~J3DShapeMtxMulti();
/* 803147E0 */ virtual u32 getType() const;
/* 80273E08 */ virtual u32 getUseMtxNum() const;
@@ -96,11 +118,17 @@ public:
private:
/* 0x6 */ u16 mUseMtxNum;
/* 0x8 */ u16* mUseMtxIndex;
/* 0x8 */ u16* mUseMtxIndexTable;
};
class J3DShapeMtxMultiConcatView : public J3DShapeMtx {
class J3DShapeMtxMultiConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxMultiConcatView(u16 useMtxIndex, u16 useMtxNum, u16* useMtxIndexTable)
: J3DShapeMtxConcatView(useMtxIndex)
, mUseMtxNum(useMtxNum)
, mUseMtxIndexTable(useMtxIndexTable)
{}
/* 8031461C */ virtual ~J3DShapeMtxMultiConcatView();
/* 803147E0 */ virtual u32 getType() const;
/* 80273E08 */ virtual u32 getUseMtxNum() const;
@@ -111,7 +139,7 @@ public:
private:
/* 0x6 */ u16 mUseMtxNum;
/* 0x8 */ u16* mUseMtxIndex;
/* 0x8 */ u16* mUseMtxIndexTable;
};
#endif /* J3DSHAPEMTX_H */
#endif /* J3DSHAPEMTX_H */