mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-10 04:46:48 -04:00
J3D setup (#155)
* setup j3d classes * remove asm * fixes * fix newDifferedDisplayList
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define J3DPACKET_H
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "dolphin/gd/GDBase.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
@@ -18,6 +19,13 @@ class J3DTexture;
|
||||
|
||||
class J3DDisplayListObj {
|
||||
public:
|
||||
J3DDisplayListObj() {
|
||||
mpData[0] = NULL;
|
||||
mpData[1] = NULL;
|
||||
mSize = 0;
|
||||
mCapacity = 0;
|
||||
}
|
||||
|
||||
J3DError newDisplayList(u32);
|
||||
J3DError newSingleDisplayList(u32);
|
||||
J3DError single_To_Double();
|
||||
@@ -25,17 +33,20 @@ public:
|
||||
void swapBuffer();
|
||||
void callDL() const;
|
||||
void beginDL();
|
||||
void endDL();
|
||||
u32 endDL();
|
||||
void beginPatch();
|
||||
void endPatch();
|
||||
u32 endPatch();
|
||||
|
||||
static u8 sGDLObj[16];
|
||||
static u8 sInterruptFlag[4 + 4 /* padding */];
|
||||
u8* getDisplayList(int idx) const { return (u8*)mpData[idx]; }
|
||||
u32 getDisplayListSize() const { return mSize; }
|
||||
|
||||
void* mpData[2];
|
||||
u32 mSize;
|
||||
u32 mCapacity;
|
||||
};
|
||||
static GDLObj sGDLObj;
|
||||
static s32 sInterruptFlag;
|
||||
|
||||
/* 0x0 */ void* mpData[2];
|
||||
/* 0x8 */ u32 mSize;
|
||||
/* 0xC */ u32 mCapacity;
|
||||
}; // Size: 0x10
|
||||
|
||||
class J3DPacket {
|
||||
public:
|
||||
@@ -45,14 +56,14 @@ public:
|
||||
mpUserData = NULL;
|
||||
}
|
||||
|
||||
void addChildPacket(J3DPacket* pChild);
|
||||
void addChildPacket(J3DPacket*);
|
||||
|
||||
inline void clear() {
|
||||
mpNextSibling = NULL;
|
||||
mpFirstChild = NULL;
|
||||
}
|
||||
|
||||
virtual bool entry(J3DDrawBuffer* pDrawBuffer);
|
||||
virtual bool entry(J3DDrawBuffer*);
|
||||
virtual void draw();
|
||||
virtual ~J3DPacket();
|
||||
|
||||
@@ -60,7 +71,7 @@ public:
|
||||
/* 0x04 */ J3DPacket* mpNextSibling;
|
||||
/* 0x08 */ J3DPacket* mpFirstChild;
|
||||
/* 0x0C */ void* mpUserData;
|
||||
}; // Size = 0x10
|
||||
}; // Size: 0x10
|
||||
|
||||
class J3DDrawPacket : public J3DPacket {
|
||||
public:
|
||||
@@ -70,31 +81,37 @@ public:
|
||||
J3DError newSingleDisplayList(u32);
|
||||
virtual void draw();
|
||||
|
||||
J3DDisplayListObj* getDisplayListObj() { return mpDisplayListObj; }
|
||||
void setDisplayListObj(J3DDisplayListObj* pObj) { mpDisplayListObj = pObj; }
|
||||
|
||||
public:
|
||||
int mFlags;
|
||||
char mPad0[0x0C]; // unk
|
||||
J3DDisplayListObj* mpDisplayListObj;
|
||||
J3DTexMtx* mpTexMtx;
|
||||
};
|
||||
/* 0x10 */ u32 mFlags;
|
||||
/* 0x14 */ char mPad0[0x0C]; // unk
|
||||
/* 0x20 */ J3DDisplayListObj* mpDisplayListObj;
|
||||
/* 0x24 */ J3DTexMtx* mpTexMtx;
|
||||
}; // Size: 0x28
|
||||
|
||||
class J3DShapePacket : public J3DDrawPacket {
|
||||
public:
|
||||
J3DShapePacket();
|
||||
void calcDifferedBufferSize(u32);
|
||||
void newDifferedDisplayList(u32);
|
||||
u32 calcDifferedBufferSize(u32);
|
||||
J3DError newDifferedDisplayList(u32);
|
||||
void prepareDraw() const;
|
||||
void drawFast();
|
||||
|
||||
virtual ~J3DShapePacket();
|
||||
virtual void draw();
|
||||
|
||||
void setShape(J3DShape* pShape) { mpShape = pShape; }
|
||||
void setModel(J3DModel* pModel) { mpModel = pModel; }
|
||||
|
||||
public:
|
||||
J3DShape* mpShape;
|
||||
J3DMtxBuffer* mpMtxBuffer;
|
||||
Mtx* mpViewMtx;
|
||||
u32 mDiffFlag;
|
||||
J3DModel* mpModel;
|
||||
};
|
||||
/* 0x28 */ J3DShape* mpShape;
|
||||
/* 0x2C */ J3DMtxBuffer* mpMtxBuffer;
|
||||
/* 0x30 */ Mtx* mpViewMtx;
|
||||
/* 0x34 */ u32 mDiffFlag;
|
||||
/* 0x38 */ J3DModel* mpModel;
|
||||
}; // Size: 0x3C
|
||||
|
||||
class J3DMatPacket : public J3DDrawPacket {
|
||||
public:
|
||||
@@ -102,19 +119,19 @@ public:
|
||||
void addShapePacket(J3DShapePacket*);
|
||||
void beginDiff();
|
||||
void endDiff();
|
||||
void isSame(J3DMatPacket*) const;
|
||||
bool isSame(J3DMatPacket*) const;
|
||||
|
||||
virtual ~J3DMatPacket();
|
||||
virtual bool entry(J3DDrawBuffer* pDrawBuffer);
|
||||
virtual bool entry(J3DDrawBuffer*);
|
||||
virtual void draw();
|
||||
|
||||
public:
|
||||
J3DShapePacket* mpShapePacket;
|
||||
J3DShapePacket* mpFirstShapePacket;
|
||||
J3DMaterial* mpMaterial;
|
||||
s32 mSortFlags;
|
||||
J3DTexture* mpTexture;
|
||||
J3DMaterialAnm* mpMaterialAnm;
|
||||
};
|
||||
/* 0x28 */ J3DShapePacket* mpShapePacket;
|
||||
/* 0x2C */ J3DShapePacket* mpFirstShapePacket;
|
||||
/* 0x30 */ J3DMaterial* mpMaterial;
|
||||
/* 0x34 */ u32 mSortFlags;
|
||||
/* 0x38 */ J3DTexture* mpTexture;
|
||||
/* 0x3C */ J3DMaterialAnm* mpMaterialAnm;
|
||||
}; // Size: 0x40
|
||||
|
||||
#endif /* J3DPACKET_H */
|
||||
|
||||
Reference in New Issue
Block a user