diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-12-13 00:04:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-12 21:04:03 -0800 |
| commit | 1b8ea3206dbbaa6e4ebe7b4dfadffd8d85f37480 (patch) | |
| tree | 334a6f146edd70f260a6d3156e1aad8221b22e42 /include/JSystem/J3DGraphBase/J3DTexture.h | |
| parent | 7e514502d2e97781aa0488c08e39e505f29f36f5 (diff) | |
J3D debug work (#2949)
* J3D debug work
* Clean up JSystem GXColor ctors, remove a couple fakematches
* Update symbols.txt
* Fix res include syntax
* Remove fakematch that isn't necessary anymore
* Fix some Shield regressions
Diffstat (limited to 'include/JSystem/J3DGraphBase/J3DTexture.h')
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DTexture.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 33848d1744..a049f0ba99 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -82,10 +82,7 @@ struct J3DTexCoordInfo { /* 0x3 */ u8 pad; J3DTexCoordInfo& operator=(const J3DTexCoordInfo& other) { - mTexGenType = other.mTexGenType; - mTexGenSrc = other.mTexGenSrc; - mTexGenMtx = other.mTexGenMtx; - pad = other.pad; + __memcpy(this, &other, sizeof(J3DTexCoordInfo)); return *this; } }; @@ -98,14 +95,14 @@ extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8]; */ struct J3DTexCoord : public J3DTexCoordInfo { J3DTexCoord() { - setTexCoordInfo(j3dDefaultTexCoordInfo[0]); - resetTexMtxReg(); + J3DTexCoordInfo::operator=(j3dDefaultTexCoordInfo[0]); + mTexMtxReg = mTexGenMtx; } - J3DTexCoord(J3DTexCoordInfo const& info) { - setTexCoordInfo(info); - resetTexMtxReg(); + J3DTexCoord(const J3DTexCoordInfo& info) { + J3DTexCoordInfo::operator=(info); + mTexMtxReg = mTexGenMtx; } - void setTexCoordInfo(J3DTexCoordInfo const& info) { + void setTexCoordInfo(const J3DTexCoordInfo& info) { __memcpy(this, &info, sizeof(J3DTexCoordInfo)); } @@ -116,8 +113,12 @@ struct J3DTexCoord : public J3DTexCoordInfo { void setTexGenMtx(u8 param_1) { mTexGenMtx = param_1; } void setTexMtxReg(u16 reg) { mTexMtxReg = reg; } J3DTexCoord& operator=(const J3DTexCoord& other) { - // Fake match (__memcpy or = doesn't match) +#if DEBUG + J3DTexCoordInfo::operator=(other); +#else + // Fakematch: Instruction order is wrong with __memcpy or J3DTexCoordInfo::operator= *(u32*)this = *(u32*)&other; +#endif return *this; } |
