summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorCarco_21 <144170194+carter-ktb21@users.noreply.github.com>2025-12-12 23:54:42 -0500
committerGitHub <noreply@github.com>2025-12-12 20:54:42 -0800
commit87732304d15f80fa952a243bb3c6dec44f3f0856 (patch)
tree60e559953b012cdeadb6e53a991e07ceab4f0f87 /include/JSystem
parent2481e184fb99b7343cbf0893f838cc892feafc4a (diff)
d_particle debug work (#2944)
* misc work * more work * fixed error * more work * PR cleanup * missed cleanup * error fix * wii fix
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/J2DGraph/J2DPicture.h4
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DModelData.h2
-rw-r--r--include/JSystem/JMath/JMath.h6
-rw-r--r--include/JSystem/JParticle/JPAEmitter.h18
-rw-r--r--include/JSystem/JParticle/JPAEmitterManager.h8
-rw-r--r--include/JSystem/JParticle/JPAParticle.h6
6 files changed, 37 insertions, 7 deletions
diff --git a/include/JSystem/J2DGraph/J2DPicture.h b/include/JSystem/J2DGraph/J2DPicture.h
index f6e8ec3b31..bb71d97aa3 100644
--- a/include/JSystem/J2DGraph/J2DPicture.h
+++ b/include/JSystem/J2DGraph/J2DPicture.h
@@ -151,11 +151,11 @@ public:
return NULL;
}
virtual u8 getTextureCount() const { return mTextureNum; }
- virtual bool setBlack(JUtility::TColor i_black) {
+ /* vt 0x128 */ virtual bool setBlack(JUtility::TColor i_black) {
mBlack = i_black;
return true;
}
- virtual bool setWhite(JUtility::TColor i_white) {
+ /* vt 0x12C */ virtual bool setWhite(JUtility::TColor i_white) {
mWhite = i_white;
return true;
}
diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h
index 757c472820..ea1ef96813 100644
--- a/include/JSystem/J3DGraphAnimator/J3DModelData.h
+++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h
@@ -86,7 +86,7 @@ public:
int removeMatColorAnimator(J3DAnmColor* anm) {
return mMaterialTable.removeMatColorAnimator(anm);
}
- void syncJ3DSys() {
+ void syncJ3DSys() const {
syncJ3DSysFlags();
syncJ3DSysPointers();
}
diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h
index 1142f41389..ee31b6e541 100644
--- a/include/JSystem/JMath/JMath.h
+++ b/include/JSystem/JMath/JMath.h
@@ -17,6 +17,12 @@ inline int JMAAbs(int value) {
#endif
}
+inline f32 JMAAbs(f32 x) {
+#ifdef __MWERKS__
+ return __fabsf(x);
+#endif
+}
+
inline f32 JMAFastReciprocal(f32 value) {
#ifdef __MWERKS__
return __fres(value);
diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h
index eca7556754..ebf82df33e 100644
--- a/include/JSystem/JParticle/JPAEmitter.h
+++ b/include/JSystem/JParticle/JPAEmitter.h
@@ -134,6 +134,7 @@ public:
void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); }
void setGlobalTranslation(const JGeometry::TVec3<f32>& trs) { mGlobalTrs.set(trs); }
void getLocalTranslation(JGeometry::TVec3<f32>& vec) { vec.set(mLocalTrs); }
+ void getLocalTranslation(JGeometry::TVec3<f32>* vec) const { vec->set(mLocalTrs); }
void setGlobalRotation(const JGeometry::TVec3<s16>& rot) {
JPAGetXYZRotateMtx(rot.x, rot.y, rot.z, mGlobalRot);
}
@@ -143,6 +144,7 @@ public:
void setGlobalAlpha(u8 alpha) { mGlobalPrmClr.a = alpha; }
u8 getGlobalAlpha() const { return mGlobalPrmClr.a; }
void getGlobalPrmColor(GXColor& color) { color = mGlobalPrmClr; }
+ void getGlobalPrmColor(_GXColor* color) const { *color = mGlobalPrmClr; }
void setGlobalPrmColor(u8 r, u8 g, u8 b) { mGlobalPrmClr.r = r; mGlobalPrmClr.g = g; mGlobalPrmClr.b = b; }
void setGlobalEnvColor(u8 r, u8 g, u8 b) { mGlobalEnvClr.r = r; mGlobalEnvClr.g = g; mGlobalEnvClr.b = b; }
void setVolumeSize(u16 size) { mVolumeSize = size; }
@@ -175,6 +177,18 @@ public:
scale.set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
#endif
}
+ void getGlobalParticleScale(JGeometry::TVec3<f32>* scale) const {
+ //TODO: Possible fakematch. Debug and Wii indicate TVec3::set, but using it breaks regalloc
+ // in dPa_gen_b_light8PcallBack::draw on GCN (where the call to set would normally be
+ // inlined).
+#if PLATFORM_GCN
+ scale->x = mGlobalPScl.x;
+ scale->y = mGlobalPScl.y;
+ scale->z = 1.0f;
+#else
+ scale->set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
+#endif
+ }
void setGlobalScale(const JGeometry::TVec3<f32>& scale) {
mGlobalScl.set(scale);
mGlobalPScl.set(scale.x ,scale.y);
@@ -208,7 +222,7 @@ public:
void stopDrawParticle() { setStatus(JPAEmtrStts_StopDraw); }
void playDrawParticle() { clearStatus(JPAEmtrStts_StopDraw); }
- uintptr_t getUserWork() { return mpUserWork; }
+ uintptr_t getUserWork() const { return mpUserWork; }
void setUserWork(uintptr_t userWork) { mpUserWork = userWork; }
u32 getParticleNumber() const {
return mAlivePtclBase.getNum() + mAlivePtclChld.getNum();
@@ -218,7 +232,7 @@ public:
}
void setDrawTimes(u8 drawTimes) { mDrawTimes = drawTimes; }
void setParticleCallBackPtr(JPAParticleCallBack* cb) { mpPtclCallBack = cb; }
- JPAParticleCallBack* getParticleCallBackPtr() { return mpPtclCallBack; }
+ JPAParticleCallBack* getParticleCallBackPtr() const { return mpPtclCallBack; }
JPAEmitterCallBack* getEmitterCallBackPtr() const { return mpEmtrCallBack; }
u32 getAge() const { return mTick; }
diff --git a/include/JSystem/JParticle/JPAEmitterManager.h b/include/JSystem/JParticle/JPAEmitterManager.h
index f0380d0dbb..8aeb2f56cd 100644
--- a/include/JSystem/JParticle/JPAEmitterManager.h
+++ b/include/JSystem/JParticle/JPAEmitterManager.h
@@ -6,6 +6,7 @@
#include "JSystem/JParticle/JPADrawInfo.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JGeometry.h"
+#include "JSystem/JUtility/JUTAssert.h"
class JPAEmitterCallBack;
class JPAParticleCallBack;
@@ -32,7 +33,12 @@ public:
void entryResourceManager(JPAResourceManager*, u8);
void clearResourceManager(u8);
void calcYBBCam();
- JPAResourceManager* getResourceManager(u16 idx) { return pResMgrAry[idx]; }
+ JPAResourceManager* getResourceManager(u16 idx) const { return pResMgrAry[idx]; }
+ JPAResourceManager* getResourceManager(u8 res_mgr_id) const {
+ JUT_ASSERT(147, res_mgr_id < ridMax);
+ return pResMgrAry[res_mgr_id];
+ }
+ int getEmitterNumber() const { return emtrNum - mFreeEmtrList.getNumLinks(); }
public:
/* 0x00 */ JSUList<JPABaseEmitter>* pEmtrUseList;
diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h
index ac6cd9798f..e6e0bec6f4 100644
--- a/include/JSystem/JParticle/JPAParticle.h
+++ b/include/JSystem/JParticle/JPAParticle.h
@@ -27,12 +27,14 @@ public:
bool canCreateChild(JPAEmitterWorkData*);
f32 getWidth(JPABaseEmitter const*) const;
f32 getHeight(JPABaseEmitter const*) const;
- int getAge() { return mAge; }
+ int getAge() const { return mAge; }
void setOffsetPosition(const JGeometry::TVec3<f32>& pos) { mOffsetPosition.set(pos); }
void setOffsetPosition(f32 x, f32 y, f32 z) { mOffsetPosition.set(x, y, z); }
void getOffsetPosition(JGeometry::TVec3<f32>& pos) { pos.set(mOffsetPosition); }
+ void getOffsetPosition(JGeometry::TVec3<f32>* pos) const { pos->set(mOffsetPosition); }
u16 getRotateAngle() const { return mRotateAngle; }
void getGlobalPosition(JGeometry::TVec3<f32>& pos) const { pos.set(mPosition); }
+ void getGlobalPosition(JGeometry::TVec3<f32>* pos) const { pos->set(mPosition); }
f32 getParticleScaleX() const { return mParticleScaleX; }
f32 getParticleScaleY() const { return mParticleScaleY; }
void setStatus(u32 flag) { mStatus |= flag; }
@@ -42,7 +44,9 @@ public:
void setDeleteParticleFlag() { setStatus(2); }
void getVelVec(JGeometry::TVec3<f32>& vec) const { vec.set(mVelocity); }
void getLocalPosition(JGeometry::TVec3<f32>& vec) const { vec.set(mLocalPosition); }
+ void getLocalPosition(JGeometry::TVec3<f32>* vec) const { vec->set(mLocalPosition); }
void getBaseAxis(JGeometry::TVec3<f32>& vec) const { vec.set(mBaseAxis); }
+ void getBaseAxis(JGeometry::TVec3<f32>* vec) const { vec->set(mBaseAxis); }
public:
/* 0x00 */ JGeometry::TVec3<f32> mPosition;