some J3D/misc cleanup (#2628)

* some j3d cleanup

* begin using uintptr_t

* j3dgraphbase cleanup

* j3dgraphanimator cleanup
This commit is contained in:
TakaRikka
2025-09-04 07:56:59 -07:00
committed by GitHub
parent ee8b843996
commit b45a089e15
290 changed files with 4221 additions and 3605 deletions
+28 -23
View File
@@ -33,8 +33,23 @@ class J3DDrawPacket;
class J3DMatPacket;
class J3DShapePacket;
typedef int (J3DDrawBuffer::*sortFunc)(J3DMatPacket*);
typedef void (J3DDrawBuffer::*drawFunc)() const;
enum J3DDrawBufDrawMode {
J3DDrawBufDrawMode_Head,
J3DDrawBufDrawMode_Tail,
J3DDrawBufDrawMode_MAX,
};
enum J3DDrawBufSortMode {
J3DDrawBufSortMode_Mat,
J3DDrawBufSortMode_MatAnm,
J3DDrawBufSortMode_Z,
J3DDrawBufSortMode_Model,
J3DDrawBufSortMode_Invalid,
J3DDrawBufSortMode_Non,
J3DDrawBufSortMode_MAX,
};
/**
* @ingroup jsystem-j3d
@@ -42,24 +57,13 @@ 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,
};
typedef int (J3DDrawBuffer::*sortFunc)(J3DMatPacket*);
typedef void (J3DDrawBuffer::*drawFunc)() const;
J3DDrawBuffer() { initialize(); }
~J3DDrawBuffer();
void initialize();
J3DError allocBuffer(u32);
int allocBuffer(u32);
void frameInit();
int entryMatSort(J3DMatPacket*);
int entryMatAnmSort(J3DMatPacket*);
@@ -72,18 +76,19 @@ public:
void drawHead() const;
void drawTail() const;
u32 getEntryTableSize() { return mBufSize; }
u32 getEntryTableSize() { return mEntryTableSize; }
int getSortMode() { return mSortMode; }
inline void calcZRatio();
void setNonSort() { mSortType = 5; }
void setZSort() { mSortType = 2; }
void setNonSort() { mSortMode = J3DDrawBufSortMode_Non; }
void setZSort() { mSortMode = J3DDrawBufSortMode_Z; }
void setZMtx(MtxP mtx) { mpZMtx = mtx; }
public:
/* 0x00 */ J3DPacket** mpBuf;
/* 0x04 */ u32 mBufSize;
/* 0x08 */ u32 mDrawType;
/* 0x0C */ u32 mSortType;
/* 0x00 */ J3DPacket** mpBuffer;
/* 0x04 */ u32 mEntryTableSize;
/* 0x08 */ u32 mDrawMode;
/* 0x0C */ u32 mSortMode;
/* 0x10 */ f32 mZNear;
/* 0x14 */ f32 mZFar;
/* 0x18 */ f32 mZRatio;
+67
View File
@@ -0,0 +1,67 @@
#ifndef J3DFIFO_H
#define J3DFIFO_H
#include <dolphin/gx.h>
#include <dolphin/gd.h>
inline void J3DFifoLoadBPCmd(u32 regval) {
GXCmd1u8(GX_LOAD_BP_REG);
GXCmd1u32(regval);
}
inline void J3DFifoWriteXFCmdHdr(u16 addr, u8 len) {
GXCmd1u8(GX_LOAD_XF_REG);
GXCmd1u16(len - 1);
GXCmd1u16(addr);
}
inline void J3DFifoLoadIndx(u8 cmd, u16 indx, u16 addr) {
GXWGFifo.u8 = cmd;
GXWGFifo.u16 = indx;
GXWGFifo.u16 = addr;
}
inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
GXWGFifo.u8 = GX_LOAD_CP_REG;
GXWGFifo.u8 = cmd;
GXWGFifo.u32 = param;
}
inline void J3DFifoLoadCPCmd(u8 reg, u32 value) {
GXCmd1u8(GX_LOAD_CP_REG);
GXCmd1u8(reg);
GXCmd1u32(value);
}
inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
GXWGFifo.u8 = GX_LOAD_XF_REG;
GXWGFifo.u16 = (len - 1);
GXWGFifo.u16 = cmd;
}
inline void J3DFifoLoadXFCmdHdr(u16 addr, u8 len) {
GXCmd1u8(GX_LOAD_XF_REG);
GXCmd1u16(len - 1);
GXCmd1u16(addr);
}
inline void J3DFifoLoadPosMtxIndx(u16 index, u32 addr) {
GXCmd1u8(GX_LOAD_INDX_A);
GXCmd1u16(index);
GXCmd1u16(((sizeof(Vec) - 1) << 12) | (u16)(addr * 4));
}
inline void J3DFifoLoadNrmMtxIndx3x3(u16 index, u32 addr) {
GXCmd1u8(GX_LOAD_INDX_B);
GXCmd1u16(index);
GXCmd1u16(((9 - 1) << 12) | (u16)((addr * 3) + 0x400));
}
void J3DFifoLoadPosMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm3x3(f32 (*)[3], u32);
void J3DFifoLoadNrmMtxToTexMtx(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxToTexMtx3x3(f32 (*)[3], u32);
void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize);
#endif /* J3DFIFO_H */
+34 -48
View File
@@ -2,64 +2,62 @@
#define J3DGD_H
#include <dolphin/gx.h>
#include "dolphin/gd/GDBase.h"
#include <dolphin/gd.h>
inline void J3DGDWrite_u8(u8 param) {
__GDWrite(param);
inline void J3DGDWrite_u8(u8 data) {
__GDWrite(data);
}
inline void J3DGDWrite_u16(u16 param) {
__GDWrite((param & 0xffff) >> 8);
__GDWrite(param & 0xff);
inline void J3DGDWrite_u16(u16 data) {
__GDWrite((u8)((data >> 8)));
__GDWrite((u8)((data >> 0) & 0xFF));
}
inline void J3DGDWrite_u32(u32 param) {
__GDWrite((param >> 24) & 0xff);
__GDWrite((param >> 16) & 0xff);
__GDWrite((param >> 8) & 0xff);
__GDWrite(param & 0xff);
inline void J3DGDWrite_u32(u32 data) {
__GDWrite((u8)((data >> 24) & 0xFF));
__GDWrite((u8)((data >> 16) & 0xFF));
__GDWrite((u8)((data >> 8) & 0xFF));
__GDWrite((u8)((data >> 0) & 0xFF));
}
inline void J3DGDWrite_f32(f32 param) {
u32 tmp = *(u32*)&param;
J3DGDWrite_u32(tmp);
inline void J3DGDWrite_f32(f32 data) {
union {
f32 f;
u32 u;
} fid;
fid.f = data;
J3DGDWrite_u32(fid.u);
}
inline void J3DGDWriteBPCmd(u32 cmd) {
J3DGDWrite_u8(0x61);
J3DGDWrite_u32(cmd);
inline void J3DGDWriteBPCmd(u32 regval) {
J3DGDWrite_u8(GX_LOAD_BP_REG);
J3DGDWrite_u32(regval);
}
inline void J3DFifoLoadBPCmd(u32 cmd) {
GXWGFifo.u8 = 0x61;
GXWGFifo.u32 = cmd;
}
inline void J3DGDWriteXFCmd(u16 addr, u32 cmd) {
J3DGDWrite_u8(0x10);
inline void J3DGDWriteXFCmd(u16 addr, u32 val) {
J3DGDWrite_u8(GX_LOAD_XF_REG);
J3DGDWrite_u16(0);
J3DGDWrite_u16(addr);
J3DGDWrite_u32(cmd);
J3DGDWrite_u32(val);
}
inline void J3DGDWriteXFCmdHdr(u16 addr, u8 len) {
J3DGDWrite_u8(0x10);
J3DGDWrite_u8(GX_LOAD_XF_REG);
J3DGDWrite_u16(len - 1);
J3DGDWrite_u16(addr);
}
inline void J3DFifoWriteXFCmdHdr(u16 addr, u8 len) {
GXWGFifo.u8 = 0x10;
GXWGFifo.u16 = len - 1;
GXWGFifo.u16 = addr;
inline void J3DGXCmd1f32ptr(f32* data) {
GXCmd1u32(*(u32*)data);
}
inline void J3DGXCmd1f32ptr(f32* value) {
GXWGFifo.u32 = *(u32*)value;
}
inline void J3DGXCmd1f32(f32 value) {
GXWGFifo.u32 = *(u32*)&value;
inline void J3DGXCmd1f32(f32 data) {
union {
f32 f;
u32 u;
} fid;
fid.f = data;
GXCmd1u32(fid.u);
}
inline void J3DGDWriteCPCmd(u8 reg, u32 value) {
@@ -96,18 +94,6 @@ void J3DGDSetTevKColor(GXTevKColorID, GXColor);
void J3DGDSetTevColorS10(GXTevRegID, GXColorS10);
void J3DGDSetFog(GXFogType, f32, f32, f32, f32, GXColor);
void J3DGDSetFogRangeAdj(u8, u16, _GXFogAdjTable*);
void J3DFifoLoadPosMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm3x3(f32 (*)[3], u32);
void J3DFifoLoadNrmMtxToTexMtx(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxToTexMtx3x3(f32 (*)[3], u32);
void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize);
static inline void J3DFifoLoadIndx(u8 cmd, u16 indx, u16 addr) {
GXWGFifo.u8 = cmd;
GXWGFifo.u16 = indx;
GXWGFifo.u16 = addr;
}
inline void J3DGDSetNumChans(u8 numChans) {
J3DGDWriteXFCmd(0x1009, numChans);
File diff suppressed because it is too large Load Diff
+17 -2
View File
@@ -4,7 +4,7 @@
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DShape.h"
#include "dolphin/types.h"
#include <stdint.h>
class J3DJoint;
class J3DMaterialAnm;
@@ -56,7 +56,7 @@ public:
J3DIndBlock* getIndBlock() { return mIndBlock; }
J3DJoint* getJoint() { return mJoint; }
J3DMaterialAnm* getMaterialAnm() {
if ((u32)mMaterialAnm < 0xC0000000) {
if ((uintptr_t)mMaterialAnm < 0xC0000000) {
return mMaterialAnm;
} else {
return NULL;
@@ -89,6 +89,21 @@ public:
void setZCompLoc(u8 i_comploc) { mPEBlock->setZCompLoc(i_comploc); }
void setMaterialMode(u32 i_mode) { mMaterialMode = i_mode; }
void addShape(J3DShape* pShape) {
J3D_ASSERT_NULLPTR(618, pShape != NULL);
mShape = pShape;
}
void setNext(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(623, pMaterial != NULL);
mNext = pMaterial;
}
void setJoint(J3DJoint* pJoint) {
J3D_ASSERT_NULLPTR(628, pJoint != NULL);
mJoint = pJoint;
}
public:
/* 0x04 */ J3DMaterial* mNext;
/* 0x08 */ J3DShape* mShape;
+75 -37
View File
@@ -3,6 +3,7 @@
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "dolphin/gd/GDBase.h"
#include <stdint.h>
class J3DMatPacket;
@@ -16,27 +17,42 @@ class J3DTexMtx;
class J3DTexMtxObj;
class J3DTexture;
inline u32 getDiffFlag_LightObjNum(u32 param_1) {
return (param_1 & 0xf0) >> 4;
enum J3DDiffFlag {
J3DDiffFlag_MatColor = 0x1,
J3DDiffFlag_ColorChan = 0x2,
J3DDiffFlag_AmbColor = 0x4,
J3DDiffFlag_TexGen = 0x1000,
J3DDiffFlag_TevReg = 0x1000000,
J3DDiffFlag_KonstColor = 0x2000000, // is this right?
J3DDiffFlag_TexCoordScale = 0x4000000,
J3DDiffFlag_TevStageIndirect = 0x8000000,
J3DDiffFlag_Fog = 0x10000000,
J3DDiffFlag_Blend = 0x20000000,
J3DDiffFlag_Unk40000000 = 0x40000000,
J3DDiffFlag_Changed = 0x80000000,
};
inline u32 getDiffFlag_LightObjNum(u32 diffFlags) {
return (diffFlags & 0xf0) >> 4;
}
inline u32 getDiffFlag_TexGenNum(u32 param_1) {
return (param_1 & 0xf00) >> 8;
inline u32 getDiffFlag_TexGenNum(u32 diffFlags) {
return (diffFlags & 0xf00) >> 8;
}
inline int calcDifferedBufferSize_TexMtxSize(int param_1) {
inline int calcDifferedBufferSize_TexMtxSize(u32 param_1) {
return param_1 * 0x35;
}
inline int calcDifferedBufferSize_TexGenSize(int param_1) {
inline int calcDifferedBufferSize_TexGenSize(u32 param_1) {
return param_1 * 0x3d + 10;
}
inline u32 getDiffFlag_TexNoNum(u32 param_1) {
return (param_1 & 0xf0000) >> 0x10;
inline u32 getDiffFlag_TexNoNum(u32 diffFlags) {
return (diffFlags & 0xf0000) >> 0x10;
}
inline int calcDifferedBufferSize_TexNoSize(int param_1) {
inline int calcDifferedBufferSize_TexNoSize(u32 param_1) {
return param_1 * 0x37;
}
@@ -46,15 +62,15 @@ inline u32 calcDifferedBufferSize_TexNoAndTexCoordScaleSize(u32 param_1) {
return res;
}
inline u32 getDiffFlag_TevStageNum(u32 param_1) {
return (param_1 & 0xf00000) >> 0x14;
inline u32 getDiffFlag_TevStageNum(u32 diffFlags) {
return (diffFlags & 0xf00000) >> 0x14;
}
inline int calcDifferedBufferSize_TevStageSize(int param_1) {
inline int calcDifferedBufferSize_TevStageSize(u32 param_1) {
return param_1 * 10;
}
inline int calcDifferedBufferSize_TevStageDirectSize(int param_1) {
inline int calcDifferedBufferSize_TevStageDirectSize(u32 param_1) {
return param_1 * 5;
}
@@ -65,15 +81,15 @@ inline int calcDifferedBufferSize_TevStageDirectSize(int param_1) {
class J3DDisplayListObj {
public:
J3DDisplayListObj() {
mpData[0] = NULL;
mpData[1] = NULL;
mpDisplayList[0] = NULL;
mpDisplayList[1] = NULL;
mSize = 0;
mCapacity = 0;
mMaxSize = 0;
}
J3DError newDisplayList(u32);
J3DError newSingleDisplayList(u32);
J3DError single_To_Double();
int single_To_Double();
void setSingleDisplayList(void*, u32);
void swapBuffer();
void callDL() const;
@@ -82,15 +98,15 @@ public:
void beginPatch();
u32 endPatch();
u8* getDisplayList(int idx) const { return (u8*)mpData[idx]; }
u32 getDisplayListSize() const { return mSize; }
u8* getDisplayList(int idx) { return (u8*)mpDisplayList[idx]; }
u32 getDisplayListSize() { return mSize; }
static GDLObj sGDLObj;
static s32 sInterruptFlag;
/* 0x0 */ void* mpData[2];
/* 0x0 */ void* mpDisplayList[2];
/* 0x8 */ u32 mSize;
/* 0xC */ u32 mCapacity;
/* 0xC */ u32 mMaxSize;
}; // Size: 0x10
/**
@@ -102,7 +118,7 @@ public:
J3DPacket() {
mpNextPacket = NULL;
mpFirstChild = NULL;
mpUserData = NULL;
mpUserArea = NULL;
}
void addChildPacket(J3DPacket*);
@@ -115,8 +131,8 @@ public:
mpFirstChild = NULL;
}
void* getUserArea() { return mpUserData; }
void setUserArea(u32 area) { mpUserData = (void*)area; }
void* getUserArea() const { return mpUserArea; }
void setUserArea(uintptr_t area) { mpUserArea = (void*)area; }
virtual int entry(J3DDrawBuffer*);
virtual void draw();
@@ -125,7 +141,7 @@ public:
public:
/* 0x04 */ J3DPacket* mpNextPacket;
/* 0x08 */ J3DPacket* mpFirstChild;
/* 0x0C */ void* mpUserData;
/* 0x0C */ void* mpUserArea;
}; // Size: 0x10
/**
@@ -140,29 +156,34 @@ public:
J3DError newSingleDisplayList(u32);
virtual void draw();
J3DDisplayListObj* getDisplayListObj() const { return mpDisplayListObj; }
J3DDisplayListObj* getDisplayListObj() { return mpDisplayListObj; }
void setDisplayListObj(J3DDisplayListObj* pObj) { mpDisplayListObj = pObj; }
void beginPatch() { mpDisplayListObj->beginPatch(); }
void endPatch() { mpDisplayListObj->endPatch(); }
void callDL() const { getDisplayListObj()->callDL(); }
void callDL() const { mpDisplayListObj->callDL(); }
void beginDL() { mpDisplayListObj->beginDL(); }
void endDL() { mpDisplayListObj->endDL(); }
void* getDisplayList(int i) { return mpDisplayListObj->mpDisplayList[i]; }
u32 getDisplayListSize() const { return mpDisplayListObj->mSize; }
enum {
LOCKED = 0x01,
};
bool checkFlag(u32 flag) const { return (mFlags & flag) != 0; }
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
void lock() { onFlag(LOCKED); }
void unlock() { offFlag(LOCKED); }
J3DTexMtxObj* getTexMtxObj() const { return mpTexMtxObj; }
J3DTexMtxObj* getTexMtxObj() { return mpTexMtxObj; }
bool isLocked() const { return checkFlag(1); }
public:
/* 0x10 */ u32 mFlags;
/* 0x14 */ char mPad0[0x0C]; // unk
/* 0x14 */ char unk_0x14[0x20 - 0x14];
/* 0x20 */ J3DDisplayListObj* mpDisplayListObj;
/* 0x24 */ J3DTexMtxObj* mpTexMtxObj;
}; // Size: 0x28
@@ -175,15 +196,23 @@ class J3DShapePacket : public J3DDrawPacket {
public:
J3DShapePacket();
u32 calcDifferedBufferSize(u32);
J3DError newDifferedDisplayList(u32);
int newDifferedDisplayList(u32);
void prepareDraw() const;
void drawFast();
virtual ~J3DShapePacket();
virtual void draw();
void setShape(J3DShape* pShape) { mpShape = pShape; }
void setModel(J3DModel* pModel) { mpModel = pModel; }
void setShape(J3DShape* pShape) {
J3D_ASSERT_NULLPTR(523, pShape != NULL);
mpShape = pShape;
}
void setModel(J3DModel* pModel) {
J3D_ASSERT_NULLPTR(533, pModel != NULL);
mpModel = pModel;
}
void setMtxBuffer(J3DMtxBuffer* pMtxBuffer) { mpMtxBuffer = pMtxBuffer; }
void setBaseMtxPtr(Mtx* pMtx) { mpBaseMtxPtr = pMtx; }
@@ -214,13 +243,22 @@ public:
J3DMaterial* getMaterial() const { return mpMaterial; }
J3DShapePacket* getShapePacket() const { return mpShapePacket; }
void setShapePacket(J3DShapePacket* packet) { mpShapePacket = packet; }
void setMaterial(J3DMaterial* pMaterial) { mpMaterial = pMaterial; }
void setTexture(J3DTexture* pTexture) { mpTexture = pTexture; }
void setMaterial(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(646, pMaterial != NULL);
mpMaterial = pMaterial;
}
void setTexture(J3DTexture* pTexture) {
J3D_ASSERT_NULLPTR(651, pTexture != NULL);
mpTexture = pTexture;
}
void setInitShapePacket(J3DShapePacket* packet) { mpInitShapePacket = packet; }
void setMaterialID(u32 id) { mDiffFlag = id; }
void setMaterialAnmID(J3DMaterialAnm* materialAnm) { mpMaterialAnm = materialAnm; }
bool isChanged() const { return mDiffFlag & 0x80000000; }
bool isEnabled_Diff() const { return mpInitShapePacket->getDisplayListObj() != NULL; }
BOOL isChanged() { return mDiffFlag & J3DDiffFlag_Changed; }
bool isEnabled_Diff() { return mpInitShapePacket->getDisplayListObj() != NULL; }
virtual ~J3DMatPacket();
virtual int entry(J3DDrawBuffer*);
+141 -127
View File
@@ -2,9 +2,9 @@
#define J3DSHAPE_H
#include "JSystem/J3DGraphBase/J3DShapeDraw.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/gx.h"
#include "mtx.h"
#include "JSystem/J3DAssert.h"
#include "JSystem/J3DGraphBase/J3DFifo.h"
#include <dolphin/mtx.h>
class J3DShapeMtx;
@@ -18,18 +18,6 @@ public:
u32 mMtxIdxRegB;
};
static inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
GXWGFifo.u8 = GX_LOAD_CP_REG;
GXWGFifo.u8 = cmd;
GXWGFifo.u32 = param;
}
static inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
GXWGFifo.u8 = GX_LOAD_XF_REG;
GXWGFifo.u16 = (len - 1);
GXWGFifo.u16 = cmd;
}
/**
* @ingroup jsystem-j3d
*
@@ -50,10 +38,10 @@ public:
u32 getMtxIdxRegA() const { return mMtxIdxRegA; }
u32 getMtxIdxRegB() const { return mMtxIdxRegB; }
inline void load() const {
J3DFifoWriteCPCmd(0x30, mMtxIdxRegA); // CP_MATINDEX_A
J3DFifoWriteCPCmd(0x40, mMtxIdxRegB); // CP_MATINDEX_B
J3DFifoWriteXFCmd(0x1018, 2);
void load() const {
J3DFifoLoadCPCmd(CP_REG_MTXIDXA_ID, mMtxIdxRegA);
J3DFifoLoadCPCmd(CP_REG_MTXIDXB_ID, mMtxIdxRegB);
J3DFifoLoadXFCmdHdr(GX_XF_REG_MATRIXINDEX0, 2);
GXCmd1u32(mMtxIdxRegA);
GXCmd1u32(mMtxIdxRegB);
}
@@ -65,110 +53,6 @@ public:
}
};
class J3DMaterial;
class J3DVertexData;
class J3DDrawMtxData;
enum J3DShpFlag {
J3DShpFlag_Visible = 0x0001,
J3DShpFlag_SkinPosCpu = 0x0004,
J3DShpFlag_SkinNrmCpu = 0x0008,
J3DShpFlag_Hidden = 0x0010,
J3DShpFlag_EnableLod = 0x0100,
J3DShpFlag_NoMtx = 0x0200,
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShape {
public:
J3DShape() {
initialize();
}
enum {
kVcdVatDLSize = 0xC0,
};
/* 80314B48 */ void initialize();
/* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32);
/* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr);
/* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
/* 80314E28 */ u16 countBumpMtxNum() const;
/* 80314EEC */ void loadVtxArray() const;
/* 80314F5C */ bool isSameVcdVatCmd(J3DShape*);
/* 80314F98 */ void makeVtxArrayCmd();
/* 80315260 */ void makeVcdVatCmd();
/* 80315300 */ void loadPreDrawSetting() const;
/* 80315398 */ void setArrayAndBindPipeline() const;
/* 803155E0 */ virtual void draw() const;
/* 8031544C */ virtual void drawFast() const;
/* 80315628 */ virtual void simpleDraw() const;
/* 803156AC */ virtual void simpleDrawCache() const;
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) const { return !!(mFlags & flag); }
void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) { mDrawMtxData = pMtxData; }
void setVertexDataPointer(J3DVertexData* pVtxData) { mVertexData = pVtxData; }
void* getVcdVatCmd() { return mVcdVatCmd; }
void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = (u8*)pVatCmd; }
void show() { offFlag(J3DShpFlag_Visible); }
void hide() { onFlag(J3DShpFlag_Visible); }
void setCurrentViewNoPtr(u32* pViewNoPtr) { mCurrentViewNo = pViewNoPtr; }
void setCurrentMtx(J3DCurrentMtx& mtx) { mCurrentMtx = mtx; }
void setScaleFlagArray(u8* pScaleFlagArray) { mScaleFlagArray = pScaleFlagArray; }
void setDrawMtx(Mtx** pDrawMtx) { mDrawMtx = pDrawMtx; }
void setNrmMtx(Mtx33** pNrmMtx) { mNrmMtx = pNrmMtx; }
void setTexMtxLoadType(u32 type) { mFlags = (mFlags & 0xFFFF0FFF) | type; }
bool getNBTFlag() const { return mHasNBT; }
u32 getBumpMtxOffset() const { return mBumpMtxOffset; }
void setBumpMtxOffset(u32 offset) { mBumpMtxOffset = offset; }
GXVtxDescList* getVtxDesc() { return mVtxDesc; }
J3DMaterial* getMaterial() const { return mMaterial; }
u16 getIndex() const { return mIndex; }
u32 getTexMtxLoadType() const { return mFlags & 0xF000; }
u32 getMtxGroupNum() const { return mMtxGroupNum; }
J3DShapeDraw* getShapeDraw(u16 idx) { return mShapeDraw[idx]; }
J3DShapeMtx* getShapeMtx(u16 idx) { return mShapeMtx[idx]; }
Vec* getMin() { return &mMin; }
Vec* getMax() { return &mMax; }
static void resetVcdVatCache() { sOldVcdVatCmd = NULL; }
static void* sOldVcdVatCmd;
private:
friend struct J3DShapeFactory;
friend class J3DJointTree;
/* 0x04 */ J3DMaterial* mMaterial;
/* 0x08 */ u16 mIndex;
/* 0x0A */ u16 mMtxGroupNum;
/* 0x0C */ u32 mFlags;
/* 0x10 */ f32 mRadius;
/* 0x14 */ Vec mMin;
/* 0x20 */ Vec mMax;
/* 0x2C */ u8* mVcdVatCmd;
/* 0x30 */ GXVtxDescList* mVtxDesc;
/* 0x34 */ bool mHasNBT;
/* 0x38 */ J3DShapeMtx** mShapeMtx;
/* 0x3C */ J3DShapeDraw** mShapeDraw;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ bool mHasPNMTXIdx;
/* 0x4C */ J3DVertexData* mVertexData;
/* 0x50 */ J3DDrawMtxData* mDrawMtxData;
/* 0x54 */ u8* mScaleFlagArray;
/* 0x58 */ Mtx** mDrawMtx;
/* 0x5C */ Mtx33** mNrmMtx;
/* 0x60 */ u32* mCurrentViewNo;
/* 0x64 */ u32 mBumpMtxOffset;
};
typedef void (J3DShapeMtx::*J3DShapeMtx_LoadFunc)(int, u16) const;
/**
@@ -197,15 +81,16 @@ public:
static u16 sMtxLoadCache[10];
static u32 sCurrentPipeline;
static u8* sCurrentScaleFlag;
static u8 sNBTFlag;
static u8 sLODFlag;
static bool sNBTFlag;
static bool sLODFlag;
static u32 sTexMtxLoadType;
static void setCurrentPipeline(u32 pipeline) {
J3D_ASSERT(91, pipeline < 4, "Error : range over.");
J3D_ASSERT_RANGE(91, pipeline < 4);
sCurrentPipeline = pipeline;
}
static void setLODFlag(u8 flag) { sLODFlag = flag; }
static void setLODFlag(bool flag) { sLODFlag = flag; }
static u32 getLODFlag() { return sLODFlag; }
static void resetMtxLoadCache();
@@ -213,4 +98,133 @@ protected:
/* 0x04 */ u16 mUseMtxIndex;
};
class J3DMaterial;
class J3DVertexData;
class J3DDrawMtxData;
enum J3DShpFlag {
J3DShpFlag_Visible = 0x0001,
J3DShpFlag_SkinPosCpu = 0x0004,
J3DShpFlag_SkinNrmCpu = 0x0008,
J3DShpFlag_Hidden = 0x0010,
J3DShpFlag_EnableLod = 0x0100,
J3DShpFlag_NoMtx = 0x0200,
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShape {
public:
J3DShape() {
initialize();
}
static const int kVcdVatDLSize = 0xC0;
/* 80314B48 */ void initialize();
/* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32);
/* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr);
/* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
/* 80314E28 */ u16 countBumpMtxNum() const;
/* 80314EEC */ void loadVtxArray() const;
/* 80314F5C */ bool isSameVcdVatCmd(J3DShape*);
/* 80314F98 */ void makeVtxArrayCmd();
/* 80315260 */ void makeVcdVatCmd();
/* 80315300 */ void loadPreDrawSetting() const;
/* 80315398 */ void setArrayAndBindPipeline() const;
/* 803155E0 */ virtual void draw() const;
/* 8031544C */ virtual void drawFast() const;
/* 80315628 */ virtual void simpleDraw() const;
/* 803156AC */ virtual void simpleDrawCache() const;
void loadCurrentMtx() const;
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) const { return (mFlags & flag) != 0; }
void setMaterial(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(509, pMaterial != NULL);
mMaterial = pMaterial;
}
void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) {
J3D_ASSERT_NULLPTR(554, pMtxData != NULL);
mDrawMtxData = pMtxData;
}
void setVertexDataPointer(J3DVertexData* pVtxData) {
J3D_ASSERT_NULLPTR(657, pVtxData != NULL);
mVertexData = pVtxData;
}
void* getVcdVatCmd() { return mVcdVatCmd; }
void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = (u8*)pVatCmd; }
void show() { offFlag(J3DShpFlag_Visible); }
void hide() { onFlag(J3DShpFlag_Visible); }
void setCurrentViewNoPtr(u32* pViewNoPtr) {
J3D_ASSERT_NULLPTR(584, pViewNoPtr != NULL);
mCurrentViewNo = pViewNoPtr;
}
void setCurrentMtx(J3DCurrentMtx& mtx) { mCurrentMtx = mtx; }
void setScaleFlagArray(u8* pScaleFlagArray) {
J3D_ASSERT_NULLPTR(595, pScaleFlagArray != NULL);
mScaleFlagArray = pScaleFlagArray;
}
void setDrawMtx(Mtx** pDrawMtx) { mDrawMtx = pDrawMtx; }
void setNrmMtx(Mtx33** pNrmMtx) { mNrmMtx = pNrmMtx; }
void setTexMtxLoadType(u32 type) { mFlags = (mFlags & 0xFFFF0FFF) | type; }
bool getNBTFlag() const { return mHasNBT; }
u32 getBumpMtxOffset() const { return mBumpMtxOffset; }
void setBumpMtxOffset(u32 offset) { mBumpMtxOffset = offset; }
GXVtxDescList* getVtxDesc() { return mVtxDesc; }
J3DMaterial* getMaterial() const { return mMaterial; }
u16 getIndex() const { return mIndex; }
u32 getTexMtxLoadType() const { return mFlags & 0xF000; }
u32 getMtxGroupNum() const { return mMtxGroupNum; }
J3DShapeDraw* getShapeDraw(u16 idx) { return mShapeDraw[idx]; }
J3DShapeMtx* getShapeMtx(u16 idx) { return mShapeMtx[idx]; }
Vec* getMin() { return &mMin; }
Vec* getMax() { return &mMax; }
static void resetVcdVatCache() { sOldVcdVatCmd = NULL; }
static void* sOldVcdVatCmd;
static bool sEnvelopeFlag;
private:
friend struct J3DShapeFactory;
friend class J3DJointTree;
/* 0x04 */ J3DMaterial* mMaterial;
/* 0x08 */ u16 mIndex;
/* 0x0A */ u16 mMtxGroupNum;
/* 0x0C */ u32 mFlags;
/* 0x10 */ f32 mRadius;
/* 0x14 */ Vec mMin;
/* 0x20 */ Vec mMax;
/* 0x2C */ u8* mVcdVatCmd;
/* 0x30 */ GXVtxDescList* mVtxDesc;
/* 0x34 */ bool mHasNBT;
/* 0x38 */ J3DShapeMtx** mShapeMtx;
/* 0x3C */ J3DShapeDraw** mShapeDraw;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ bool mHasPNMTXIdx;
/* 0x4C */ J3DVertexData* mVertexData;
/* 0x50 */ J3DDrawMtxData* mDrawMtxData;
/* 0x54 */ u8* mScaleFlagArray;
/* 0x58 */ Mtx** mDrawMtx;
/* 0x5C */ Mtx33** mNrmMtx;
/* 0x60 */ u32* mCurrentViewNo;
/* 0x64 */ u32 mBumpMtxOffset;
};
#endif /* J3DSHAPE_H */
+11 -4
View File
@@ -2,6 +2,7 @@
#define J3DSHAPEMTX_H
#include "JSystem/J3DGraphBase/J3DShape.h"
#include "JSystem/J3DAssert.h"
#include "dolphin/mtx.h"
class J3DTexMtx;
@@ -14,15 +15,21 @@ class J3DTexGenBlock;
class J3DTexMtxObj {
public:
Mtx& getMtx(u16 idx) {
J3D_ASSERT(0x113, idx <= mTexMtxNum, "Error : range over");
J3D_ASSERT_RANGE(275, idx < mTexMtxNum);
return mpTexMtx[idx];
}
void setMtx(u16 idx, const Mtx mtx) {
J3D_ASSERT_RANGE(288, idx < mTexMtxNum);
MTXCopy(mtx, mpTexMtx[idx]);
}
Mtx44& getEffectMtx(u16 idx) {
J3D_ASSERT(0x125, idx <= mTexMtxNum, "Error : range over");
J3D_ASSERT_RANGE(293, idx < mTexMtxNum);
return mpEffectMtx[idx];
}
u16 getNumTexMtx() const { return mTexMtxNum; }
void setMtx(u16 idx, Mtx const* mtx) { MTXCopy(*mtx, mpTexMtx[idx]); }
/* 0x00 */ Mtx* mpTexMtx;
/* 0x04 */ Mtx44* mpEffectMtx;
@@ -37,7 +44,7 @@ class J3DDifferedTexMtx {
public:
/* 8031322C */ static void loadExecute(f32 const (*)[4]);
static inline void load(Mtx m) {
static inline void load(const Mtx m) {
if (sTexGenBlock != NULL)
loadExecute(m);
}
+1 -1
View File
@@ -142,7 +142,7 @@ struct J3DFogInfo {
struct J3DNBTScaleInfo {
/* 8032587C */ J3DNBTScaleInfo& operator=(J3DNBTScaleInfo const&);
/* 0x0 */ bool mbHasScale;
/* 0x0 */ u8 mbHasScale;
/* 0x4 */ Vec mScale;
}; // Size: 0x10
+44 -37
View File
@@ -3,7 +3,7 @@
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/J3DAssert.h"
// Perhaps move to a new J3DEnum.h?
enum J3DError {
@@ -11,9 +11,11 @@ enum J3DError {
kJ3DError_Alloc = 4,
};
enum J3DSysDrawBuffer {
/* 0x0 */ J3DSys_OPA_BUFFER_e,
/* 0x1 */ J3DSys_XLU_BUFFER_e
enum J3DSysDrawBuf {
/* 0x0 */ J3DSysDrawBuf_Opa,
/* 0x1 */ J3DSysDrawBuf_Xlu,
/* 0x2 */ J3DSysDrawBuf_MAX
};
class J3DMtxCalc;
@@ -53,25 +55,25 @@ struct J3DSys {
/* 0x03C */ J3DMatPacket* mMatPacket;
/* 0x040 */ J3DShapePacket* mShapePacket;
/* 0x044 */ J3DShape* mShape;
/* 0x048 */ J3DDrawBuffer* mDrawBuffer[2];
/* 0x048 */ J3DDrawBuffer* mDrawBuffer[J3DSysDrawBuf_MAX];
/* 0x050 */ u32 mDrawMode;
/* 0x054 */ u32 mMaterialMode;
/* 0x058 */ J3DTexture* mTexture;
/* 0x05C */ u8 field_0x5c[0x04];
/* 0x05C */ u8 unk_0x5c[0x60 - 0x5C];
/* 0x060 */ u32 mTexCacheRegionNum;
/* 0x064 */ GXTexRegion mTexCacheRegion[8];
/* 0x0E4 */ u8 field_0xe4[0x20];
/* 0x0E4 */ u8 unk_0xe4[0x104 - 0xE4];
/* 0x104 */ Mtx* mModelDrawMtx;
/* 0x108 */ Mtx33* mModelNrmMtx;
/* 0x10C */ void* mVtxPos;
/* 0x110 */ void* mVtxNrm;
/* 0x114 */ _GXColor* mVtxCol;
/* 0x114 */ GXColor* mVtxCol;
/* 0x118 */ Vec* mNBTScale;
/* 8030FDE8 */ J3DSys();
/* 8030FEC0 */ void loadPosMtxIndx(int, u16) const;
/* 8030FEE4 */ void loadNrmMtxIndx(int, u16) const;
/* 8030FF0C */ void setTexCacheRegion(_GXTexCacheSize);
/* 8030FF0C */ void setTexCacheRegion(GXTexCacheSize);
/* 803100BC */ void drawInit();
/* 8031073C */ void reinitGX();
/* 8031079C */ void reinitGenMode();
@@ -82,16 +84,15 @@ struct J3DSys {
/* 80310D44 */ void reinitIndStages();
/* 80310E3C */ void reinitPixelProc();
enum DrawMode {
/* 0x3 */ OPA_TEX_EDGE = 3,
/* 0x4 */ XLU,
enum J3DSysDrawMode {
J3DSysDrawMode_OpaTexEdge = 3,
J3DSysDrawMode_Xlu
};
MtxP getViewMtx() { return mViewMtx; }
void setDrawModeOpaTexEdge() { mDrawMode = OPA_TEX_EDGE; }
void setDrawModeXlu() { mDrawMode = XLU; }
void setDrawModeOpaTexEdge() { mDrawMode = J3DSysDrawMode_OpaTexEdge; }
void setDrawModeXlu() { mDrawMode = J3DSysDrawMode_Xlu; }
void* getVtxPos() { return mVtxPos; }
void setVtxPos(void* pVtxPos) { mVtxPos = pVtxPos; }
@@ -99,15 +100,35 @@ struct J3DSys {
void* getVtxNrm() { return mVtxNrm; }
void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; }
void* getVtxCol() const { return mVtxCol; }
void setVtxCol(_GXColor* pVtxCol) { mVtxCol = pVtxCol; }
void* getVtxCol() { return mVtxCol; }
void setVtxCol(GXColor* pVtxCol) { mVtxCol = pVtxCol; }
void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
J3D_ASSERT_RANGE(114, type >= 0 && type < J3DSysDrawBuf_MAX);
J3D_ASSERT_NULLPTR(115, buffer);
mDrawBuffer[type] = buffer;
}
J3DDrawBuffer* getDrawBuffer(int type) {
J3D_ASSERT_RANGE(121, type >= 0 && type < J3DSysDrawBuf_MAX);
return mDrawBuffer[type];
}
void setMatPacket(J3DMatPacket* pPacket) {
J3D_ASSERT_NULLPTR(162, pPacket != NULL);
mMatPacket = pPacket;
}
void setShapePacket(J3DShapePacket* pPacket) {
J3D_ASSERT_NULLPTR(172, pPacket != NULL);
mShapePacket = pPacket;
}
void setModel(J3DModel* pModel) {
J3D_ASSERT(200, pModel, "Error : null pointer.");
J3D_ASSERT_NULLPTR(200, pModel != NULL);
mModel = pModel;
}
void setShapePacket(J3DShapePacket* pPacket) { mShapePacket = pPacket; }
void setMatPacket(J3DMatPacket* pPacket) { mMatPacket = pPacket; }
J3DMatPacket* getMatPacket() { return mMatPacket; }
void setMaterialMode(u32 mode) { mMaterialMode = mode; }
@@ -124,34 +145,20 @@ struct J3DSys {
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) { return mFlags & flag; }
bool checkFlag(u32 flag) { return mFlags & flag ? true : false; }
void setModelDrawMtx(Mtx* pMtxArr) {
J3D_ASSERT_NULLPTR(230, pMtxArr);
mModelDrawMtx = pMtxArr;
GXSetArray(GX_POS_MTX_ARRAY, mModelDrawMtx, sizeof(*mModelDrawMtx));
}
void setModelNrmMtx(Mtx33* pMtxArr) {
JUT_ASSERT_MSG(241, pMtxArr, "Error : null pointer.");
J3D_ASSERT_NULLPTR(241, pMtxArr);
mModelNrmMtx = pMtxArr;
GXSetArray(GX_NRM_MTX_ARRAY, mModelNrmMtx, sizeof(*mModelNrmMtx));
}
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
J3D_ASSERT(114, type >= 0 && type < 2, "Error : range over.");
J3D_ASSERT(115, buffer, "Error : null pointer.");
mDrawBuffer[type] = buffer;
}
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
J3DDrawBuffer* getDrawBuffer(int type) {
J3D_ASSERT(121, type >= 0 && type < 2, "Error : range over.");
return mDrawBuffer[type];
}
Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; }
J3DShapePacket* getShapePacket() { return mShapePacket; }
+30
View File
@@ -153,6 +153,16 @@ struct J3DTevStage {
return *this;
}
J3DTevStage& operator=(J3DTevStage& other) {
mTevColorOp = other.mTevColorOp;
mTevColorAB = other.mTevColorAB;
mTevColorCD = other.mTevColorCD;
mTevAlphaOp = other.mTevAlphaOp;
mTevAlphaAB = other.mTevAlphaAB;
mTevSwapModeInfo = other.mTevSwapModeInfo;
return *this;
}
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 mTevColorOp;
/* 0x2 */ u8 mTevColorAB;
@@ -214,6 +224,16 @@ struct J3DIndTevStage {
J3DGDWriteBPCmd(mInfo | (param_1 + 0x10) * 0x1000000);
}
J3DIndTevStage& operator=(const J3DIndTevStage& other) {
mInfo = other.mInfo;
return *this;
}
J3DIndTevStage& operator=(J3DIndTevStage& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x0 */ u32 mInfo;
};
@@ -264,6 +284,11 @@ struct J3DTevSwapModeTable {
return *this;
}
J3DTevSwapModeTable& operator=(J3DTevSwapModeTable& other) {
mIdx = other.mIdx;
return *this;
}
u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
return 0x40 * param_0 + 0x10 * param_1 + 4 * param_2 + param_3;
}
@@ -281,6 +306,7 @@ extern const GXColor j3dDefaultAmbInfo;
extern const GXColorS10 j3dDefaultTevColor;
extern const GXColor j3dDefaultTevKColor;
extern u8 j3dAlphaCmpTable[768];
extern const u8 j3dDefaultNumChans;
struct J3DNBTScale;
struct J3DTexCoord;
@@ -290,5 +316,9 @@ void loadTexNo(u32 param_0, u16 const& param_1);
void patchTexNo_PtrToIdx(u32 texID, u16 const& idx);
bool isTexNoReg(void* param_0);
u16 getTexNoReg(void* param_0);
void makeTexCoordTable();
void makeAlphaCmpTable();
void makeZModeTable();
void makeTevSwapTable();
#endif /* J3DTEVS_H */
+18 -13
View File
@@ -2,9 +2,9 @@
#define J3DTEXTURE_H
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/J3DAssert.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/types.h"
#include <stdint.h>
/**
* @ingroup jsystem-j3d
@@ -13,25 +13,28 @@
class J3DTexture {
private:
/* 0x0 */ u16 mNum;
/* 0x2 */ u16 field_0x2;
/* 0x2 */ u16 unk_0x2;
/* 0x4 */ ResTIMG* mpRes;
public:
J3DTexture(u16 num, ResTIMG* res) : mNum(num), field_0x2(0), mpRes(res) {}
/* 8031204C */ void loadGX(u16, _GXTexMapID) const;
J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {}
/* 8031204C */ void loadGX(u16, GXTexMapID) const;
/* 803121A4 */ void entryNum(u16);
/* 8031221C */ void addResTIMG(u16, ResTIMG const*);
/* 803366A4 */ virtual ~J3DTexture() {}
u16 getNum() const { return mNum; }
ResTIMG* getResTIMG(u16 entry) const {
J3D_ASSERT(72, entry < mNum, "Error : range over.");
return &mpRes[entry];
ResTIMG* getResTIMG(u16 index) const {
J3D_ASSERT_RANGE(72, index < mNum);
return &mpRes[index];
}
void setResTIMG(u16 entry, const ResTIMG& timg) {
mpRes[entry] = timg;
mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry)));
mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset + (u32)&timg - (u32)(mpRes + entry)));
void setResTIMG(u16 index, const ResTIMG& timg) {
mpRes[index] = timg;
mpRes[index].imageOffset = ((mpRes[index].imageOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
mpRes[index].paletteOffset = ((mpRes[index].paletteOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
}
};
@@ -46,9 +49,11 @@ public:
J3DTexMtx() {
mTexMtxInfo = j3dDefaultTexMtxInfo;
}
J3DTexMtx(const J3DTexMtxInfo& info) {
mTexMtxInfo = info;
}
/* 803238C4 */ void load(u32) const;
/* 80323900 */ void calc(const Mtx);
/* 80323920 */ void calcTexMtx(const Mtx);
@@ -103,7 +108,7 @@ struct J3DTexCoord : public J3DTexCoordInfo {
void setTexMtxReg(u16 reg) { mTexMtxReg = reg; }
J3DTexCoord& operator=(const J3DTexCoord& other) {
// Fake match (__memcpy or = doesn't match)
*(u32*)this = *(u32*)&other;
*(uintptr_t*)this = *(uintptr_t*)&other;
return *this;
}
+1 -2
View File
@@ -1,8 +1,7 @@
#ifndef J3DTRANSFORM_H
#define J3DTRANSFORM_H
#include "JSystem/JGeometry.h"
#include "dolphin/mtx.h"
#include <dolphin/mtx.h>
struct J3DTextureSRTInfo;
+5 -8
View File
@@ -29,6 +29,7 @@ struct J3DVtxColorCalc {
class J3DVertexData {
public:
J3DVertexData();
~J3DVertexData() {}
void* getVtxPosArray() const { return mVtxPosArray; }
void* getVtxNrmArray() const { return mVtxNrmArray; }
@@ -38,10 +39,10 @@ public:
u32 getNrmNum() const { return mNrmNum; }
u32 getVtxNum() const { return mVtxNum; }
GXVtxAttrFmtList* getVtxAttrFmtList() const { return mVtxAttrFmtList; }
u8 getVtxPosFrac() { return mVtxPosFrac; }
u8 getVtxNrmFrac() { return mVtxNrmFrac; }
int getVtxPosType() { return mVtxPosType; }
int getVtxNrmType() { return mVtxNrmType; }
u8 getVtxPosFrac() const { return mVtxPosFrac; }
u8 getVtxNrmFrac() const { return mVtxNrmFrac; }
int getVtxPosType() const { return mVtxPosType; }
int getVtxNrmType() const { return mVtxNrmType; }
void setVtxPosFrac(u8 frac) { mVtxPosFrac = frac; }
void setVtxPosType(GXCompType type) { mVtxPosType = type; }
@@ -148,8 +149,4 @@ private:
/* 0x34 */ GXColor* mCurrentVtxCol;
}; // Size: 0x38
struct VertexNormal {
Vec data;
};
#endif /* J3DVERTEX_H */