summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-08-19 17:15:39 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-08-20 18:51:42 -0400
commit217775af4ef41ac875d53efe4da8f2d19f46e2af (patch)
treeea7683dbc31668db546d768bf8a165a7950d436e /include/JSystem
parenta32174dff6bbac81945505d8d86e125ce3443405 (diff)
Use precompiled headers, fix weak data issues
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DJoint.h9
-rw-r--r--include/JSystem/J3DGraphBase/J3DMatBlock.h5
-rw-r--r--include/JSystem/JUtility/JUTDirectPrint.h1
3 files changed, 6 insertions, 9 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h
index 922a7554..cc110153 100644
--- a/include/JSystem/J3DGraphAnimator/J3DJoint.h
+++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h
@@ -51,8 +51,7 @@ public:
virtual ~J3DMtxCalcBasic() {}
virtual void init(const Vec& vec, const Mtx& mtx) {
J3DSys::mCurrentS = vec;
- // TODO: Same issue as J3DMtxCalcMaya::init.
- // J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
+ J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
J3DSys::mCurrentMtx[0][0] = mtx[0][0] * J3DSys::mCurrentS.x;
J3DSys::mCurrentMtx[0][1] = mtx[0][1] * J3DSys::mCurrentS.y;
J3DSys::mCurrentMtx[0][2] = mtx[0][2] * J3DSys::mCurrentS.z;
@@ -94,11 +93,7 @@ public:
J3DMtxCalcMaya() : J3DMtxCalcBasic() {}
virtual ~J3DMtxCalcMaya() {}
virtual void init(const Vec& vec, const Mtx& mtx) {
- // TODO: This breaks some TUs by adding extra data ({0x3F800000, 0x3F800000, 0x3F800000})
- // This seems to be responsible for the @2100 Vec literal that gets added to most TUs.
- // The strange part is that @2100 needs to be in the .data section, but uncommenting this
- // will put it in the .rodata sections.
- // J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
+ J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
J3DSys::mCurrentS = vec;
J3DSys::mCurrentMtx[0][0] = mtx[0][0] * J3DSys::mCurrentS.x;
J3DSys::mCurrentMtx[0][1] = mtx[0][1] * J3DSys::mCurrentS.y;
diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h
index 38af7236..c8eaef86 100644
--- a/include/JSystem/J3DGraphBase/J3DMatBlock.h
+++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h
@@ -992,7 +992,10 @@ struct J3DColorChan {
info.mDiffuseFn, info.mAttnFn, ambSrc);
}
J3DColorChan(u16 id) : mChanCtrl(id) {}
- GXAttnFn getAttnFn();
+ GXAttnFn getAttnFn() {
+ u8 attnFnTbl[] = { GX_AF_NONE, GX_AF_SPEC, GX_AF_NONE, GX_AF_SPOT };
+ return GXAttnFn(attnFnTbl[mChanCtrl >> 9 & 0x03]);
+ }
GXDiffuseFn getDiffuseFn() { return GXDiffuseFn(mChanCtrl >> 7 & 3); }
u8 getLightMask() { return ((mChanCtrl >> 2 & 0x0f) | (mChanCtrl >> 11 & 0x0f) << 4); }
void setLightMask(u8 mask) {
diff --git a/include/JSystem/JUtility/JUTDirectPrint.h b/include/JSystem/JUtility/JUTDirectPrint.h
index 0e77c648..e82c6f9d 100644
--- a/include/JSystem/JUtility/JUTDirectPrint.h
+++ b/include/JSystem/JUtility/JUTDirectPrint.h
@@ -4,7 +4,6 @@
#include "JSystem/JUtility/TColor.h"
#include "stdarg.h"
-
namespace std {
// no idea what this is or why it is used instead of va_list
struct __tag_va_List : __va_list_struct {};