demo matches for some grid funcs

This commit is contained in:
LagoLunatic
2026-09-09 13:35:22 -04:00
parent 01edd8c27a
commit 99662e663f
5 changed files with 171 additions and 167 deletions
+15 -16
View File
@@ -48,32 +48,31 @@ public:
void drawTail() const;
void setCallBackPacket(J3DCallBackPacket* pPacket);
J3DPacket* getEntryPacket(u16 i) { return mpBuf[i]; }
u32 getEntryTableSize() { return mBufSize; } // Unused in TWW, but exists in TP
void setNonSort() { mSortType = (u32)SORT_NON; }
void setZSort() { mSortType = (u32)SORT_Z; }
void setInvalidSort() { mSortType = (u32)SORT_INVALID; }
J3DPacket* getEntryPacket(u16 i) { return mpBuffer[i]; }
u32 getEntryTableSize() { return mEntryTableSize; } // Unused in TWW, but exists in TP
int getSortMode() { return mSortMode; }
void setNonSort() { mSortMode = SORT_NON; }
void setZSort() { mSortMode = SORT_Z; }
void setInvalidSort() { mSortMode = SORT_INVALID; }
void setZMtx(MtxP mtx) { mpZMtx = mtx; }
void calcZRatio() {
mZRatio = (mZFar - mZNear) / (f32)mBufSize;
mZRatio = (mZFar - mZNear) / (f32)mEntryTableSize;
}
void getSortMode() {}
static sortFunc sortFuncTable[6];
static drawFunc drawFuncTable[2];
static int entryNum;
public:
/* 0x00 */ J3DPacket** mpBuf;
/* 0x04 */ u32 mBufSize;
/* 0x08 */ u32 mDrawType;
/* 0x0C */ u32 mSortType;
private:
/* 0x00 */ J3DPacket** mpBuffer;
/* 0x04 */ u32 mEntryTableSize;
/* 0x08 */ u32 mDrawMode;
/* 0x0C */ u32 mSortMode;
/* 0x10 */ f32 mZNear;
/* 0x14 */ f32 mZFar;
/* 0x18 */ f32 mZRatio;
/* 0x1C */ MtxP mpZMtx;
/* 0x20 */ J3DPacket* mpCallBackPacket;
static sortFunc sortFuncTable[6];
static drawFunc drawFuncTable[2];
static int entryNum;
};
#endif /* J3DDRAWBUFFER_H */
+3 -3
View File
@@ -214,9 +214,9 @@ public:
J3DTexture* getTexture() { return mpTexture; }
virtual ~J3DMatPacket();
virtual int entry(J3DDrawBuffer* param_1) {
J3DDrawBuffer::sortFunc func = J3DDrawBuffer::sortFuncTable[param_1->mSortType];
return (param_1->*func)(this);
virtual int entry(J3DDrawBuffer* pBuffer) {
J3DDrawBuffer::sortFunc func = J3DDrawBuffer::sortFuncTable[pBuffer->getSortMode()];
return (pBuffer->*func)(this);
}
virtual void draw();
virtual bool isSame(J3DMatPacket*) const;