diff options
| author | robojumper <robojumper@gmail.com> | 2025-05-02 23:56:58 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-05-03 08:48:10 +0200 |
| commit | 207c3706b4e9896b4b625e6686a3a15b51ff5b00 (patch) | |
| tree | dddc14e168f152cce88beac5294ae41312773ddf /include | |
| parent | 594bc67d676e944980054b104368e02617428a85 (diff) | |
d_particle OK
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JParticle/JPADynamicsBlock.h | 6 | ||||
| -rw-r--r-- | include/JSystem/JParticle/JPAEmitter.h | 14 | ||||
| -rw-r--r-- | include/d/d_stage_mgr.h | 5 | ||||
| -rw-r--r-- | include/egg/gfx/eggCpuTexture.h | 14 | ||||
| -rw-r--r-- | include/toBeSorted/d_particle.h | 96 |
5 files changed, 125 insertions, 10 deletions
diff --git a/include/JSystem/JParticle/JPADynamicsBlock.h b/include/JSystem/JParticle/JPADynamicsBlock.h index f1811246..73a7a6f6 100644 --- a/include/JSystem/JParticle/JPADynamicsBlock.h +++ b/include/JSystem/JParticle/JPADynamicsBlock.h @@ -3,8 +3,8 @@ #include "common.h" -#include "JSystem/JGeometry.h" #include "egg/math/eggVector.h" +#include "m/m_angle.h" class JPAEmitterWorkData; @@ -36,7 +36,7 @@ struct JPADynamicsBlockData { /* 0x5C */ f32 mVolumeMinRad; /* 0x60 */ f32 mAirResist; /* 0x64 */ f32 mMoment; - /* 0x68 */ JGeometry::TVec3<s16> mEmitterRot; + /* 0x68 */ mAng3_c mEmitterRot; /* 0x6E */ s16 mMaxFrame; /* 0x70 */ s16 mStartFrame; /* 0x72 */ s16 mLifeTime; @@ -83,7 +83,7 @@ public: void getEmitterDir(EGG::Vector3f* vec) const { vec->set(mpData->mEmitterDir.x, mpData->mEmitterDir.y, mpData->mEmitterDir.z); } - void getEmitterRot(JGeometry::TVec3<s16>* vec) const { + void getEmitterRot(mAng3_c* vec) const { vec->set(mpData->mEmitterRot.x, mpData->mEmitterRot.y, mpData->mEmitterRot.z); } s16 getMaxFrame() { return mpData->mMaxFrame; } diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index d8900bff..6e49752f 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -9,6 +9,8 @@ #include "JSystem/JParticle/JPAMath.h" #include "JSystem/JParticle/JPADynamicsBlock.h" #include "JSystem/JSupport/JSUList.h" +#include "egg/math/eggVector.h" +#include "m/m_angle.h" class JPAResourceManager; class JPABaseEmitter; @@ -47,8 +49,8 @@ struct JPAEmitterWorkData { /* 0x120 */ EGG::Vector3f mGlobalEmtrDir; /* 0x12C */ EGG::Vector3f mPublicScale; /* 0x138 */ EGG::Vector3f mGlobalPos; - /* 0x144 */ JGeometry::TVec2<f32> mGlobalPtclScl; - /* 0x14C */ JGeometry::TVec2<f32> mPivot; + /* 0x144 */ EGG::Vector2f mGlobalPtclScl; + /* 0x14C */ EGG::Vector2f mPivot; /* 0x154 */ Mtx mYBBCamMtx; /* 0x184 */ Mtx mPosCamMtx; /* 0x1B4 */ Mtx mPrjMtx; @@ -136,7 +138,7 @@ public: void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); } void setGlobalTranslation(const EGG::Vector3f& trs) { mGlobalTrs.set(trs); } void getLocalTranslation(EGG::Vector3f& vec) { vec.set(mLocalTrs); } - void setGlobalRotation(const JGeometry::TVec3<s16>& rot) { + void setGlobalRotation(const mAng3_c& rot) { JPAGetXYZRotateMtx(rot.x, rot.y, rot.z, mGlobalRot); } void getGlobalTranslation(EGG::Vector3f* out) const { out->set(mGlobalTrs); } @@ -152,7 +154,7 @@ public: void setAwayFromAxisSpeed(f32 i_speed) { mAwayFromAxisSpeed = i_speed; } void setSpread(f32 i_spread) { mSpread = i_spread; } void setLocalTranslation(const EGG::Vector3f& i_trans) { mLocalTrs.set(i_trans); } - void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); } + void setLocalRotation(const mAng3_c& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); } void setRateStep(u8 i_step) { mRateStep = i_step; } void setGlobalParticleHeightScale(f32 height) { @@ -232,7 +234,7 @@ public: /* 0x40 */ f32 mSpread; /* 0x44 */ f32 mRndmDirSpeed; /* 0x48 */ f32 mAirResist; - /* 0x4C */ JGeometry::TVec3<s16> mLocalRot; + /* 0x4C */ mAng3_c mLocalRot; /* 0x52 */ s16 mLifeTime; /* 0x54 */ u16 mVolumeSize; /* 0x56 */ u8 mRateStep; @@ -240,7 +242,7 @@ public: /* 0x68 */ Mtx mGlobalRot; /* 0x98 */ EGG::Vector3f mGlobalScl; /* 0xA4 */ EGG::Vector3f mGlobalTrs; - /* 0xB0 */ JGeometry::TVec2<f32> mGlobalPScl; + /* 0xB0 */ EGG::Vector2f mGlobalPScl; /* 0xB8 */ GXColor mGlobalPrmClr; /* 0xBC */ GXColor mGlobalEnvClr; /* 0xC0 */ s32 mpUserWork; diff --git a/include/d/d_stage_mgr.h b/include/d/d_stage_mgr.h index cc7d16a3..c239a98d 100644 --- a/include/d/d_stage_mgr.h +++ b/include/d/d_stage_mgr.h @@ -18,6 +18,7 @@ #include "toBeSorted/arc_managers/oarc_manager.h" #include "toBeSorted/attention.h" #include "toBeSorted/d_d3d.h" +#include "toBeSorted/d_particle.h" #include "toBeSorted/time_area_mgr.h" class RelObjCtrl { @@ -161,9 +162,11 @@ private: /* 0x0580 */ LayoutArcControl mLayoutArcCtrl2; /* 0x058C */ dBgS mBg; // ... - u8 _0x00001[0x7D0]; + u8 _0x00001[0x778]; /* 0x3E40 */ dCcS mCc; // ... + /* 0x7814 */ dParticle::tex_c mParticleTex[2]; + // ... /* 0x7930 */ dFader_c mFader; /* 0x7954 */ u16 mPcamCount; diff --git a/include/egg/gfx/eggCpuTexture.h b/include/egg/gfx/eggCpuTexture.h index a3e4db22..d5300b41 100644 --- a/include/egg/gfx/eggCpuTexture.h +++ b/include/egg/gfx/eggCpuTexture.h @@ -90,6 +90,13 @@ public: mWrapT = wrap; } + GXTexWrapMode getWrapS() const { + return (GXTexWrapMode)mWrapS; + } + GXTexWrapMode getWrapT() const { + return (GXTexWrapMode)mWrapT; + } + void setWrap(GXTexWrapMode wrapS, GXTexWrapMode wrapT) { mWrapS = wrapS; mWrapT = wrapT; @@ -107,6 +114,13 @@ public: mMagFilt = filt; } + GXTexFilter getMinFilt() const { + return (GXTexFilter)mMinFilt; + } + GXTexFilter getMagFilt() const { + return (GXTexFilter)mMagFilt; + } + ResTIMG *getHeader() const { return (ResTIMG *)((u8 *)dataPtr - sizeof(ResTIMG)); } diff --git a/include/toBeSorted/d_particle.h b/include/toBeSorted/d_particle.h new file mode 100644 index 00000000..ef81921b --- /dev/null +++ b/include/toBeSorted/d_particle.h @@ -0,0 +1,96 @@ +#ifndef D_PARTICLE_H +#define D_PARTICLE_H + +#include "JSystem/JParticle/JPADrawInfo.h" +#include "JSystem/JParticle/JPAEmitter.h" +#include "JSystem/JParticle/JPAResourceManager.h" +#include "common.h" +#include "m/m_angle.h" +#include "m/m_vec.h" + +#define D_PARTICLE_RES_COMMON 0 +#define D_PARTICLE_RES_PARTICLE 1 + +#define D_PARTICLE_NUM_RES 2 + +namespace dParticle { + +struct JPN { + u16 numJpn; + u16 mData[1]; +}; + +class res_c { +public: + res_c() { + mpHeap = nullptr; + mpResourceManager = nullptr; + mpJpnData = nullptr; + } + + JPAResourceManager *init(const void *jpc, const void *jpn, EGG::Heap *heap); + void dispose(); + + JPAResourceManager *getResourceManager() { + return mpResourceManager; + } + + const JPN *getJpn() const { + return mpJpnData; + } + +private: + /* 0x00 */ EGG::FrmHeap *mpHeap; + /* 0x04 */ JPAResourceManager *mpResourceManager; + /* 0x08 */ const JPN *mpJpnData; +}; + +// Made up name +class tex_c { +public: + tex_c() { + field_0x04 = 0; + field_0x08 = 0; + } + virtual void set(EGG::CpuTexture *tex); + +private: + /* 0x04 */ UNKWORD field_0x04; + /* 0x08 */ UNKWORD field_0x08; + /* 0x0C */ EGG::ResTIMG mImg; +}; + +// Made up name +class mgr_c { +public: + mgr_c(EGG::Heap *heap, u32 ptclMax, u32 emtrMax, u8 grpMax); + + static mgr_c *GetInstance() { + return sInstance; + } + + static mgr_c *create(EGG::Heap *heap, u32 ptclMax, u32 emtrMax, u8 grpMax); + + void createResource(EGG::Heap *heap, s32 mgrIndex, void *jpc, void *jpn); + void disposeResource(s32 mgrIndex); + s32 getResUserWork(u16 handle) const; + u16 getJpnData(u16 handle) const; + // Invokes the JParticle 11 extension + void doCustomSkywardSwordThing(u8 groupId, f32 x, f32 y); + void calc(u8 groupId); + void draw(const JPADrawInfo *drawInfo, u8 groupId); + JPABaseEmitter * + createEmitter(u16 particleResId, u8 groupId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale); + void forceDeleteAllEmitter(); + void forceDeleteEmitter(JPABaseEmitter *emitter); + JPAResourceManager *getResourceManager(s32 idx); + +private: + static mgr_c *sInstance; + /* 0x00 */ JPAEmitterManager *mpEmitterMgr; + /* 0x04 */ res_c mRes[D_PARTICLE_NUM_RES]; +}; + +} // namespace dParticle + +#endif |
