diff options
Diffstat (limited to 'include/JSystem/J3DGraphBase')
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DMaterial.h | 2 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DPacket.h | 28 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DShapeMtx.h | 28 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DStruct.h | 11 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DTexture.h | 4 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DVertex.h | 15 |
6 files changed, 54 insertions, 34 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index dcb74c1f46..a125cdf925 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -66,7 +66,7 @@ public: J3DFog* getFog() { return mPEBlock->getFog(); } J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); } u16 getIndex() { return mIndex; } - bool isDrawModeOpaTexEdge() { return (mMaterialMode & 3) == 0; } + BOOL isDrawModeOpaTexEdge() { return (mMaterialMode & 3) ? 1 : 0; } J3DPEBlock* getPEBlock() { return mPEBlock; } void onInvalid() { mInvalid = 1; } u32 getTexGenNum() const { return mTexGenBlock->getTexGenNum(); } diff --git a/include/JSystem/J3DGraphBase/J3DPacket.h b/include/JSystem/J3DGraphBase/J3DPacket.h index 374c41ebda..67dea2f83c 100644 --- a/include/JSystem/J3DGraphBase/J3DPacket.h +++ b/include/JSystem/J3DGraphBase/J3DPacket.h @@ -139,6 +139,34 @@ public: * @ingroup jsystem-j3d * */ +class J3DTexMtxObj { +public: + Mtx& getMtx(u16 idx) { + 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_RANGE(293, idx < mTexMtxNum); + return mpEffectMtx[idx]; + } + + u16 getNumTexMtx() const { return mTexMtxNum; } + + /* 0x00 */ Mtx* mpTexMtx; + /* 0x04 */ Mtx44* mpEffectMtx; + /* 0x08 */ u16 mTexMtxNum; +}; + +/** + * @ingroup jsystem-j3d + * + */ class J3DPacket { public: J3DPacket() { diff --git a/include/JSystem/J3DGraphBase/J3DShapeMtx.h b/include/JSystem/J3DGraphBase/J3DShapeMtx.h index 4c86f51367..7029ab3350 100644 --- a/include/JSystem/J3DGraphBase/J3DShapeMtx.h +++ b/include/JSystem/J3DGraphBase/J3DShapeMtx.h @@ -12,34 +12,6 @@ class J3DTexGenBlock; * @ingroup jsystem-j3d * */ -class J3DTexMtxObj { -public: - Mtx& getMtx(u16 idx) { - 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_RANGE(293, idx < mTexMtxNum); - return mpEffectMtx[idx]; - } - - u16 getNumTexMtx() const { return mTexMtxNum; } - - /* 0x00 */ Mtx* mpTexMtx; - /* 0x04 */ Mtx44* mpEffectMtx; - /* 0x08 */ u16 mTexMtxNum; -}; - -/** - * @ingroup jsystem-j3d - * - */ class J3DDifferedTexMtx { public: static void loadExecute(f32 const (*)[4]); diff --git a/include/JSystem/J3DGraphBase/J3DStruct.h b/include/JSystem/J3DGraphBase/J3DStruct.h index 3f9bafe12c..7ab166946a 100644 --- a/include/JSystem/J3DGraphBase/J3DStruct.h +++ b/include/JSystem/J3DGraphBase/J3DStruct.h @@ -11,6 +11,7 @@ * */ struct J3DLightInfo { + bool operator==(J3DLightInfo& other) const; J3DLightInfo& operator=(J3DLightInfo const&); /* 0x00 */ Vec mLightPosition; @@ -31,6 +32,7 @@ struct J3DTextureSRTInfo { /* 0x0C */ f32 mTranslationX; /* 0x10 */ f32 mTranslationY; + bool operator==(J3DTextureSRTInfo&) const; inline void operator=(J3DTextureSRTInfo const& other) { #ifdef __MWERKS__ __REGISTER const f32* src = &other.mScaleX; @@ -74,6 +76,7 @@ enum J3DTexMtxMode { * */ struct J3DTexMtxInfo { + bool operator==(J3DTexMtxInfo& other) const; J3DTexMtxInfo& operator=(J3DTexMtxInfo const&); void setEffectMtx(Mtx); @@ -93,7 +96,7 @@ struct J3DTexMtxInfo { struct J3DIndTexMtxInfo { J3DIndTexMtxInfo& operator=(J3DIndTexMtxInfo const&); /* 0x00 */ Mtx23 field_0x0; - /* 0x18 */ u8 field_0x18; + /* 0x18 */ s8 field_0x18; }; // Size: 0x1C /** @@ -101,7 +104,8 @@ struct J3DIndTexMtxInfo { * */ struct J3DFogInfo { - J3DFogInfo& operator=(J3DFogInfo const&); + bool operator==(J3DFogInfo&) const; + J3DFogInfo& operator=(const J3DFogInfo&); /* 0x00 */ u8 mType; /* 0x01 */ u8 mAdjEnable; @@ -119,7 +123,8 @@ struct J3DFogInfo { * */ struct J3DNBTScaleInfo { - J3DNBTScaleInfo& operator=(J3DNBTScaleInfo const&); + bool operator==(const J3DNBTScaleInfo& other) const; + J3DNBTScaleInfo& operator=(const J3DNBTScaleInfo&); /* 0x0 */ u8 mbHasScale; /* 0x4 */ Vec mScale; diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 177df65a38..8c95729d66 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -18,7 +18,9 @@ private: /* 0x4 */ ResTIMG* mpRes; public: - J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {} + J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) { + J3D_ASSERT_NULLPTR(52, res && num); + } void loadGX(u16, GXTexMapID) const; void entryNum(u16); diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h index 0aab64cd8e..1bfd011219 100644 --- a/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/include/JSystem/J3DGraphBase/J3DVertex.h @@ -16,8 +16,10 @@ class J3DVertexBuffer; struct J3DVtxColorCalc { void calc(J3DModel*); virtual void calc(J3DVertexBuffer*); + virtual ~J3DVtxColorCalc() {} + + bool checkFlag(u32 flag) { return mFlags & flag ? true : false; } - /* 0x0 */ void* vtable; // inlined vtable? /* 0x4 */ u32 mFlags; /* 0x8 */ J3DAnmVtxColor* mpVtxColor; }; @@ -38,6 +40,7 @@ public: void* getVtxNBTArray() const { return mVtxNBTArray; } u32 getNrmNum() const { return mNrmNum; } u32 getVtxNum() const { return mVtxNum; } + u32 getColNum() const { return mColNum; } GXVtxAttrFmtList* getVtxAttrFmtList() const { return mVtxAttrFmtList; } u8 getVtxPosFrac() const { return mVtxPosFrac; } u8 getVtxNrmFrac() const { return mVtxNrmFrac; } @@ -129,6 +132,12 @@ public: mVtxNrmArray[1] = temp; } + void swapVtxColArrayPointer() { + GXColor* temp = mVtxColArray[0]; + mVtxColArray[0] = mVtxColArray[1]; + mVtxColArray[1] = temp; + } + void* getVtxPosArrayPointer(int index) { return mVtxPosArray[index]; } @@ -137,6 +146,10 @@ public: return mVtxNrmArray[index]; } + GXColor* getVtxColArrayPointer(int index) { + return mVtxColArray[index]; + } + private: /* 0x00 */ J3DVertexData* mVtxData; /* 0x04 */ void* mVtxPosArray[2]; |
