mirror of
https://github.com/zeldaret/ss
synced 2026-06-10 20:58:38 -04:00
Refactoring
This commit is contained in:
+22
-22
@@ -603,8 +603,8 @@ fn_80019290 = .text:0x80019290; // type:function size:0x5C
|
||||
fn_800192F0 = .text:0x800192F0; // type:function size:0x6C
|
||||
doDraw__Q23d3d14EggTextureProcFv = .text:0x80019360; // type:function size:0x204
|
||||
doRemove__Q23d3d14EggTextureProcFv = .text:0x80019570; // type:function size:0x44
|
||||
create__Q23d3d14EggTextureProcFiiP12mAllocator_c = .text:0x800195C0; // type:function size:0xAC
|
||||
createXlu__Q23d3d14EggTextureProcFiP12mAllocator_c = .text:0x80019670; // type:function size:0x74
|
||||
create__Q23d3d7UnkProcFiiP12mAllocator_c = .text:0x800195C0; // type:function size:0xAC
|
||||
createXlu__Q23d3d7UnkProcFiP12mAllocator_c = .text:0x80019670; // type:function size:0x74
|
||||
fn_800196F0 = .text:0x800196F0; // type:function size:0x90
|
||||
fn_80019780 = .text:0x80019780; // type:function size:0x6C
|
||||
fn_800197F0 = .text:0x800197F0; // type:function size:0x5C
|
||||
@@ -925,14 +925,14 @@ __dt__13EffectsStructFv = .text:0x80027660; // type:function size:0x78
|
||||
remove__13EffectsStructFb = .text:0x800276E0; // type:function size:0x84
|
||||
addToActiveEmittersList__13EffectsStructFUsb = .text:0x80027770; // type:function size:0xE8
|
||||
areAllEmittersDone__13EffectsStructFv = .text:0x80027860; // type:function size:0xC8
|
||||
fn_80027930 = .text:0x80027930; // type:function size:0x130
|
||||
fn_80027A60 = .text:0x80027A60; // type:function size:0x44
|
||||
fn_80027AB0 = .text:0x80027AB0; // type:function size:0x6C
|
||||
fn_80027B20 = .text:0x80027B20; // type:function size:0x24
|
||||
execute__13EffectsStructFv = .text:0x80027930; // type:function size:0x130
|
||||
getOwnerPolyAttrs__13EffectsStructFPlPl = .text:0x80027A60; // type:function size:0x44
|
||||
realizeAlpha__13EffectsStructFv = .text:0x80027AB0; // type:function size:0x6C
|
||||
setFading__13EffectsStructFUc = .text:0x80027B20; // type:function size:0x24
|
||||
create__18dParticleFogProc_cFlllP16mHeapAllocator_c = .text:0x80027B50; // type:function size:0x80
|
||||
doDraw__18dParticleFogProc_cFv = .text:0x80027BD0; // type:function size:0xD8
|
||||
draw__11dEffect2D_cFv = .text:0x80027CB0; // type:function size:0x100
|
||||
create__11dEffect2D_cFlUc = .text:0x80027DB0; // type:function size:0xC
|
||||
create__11dEffect2D_cFUlUc = .text:0x80027DB0; // type:function size:0xC
|
||||
doDraw__15dShpEmitterProcFv = .text:0x80027DC0; // type:function size:0x250
|
||||
create__13dShpEmitter_cFP16mHeapAllocator_c = .text:0x80028010; // type:function size:0x6C
|
||||
init__13dShpEmitter_cFPCcPCcb = .text:0x80028080; // type:function size:0x100
|
||||
@@ -941,28 +941,28 @@ draw__13dShpEmitter_cFP14JPABaseEmitterP15JPABaseParticle = .text:0x80028190; //
|
||||
fn_80028400 = .text:0x80028400; // type:function size:0x18
|
||||
fn_80028420 = .text:0x80028420; // type:function size:0x58
|
||||
executeAfter__22dJEffEmitterCallback_cFP15JPABaseParticle = .text:0x80028480; // type:function size:0x170
|
||||
fn_800285F0 = .text:0x800285F0; // type:function size:0x19C
|
||||
execute__22dJEffEmitterCallback_cFv = .text:0x800285F0; // type:function size:0x19C
|
||||
fn_80028790 = .text:0x80028790; // type:function size:0x88
|
||||
create__14dJEffManager_cFUs = .text:0x80028820; // type:function size:0x9C
|
||||
remove__14dJEffManager_cFv = .text:0x800288C0; // type:function size:0x38
|
||||
fn_80028900 = .text:0x80028900; // type:function size:0x180
|
||||
remove__17dMassObjEmitter_cFv = .text:0x800288C0; // type:function size:0x38
|
||||
getGroupId__14dEmitterBase_cFUs = .text:0x80028900; // type:function size:0x180
|
||||
setupEffects__14dJEffManager_cFv = .text:0x80028A80; // type:function size:0x434
|
||||
removeEffManagers__14dJEffManager_cFv = .text:0x80028EC0; // type:function size:0xCC
|
||||
fn_80028F90 = .text:0x80028F90; // type:function size:0xE0
|
||||
fn_80029070 = .text:0x80029070; // type:function size:0x4
|
||||
playEffects = .text:0x80029080; // type:function size:0x1A8
|
||||
fn_80029230 = .text:0x80029230; // type:function size:0xB0
|
||||
execute__14dJEffManager_cFv = .text:0x80029080; // type:function size:0x1A8
|
||||
draw__14dJEffManager_cFv = .text:0x80029230; // type:function size:0xB0
|
||||
draw__14dJEffManager_cFPC11JPADrawInfoUl = .text:0x800292E0; // type:function size:0x18
|
||||
fn_80029300 = .text:0x80029300; // type:function size:0x94
|
||||
shouldBePaused__13EffectsStructFP7dBase_c = .text:0x80029300; // type:function size:0x94
|
||||
createEffManagers__14dJEffManager_cFv = .text:0x800293A0; // type:function size:0x1EC
|
||||
__ct__14dJEffManager_cFv = .text:0x80029590; // type:function size:0xC8
|
||||
__ct__17dMassObjEmitter_cFv = .text:0x80029590; // type:function size:0xC8
|
||||
__dt__22dJEffEmitterCallback_cFv = .text:0x80029660; // type:function size:0x90
|
||||
__dt__14dJEffManager_cFv = .text:0x800296F0; // type:function size:0xBC
|
||||
fn_800297B0 = .text:0x800297B0; // type:function size:0x90
|
||||
fn_80029840 = .text:0x80029840; // type:function size:0x6C
|
||||
fn_800298B0 = .text:0x800298B0; // type:function size:0x4
|
||||
fn_800298C0__13EffectsStructFUsP7mVec3_cPvPvPvPv = .text:0x800298C0; // type:function size:0x4C
|
||||
fn_80029910 = .text:0x80029910; // type:function size:0x4
|
||||
__dt__17dMassObjEmitter_cFv = .text:0x800296F0; // type:function size:0xBC
|
||||
spawnEffectInternal__14dJEffManager_cFUsRC7mVec3_cPC7mAng3_cPC7mVec3_cPC8_GXColorPC8_GXColorll = .text:0x800297B0; // type:function size:0x90
|
||||
spawnEffectInternal__14dJEffManager_cFUsRC6mMtx_cPC8_GXColorPC8_GXColorll = .text:0x80029840; // type:function size:0x6C
|
||||
spawnEffect__14dJEffManager_cFUsRC7mVec3_cPC7mAng3_cPC7mVec3_cPC8_GXColorPC8_GXColorll = .text:0x800298B0; // type:function size:0x4
|
||||
spawnUIEffect__14dJEffManager_cFUsRC7mVec3_cPC7mAng3_cPC7mVec3_cPC8_GXColorPC8_GXColor = .text:0x800298C0; // type:function size:0x4C
|
||||
spawnEffect__14dJEffManager_cFUsRC6mMtx_cPC8_GXColorPC8_GXColorll = .text:0x80029910; // type:function size:0x4
|
||||
fn_80029920 = .text:0x80029920; // type:function size:0x54
|
||||
fn_80029980__13EffectsStructFUsP7mVec3_cP7mAng3_cP7mVec3_cPvPv = .text:0x80029980; // type:function size:0x64
|
||||
fn_800299F0__13EffectsStructFUsP6mMtx_cPvPv = .text:0x800299F0; // type:function size:0x20
|
||||
@@ -972,7 +972,7 @@ fn_80029AE0 = .text:0x80029AE0; // type:function size:0x20
|
||||
fn_80029B00 = .text:0x80029B00; // type:function size:0xD8
|
||||
loadColors__14dEmitterBase_cFP14JPABaseEmitterPC8_GXColorPC8_GXColorll = .text:0x80029BE0; // type:function size:0x43C
|
||||
removeFromActiveEmittersList__13EffectsStructFv = .text:0x8002A020; // type:function size:0xA4
|
||||
fn_8002A0D0 = .text:0x8002A0D0; // type:function size:0x15C
|
||||
createEffect__13EffectsStructFbUsRC7mVec3_cPC7mAng3_cPC7mVec3_cPC8_GXColorPC8_GXColor = .text:0x8002A0D0; // type:function size:0x15C
|
||||
fn_8002A230 = .text:0x8002A230; // type:function size:0x150
|
||||
fn_8002A380 = .text:0x8002A380; // type:function size:0xCC
|
||||
fn_8002A450 = .text:0x8002A450; // type:function size:0x1C0
|
||||
@@ -10595,7 +10595,7 @@ fn_8019A020 = .text:0x8019A020; // type:function size:0xC
|
||||
fn_8019A030 = .text:0x8019A030; // type:function size:0x1C
|
||||
fn_8019A050 = .text:0x8019A050; // type:function size:0x1C
|
||||
fn_8019A070 = .text:0x8019A070; // type:function size:0x30
|
||||
fn_8019A0A0 = .text:0x8019A0A0; // type:function size:0x20
|
||||
getGlobalAlpha__11dStageMgr_cCFv = .text:0x8019A0A0; // type:function size:0x20
|
||||
fn_8019A0C0 = .text:0x8019A0C0; // type:function size:0x2C8
|
||||
fn_8019A390 = .text:0x8019A390; // type:function size:0x44
|
||||
fn_8019A3E0 = .text:0x8019A3E0; // type:function size:0x2C8
|
||||
|
||||
+4
-4
@@ -27,14 +27,14 @@ public:
|
||||
/* 800509e0 */ static void initLoader();
|
||||
/* 80050a00 */ static dBase_c *createBase(ProfileName, dBase_c *, u32, u8);
|
||||
/* 80050a10 */ static dBase_c *createRoot(ProfileName, u32, u8);
|
||||
|
||||
|
||||
inline bool isBasePropertyFlag(u32 flag) const {
|
||||
return (baseProperties & flag) != 0;
|
||||
}
|
||||
private:
|
||||
/* 800509c0 */ static int loadAsyncCallback();
|
||||
/* 800509d0 */ static void unloadCallback();
|
||||
|
||||
inline bool isProcControlFlag(u32 flag) const {
|
||||
return (baseProperties & flag) != 0;
|
||||
}
|
||||
|
||||
public:
|
||||
/* 805750c0 */ static u32 s_ExecuteControlFlags;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/col/cc/d_cc_s.h"
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_bzs_types.h"
|
||||
#include "d/d_dylink.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_bzs_types.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "m/m_dvd.h"
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
STATE_FUNC_DECLARE(dStageMgr_c, RestartScene);
|
||||
|
||||
public:
|
||||
u8 getGlobalAlpha() const;
|
||||
|
||||
bool isAreaTypeNormal() const;
|
||||
bool isAreaTypeDungeon() const;
|
||||
bool isAreaTypeSky() const;
|
||||
@@ -119,7 +121,7 @@ public:
|
||||
void setStif(const STIF *stif);
|
||||
s16 getFlagIndex() const;
|
||||
|
||||
void setDemoName(const SizedString<16>& name) {
|
||||
void setDemoName(const SizedString<16> &name) {
|
||||
mDemoName = name;
|
||||
}
|
||||
|
||||
@@ -169,16 +171,16 @@ private:
|
||||
/* 0x7814 */ dParticle::tex_c mParticleTex[2];
|
||||
// ...
|
||||
/* 0x7930 */ dFader_c mFader;
|
||||
|
||||
|
||||
/* 0x7954 */ u16 mPcamCount;
|
||||
/* 0x7956 */ u16 mLyseCount;
|
||||
/* 0x7958 */ u16 mRmplCount;
|
||||
|
||||
|
||||
/* 0x795C */ const PCAM *mpPcam;
|
||||
/* 0x7960 */ const LYSE *mpLyse;
|
||||
/* 0x7964 */ const STIF *mpStif;
|
||||
/* 0x7968 */ const RMPL *mpRmpl;
|
||||
|
||||
|
||||
/* 0x799C */ mDvd_callback_c *mpDvdCallback;
|
||||
/* 0x79A0 */ mDvd_callback_c *mpDvdCallback2;
|
||||
|
||||
|
||||
@@ -177,6 +177,8 @@ private:
|
||||
|
||||
class UnkProc : public m3d::proc_c {
|
||||
public:
|
||||
bool create(int prioOpa, int prioXlu, mAllocator_c *alloc);
|
||||
bool createXlu(int prioXlu, mAllocator_c *alloc);
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -188,8 +190,6 @@ public:
|
||||
}
|
||||
|
||||
virtual int entry() override;
|
||||
bool create(int prioOpa, int prioXlu, mAllocator_c *alloc);
|
||||
bool createXlu(int prioXlu, mAllocator_c *alloc);
|
||||
|
||||
virtual void drawOpa() override {
|
||||
doDraw();
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include "common.h"
|
||||
#include "d/d_base.h"
|
||||
#include "m/m2d.h"
|
||||
#include "m/m3d/m_proc.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_color.h"
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/d_d3d.h"
|
||||
@@ -29,14 +29,16 @@ class dEmitterBase_c {
|
||||
public:
|
||||
dEmitterBase_c() : mpEmitterHead(nullptr), mpEmitterCallback(nullptr), mpParticleCallback(nullptr) {}
|
||||
|
||||
bool createEmitters(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
|
||||
protected:
|
||||
void deactivateEmitters();
|
||||
void stopCalcEmitters();
|
||||
void playCalcEmitters();
|
||||
bool createEmitters(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
static u16 fn_80028900(u16);
|
||||
static s32 getGroupId(u16);
|
||||
static void loadColors(JPABaseEmitter *emitter, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2);
|
||||
|
||||
void setEmitterCallback(dEmitterCallback_c *cb);
|
||||
@@ -53,6 +55,7 @@ protected:
|
||||
/* 0x14 */ TListNode<dEmitterBase_c> mParticleCallbackNode;
|
||||
|
||||
public:
|
||||
// vtable at 0x1C
|
||||
virtual ~dEmitterBase_c();
|
||||
|
||||
void stopDrawParticles();
|
||||
@@ -68,13 +71,22 @@ public:
|
||||
void setAwayFromCenterSpeed(f32 speed);
|
||||
void setVolumeSize(u16 size);
|
||||
void setLifeTime(s16 lifetime);
|
||||
void attachEmitterCallbackId(s32 id); // corresponds to setup at 80028a80
|
||||
void attachEmitterCallbackId(s32 id); // corresponds to setup at 80028a80
|
||||
void bindShpEmitter(s32 id, bool unused); // corresponds to setup at 8002b6b0
|
||||
};
|
||||
|
||||
// Suggested name: dEmitter_c
|
||||
class EffectsStruct : public dEmitterBase_c {
|
||||
public:
|
||||
enum Flags_e {
|
||||
EMITTER_0x1 = 0x1,
|
||||
EMITTER_0x2 = 0x2,
|
||||
EMITTER_0x4 = 0x4,
|
||||
EMITTER_Fading = 0x8,
|
||||
EMITTER_0x10 = 0x10,
|
||||
EMITTER_0x20 = 0x20,
|
||||
};
|
||||
|
||||
// vt at 0x1C
|
||||
EffectsStruct();
|
||||
EffectsStruct(dBase_c *);
|
||||
@@ -86,6 +98,8 @@ public:
|
||||
|
||||
void addToActiveEmittersList(u16 resourceId, bool bFlags);
|
||||
void removeFromActiveEmittersList();
|
||||
void execute();
|
||||
void setFading(u8 lifetime);
|
||||
|
||||
void remove(bool bForceDeleteEmitters);
|
||||
void fn_80029920(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
|
||||
@@ -94,22 +108,46 @@ public:
|
||||
void fn_80029A10(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
|
||||
void fn_80029A70(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
|
||||
|
||||
static void fn_800298C0(u16 effect, mVec3_c *pos, void *, void *, void *, void *);
|
||||
|
||||
bool hasEmitters() const {
|
||||
return mpEmitterHead != 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool checkFlag(u32 flag) const {
|
||||
return mFlags & flag;
|
||||
}
|
||||
|
||||
void onFlag(u32 flag) {
|
||||
mFlags |= flag;
|
||||
}
|
||||
|
||||
void offFlag(u32 flag) {
|
||||
mFlags &= ~flag;
|
||||
}
|
||||
|
||||
void realizeAlpha();
|
||||
bool areAllEmittersDone();
|
||||
|
||||
protected:
|
||||
bool canReuse(u16 resourceId) const {
|
||||
return hasEmitters() && !checkFlag(EMITTER_0x2) && mEffect == resourceId;
|
||||
}
|
||||
|
||||
bool createEffect(
|
||||
bool bFlags, u16 resourceId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2
|
||||
);
|
||||
|
||||
static bool shouldBePaused(dBase_c *owner);
|
||||
bool getOwnerPolyAttrs(s32 *pOut1, s32 *pOut2);
|
||||
|
||||
public:
|
||||
/* 0x24 */ TListNode<EffectsStruct> mNode;
|
||||
|
||||
protected:
|
||||
/* 0x28 */ dBase_c *mpOwner;
|
||||
/* 0x2C */ u8 field_0x2C;
|
||||
/* 0x2D */ u8 _0x2D[0x30 - 0x2D];
|
||||
/* 0x2C */ u8 mFadeTimer;
|
||||
/* 0x2D */ u8 mFadeDuration;
|
||||
/* 0x2E */ u8 _0x2D[0x30 - 0x2E];
|
||||
/* 0x30 */ u16 mFlags;
|
||||
/* 0x32 */ u16 mEffect;
|
||||
};
|
||||
@@ -171,7 +209,7 @@ public:
|
||||
/* 0x04 */ ParticleCallbackList mEmitterList;
|
||||
};
|
||||
|
||||
class dParticleFogProc_c : public d3d::EggTextureProc {
|
||||
class dParticleFogProc_c : public d3d::UnkProc {
|
||||
public:
|
||||
virtual ~dParticleFogProc_c() {}
|
||||
virtual void drawOpa() override {
|
||||
@@ -189,7 +227,7 @@ private:
|
||||
/* 0x1C */ bool field_0x1C;
|
||||
};
|
||||
|
||||
class dEffect2D_c : m2d::Base_c {
|
||||
class dEffect2D_c : public m2d::Base_c {
|
||||
public:
|
||||
dEffect2D_c() : m2d::Base_c(0x80) {}
|
||||
/* vt 0x08 */ virtual ~dEffect2D_c() {}
|
||||
@@ -201,11 +239,13 @@ private:
|
||||
/* 0x10 */ u32 mGroupId;
|
||||
};
|
||||
|
||||
class dJEffEmitterCallback_c : public dEmitterCallback_c {
|
||||
class dMassObjEmitterCallback_c : public dEmitterCallback_c {
|
||||
public:
|
||||
virtual ~dJEffEmitterCallback_c() {}
|
||||
virtual ~dMassObjEmitterCallback_c() {}
|
||||
virtual void executeAfter(JPABaseParticle *);
|
||||
|
||||
void execute();
|
||||
|
||||
/* 0x010 */ mVec3_c field_0x010[0x32];
|
||||
/* 0x268 */ mVec3_c field_0x268[0x32];
|
||||
/* 0x4C0 */ u8 _0x4C0[0x650 - 0x4C0];
|
||||
@@ -265,23 +305,59 @@ public:
|
||||
void init(const char *mdlName, const char *arcName, bool priority);
|
||||
void clear();
|
||||
void remove();
|
||||
void draw() {
|
||||
mProc.entry();
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x04 */ dShpEmitterProc mProc;
|
||||
/* 0xA0 */ s32 field_0xA0;
|
||||
};
|
||||
|
||||
class dJEffManager_c : public dEmitterBase_c {
|
||||
class dMassObjEmitter_c : public dEmitterBase_c {
|
||||
public:
|
||||
dJEffManager_c() : field_0x670(-1), field_0x67C(-1) {}
|
||||
virtual ~dJEffManager_c() {
|
||||
dMassObjEmitter_c() {}
|
||||
virtual ~dMassObjEmitter_c() {
|
||||
remove();
|
||||
}
|
||||
|
||||
void create(u16 resourceId);
|
||||
void remove();
|
||||
|
||||
mColor getField_0x67C() const {
|
||||
return field_0x67C;
|
||||
}
|
||||
|
||||
void execute() {
|
||||
mCallback.execute();
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x020 */ dMassObjEmitterCallback_c mCallback;
|
||||
/* 0x670 */ mColor field_0x670;
|
||||
/* 0x674 */ u8 _0x674[0x67C - 0x674];
|
||||
/* 0x67C */ mColor field_0x67C;
|
||||
};
|
||||
|
||||
class dJEffManager_c {
|
||||
public:
|
||||
static bool createEffManagers();
|
||||
static void removeEffManagers();
|
||||
static void draw(const JPADrawInfo *info, u32 groupId);
|
||||
static void draw();
|
||||
static void execute();
|
||||
static void setupEffects();
|
||||
static dEmitterBase_c *spawnEffect(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
static dEmitterBase_c *spawnUIEffect(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2
|
||||
);
|
||||
static dEmitterBase_c *spawnEffect(
|
||||
u16 effectResourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
|
||||
enum Fx_e {
|
||||
TsuboA,
|
||||
@@ -334,16 +410,16 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
void create(u16 resourceId);
|
||||
void remove();
|
||||
static dEmitterBase_c *spawnEffectInternal(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
static dEmitterBase_c *spawnEffectInternal(
|
||||
u16 effectResourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
);
|
||||
|
||||
static mHeapAllocator_c *ms_allocator;
|
||||
static dJEffManager_c *sManagers;
|
||||
|
||||
/* 0x01C */ dJEffEmitterCallback_c mCallback;
|
||||
/* 0x670 */ s32 field_0x670;
|
||||
/* 0x674 */ u8 _0x674[0x67C - 0x674];
|
||||
/* 0x674 */ s32 field_0x67C;
|
||||
static dMassObjEmitter_c *sManagers;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
#include "toBeSorted/time_area_mgr.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(BOMBF, dAcBombf_c, fProfile::BOMBF, 0x129, 0, 4099);
|
||||
@@ -166,7 +167,6 @@ void dAcBombf_c::regrowBomb() {
|
||||
|
||||
void dAcBombf_c::initializeState_Wait() {}
|
||||
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
|
||||
extern "C" u16 lbl_8057A750;
|
||||
|
||||
void dAcBombf_c::executeState_Wait() {
|
||||
@@ -191,11 +191,11 @@ void dAcBombf_c::executeState_Wait() {
|
||||
|
||||
if (mTimeAreaStruct.check(roomid, m3, 0, 30.0f, 0.1f) && field_0x3D4 != 1) {
|
||||
if (mTimeAreaStruct.field_0x04 == 1) {
|
||||
playSound(0xC0A);
|
||||
playSound(SE_TIMESLIP_TIMESLIP);
|
||||
} else {
|
||||
playSound(0xC0B);
|
||||
playSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
}
|
||||
fn_800298B0(lbl_8057A750, &position, nullptr, 0, 0, 0, 0, 0);
|
||||
dJEffManager_c::spawnEffect(lbl_8057A750, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
}
|
||||
|
||||
scaleFactor *= mTimeAreaStruct.field_0x00;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "d/a/d_a_t_wood_area.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
|
||||
const f32 dAcTWoodArea_c::scaleX = 100.0f;
|
||||
const f32 dAcTWoodArea_c::scaleY = 100.0f;
|
||||
@@ -48,8 +50,7 @@ void dAcTWoodArea_c::executeState_Init() {
|
||||
}
|
||||
void dAcTWoodArea_c::finalizeState_Init() {}
|
||||
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mAng3_c *, u32, u32, u32, u32, u32);
|
||||
extern u16 PARTICLE_RESOURCE_ID_MAPPING[];
|
||||
extern const u16 PARTICLE_RESOURCE_ID_MAPPING_8_;
|
||||
|
||||
void dAcTWoodArea_c::initializeState_Wait() {}
|
||||
|
||||
@@ -63,7 +64,9 @@ void dAcTWoodArea_c::executeState_Wait() {
|
||||
bool someEffectThing = subtype != 1 ? (params & 0xF) != 0 ? false : true : true;
|
||||
if (someEffectThing) {
|
||||
mVec3_c tmp(position.x, position.y + getAttachHeight(), position.z);
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING[8], &tmp, nullptr, 0, 0, 0, 0, 0);
|
||||
dJEffManager_c::spawnEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_8_, tmp, nullptr, nullptr, nullptr, nullptr, 0, 0
|
||||
);
|
||||
}
|
||||
dropItems();
|
||||
}
|
||||
|
||||
@@ -449,7 +449,6 @@ void dAcOtubo_c::finalizeState_Rebirth() {
|
||||
setActorProperty(0x1);
|
||||
}
|
||||
|
||||
extern "C" dEmitterBase_c *fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_109_, PARTICLE_RESOURCE_ID_MAPPING_209_;
|
||||
extern "C" void fn_80022BE0(void *, const mVec3_c &);
|
||||
|
||||
@@ -465,11 +464,11 @@ void dAcOtubo_c::destroy() {
|
||||
fn_80022BE0(BlurAndPaletteManager::GetPInstance(), position);
|
||||
mActorCarryInfo.fn_80050EA0(this);
|
||||
|
||||
dEmitterBase_c *fx_thing = fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_209_, &poscopy2, nullptr, 0, 0, 0, 0, 0);
|
||||
dEmitterBase_c *fx_thing = dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_209_, poscopy2, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
if (fx_thing) {
|
||||
fx_thing->attachEmitterCallbackId(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA);
|
||||
}
|
||||
fx_thing = fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_109_, &position, nullptr, 0, 0, 0, 0, 0);
|
||||
fx_thing = dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_109_, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
if (fx_thing) {
|
||||
fx_thing->bindShpEmitter(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA, false);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/blur_and_palette_manager.h"
|
||||
#include "toBeSorted/dowsing_target.h"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
void float_ordering() {
|
||||
const f32 arr[] = {5.f, 15.f, 7.f, 0.5f, 0.1f};
|
||||
@@ -260,12 +262,11 @@ bool dAcOTumbleWeed_c::checkInvalidGround() const {
|
||||
}
|
||||
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_743_;
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mAng3_c *, u32, u32, u32, u32, u32);
|
||||
|
||||
void dAcOTumbleWeed_c::doBreak() {
|
||||
playSound(0xC2D); // TODO(Sound Id)
|
||||
playSound(SE_TWeed_CUT);
|
||||
mVec3_c pos = getPosition();
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_743_, &pos, nullptr, 0, 0, 0, 0, 0);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_743_, pos, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
deleteRequest();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/attention.h"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_394_;
|
||||
|
||||
void dAcOInsect_c::kill() {
|
||||
// Small Ordering issue between loading particle id and position
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_394_, &position, nullptr, 0, 0, 0, 0, 0);
|
||||
playSound(0x1236); // TODO (Sound ID)
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_394_, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
playSound(SE_Insect_DISAPPEAR); // TODO (Sound ID)
|
||||
deleteRequest();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_SW, dAcOsw_c, fProfile::OBJ_SW, 0x12B, 0, 0x1002);
|
||||
|
||||
@@ -144,7 +146,6 @@ int dAcOsw_c::doDelete() {
|
||||
}
|
||||
|
||||
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_754_;
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mAng3_c *, u32, u32, u32, u32, u32);
|
||||
|
||||
int dAcOsw_c::actorExecute() {
|
||||
mStateMgr.executeState();
|
||||
@@ -153,8 +154,8 @@ int dAcOsw_c::actorExecute() {
|
||||
if (field_0x5A0.field_0x00 <= 0.0f) {
|
||||
if (mScale.x >= 1.0f) {
|
||||
if (!mHidden) {
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_754_, &position, &rotation, 0, 0, 0, 0, 0);
|
||||
playSound(0xC0B);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
|
||||
playSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
mHidden = true;
|
||||
}
|
||||
} else {
|
||||
@@ -166,8 +167,8 @@ int dAcOsw_c::actorExecute() {
|
||||
} else {
|
||||
if (mScale.x <= 0.0f) {
|
||||
if (!mShown) {
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_754_, &position, &rotation, 0, 0, 0, 0, 0);
|
||||
playSound(0xC0A);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
|
||||
playSound(SE_TIMESLIP_TIMESLIP);
|
||||
mShown = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1933,14 +1933,13 @@ void dAcTbox_c::executeState_LoadArchive() {
|
||||
}
|
||||
void dAcTbox_c::finalizeState_LoadArchive() {}
|
||||
|
||||
extern "C" void fn_800298B0(u16 effectIndex, mVec3_c *, mAng3_c *, mVec3_c *, void *, void *, void *, void *);
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_209_;
|
||||
extern "C" const bool isPouchItem(u16);
|
||||
extern "C" dAcItem_c *giveItem3(u16 item, s32);
|
||||
|
||||
void dAcTbox_c::initializeState_Open() {
|
||||
mScale.set(1.0f, 1.0f, 1.0f);
|
||||
playSound(0xA36);
|
||||
playSound(SE_TBox_OPEN_A);
|
||||
clearActorProperty(0x100);
|
||||
if (mVariant == NORMAL) {
|
||||
mAnmMatClr1.setFrame(mAnmMatClr1.getFrameMax(0), 0);
|
||||
@@ -1957,7 +1956,7 @@ void dAcTbox_c::initializeState_Open() {
|
||||
mVec3_c pos;
|
||||
fn_8026B380(pos);
|
||||
mVec3_c p2 = fn_8026B3C0();
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_209_, &pos, &rotation, &p2, nullptr, nullptr, nullptr, nullptr);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_209_, pos, &rotation, &p2, nullptr, nullptr, 0, 0);
|
||||
}
|
||||
fn_8026D140();
|
||||
ITEM_ID itemId = mItemId != 0 ? (ITEM_ID)mItemId : ITEM_GODDESS_HARP;
|
||||
@@ -2377,7 +2376,7 @@ void dAcTbox_c::unregisterDowsing() {
|
||||
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_208_;
|
||||
|
||||
void dAcTbox_c::spawnAppearEffect() {
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_208_, &position, &rotation, nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_208_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
|
||||
}
|
||||
|
||||
bool dAcTbox_c::checkIsClear() const {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_WATER_SPOUT, dAcOwaterSpout_c, fProfile::OBJ_WATER_SPOUT, 0x1DA, 0, 6);
|
||||
|
||||
@@ -59,14 +60,13 @@ int dAcOwaterSpout_c::draw() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, mVec3_c *, u32, u32, u32, u32);
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_213_;
|
||||
|
||||
void dAcOwaterSpout_c::initializeState_Wait() {
|
||||
if (params == 1) {
|
||||
return;
|
||||
}
|
||||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_213_, &position, nullptr, &mScale, 0, 0, 0, 0);
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_213_, position, nullptr, &mScale, nullptr, nullptr, 0, 0);
|
||||
}
|
||||
void dAcOwaterSpout_c::executeState_Wait() {
|
||||
if (mMdl.getAnm().isStop()) {
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ int dBase_c::preExecute() {
|
||||
if (fBase_c::preExecute() == 0) {
|
||||
return NOT_READY;
|
||||
}
|
||||
if (s_ExecuteControlFlags && !isProcControlFlag(s_ExecuteControlFlags)) {
|
||||
if (s_ExecuteControlFlags && !isBasePropertyFlag(s_ExecuteControlFlags)) {
|
||||
return NOT_READY;
|
||||
}
|
||||
return SUCCEEDED;
|
||||
@@ -41,7 +41,7 @@ int dBase_c::preDraw() {
|
||||
if (fBase_c::preDraw() == NOT_READY) {
|
||||
return NOT_READY;
|
||||
}
|
||||
if (s_DrawControlFlags && !isProcControlFlag(s_DrawControlFlags)) {
|
||||
if (s_DrawControlFlags && !isBasePropertyFlag(s_DrawControlFlags)) {
|
||||
return NOT_READY;
|
||||
}
|
||||
return SUCCEEDED;
|
||||
|
||||
@@ -722,7 +722,7 @@ void dLytMeterDowsing_c::executeState_DemoMove() {
|
||||
idx = i + DOWSING_PANE_ITEM_OFFSET;
|
||||
nw4r::math::MTX34 mtx = mpPanes[idx]->GetGlobalMtx();
|
||||
mVec3_c pos(mtx._03, mtx._13, 0.0f);
|
||||
EffectsStruct::fn_800298C0(PARTICLE_RESOURCE_ID_MAPPING_970_, &pos, nullptr, nullptr, nullptr, nullptr);
|
||||
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_970_, pos, nullptr, nullptr, nullptr, nullptr);
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_DOWSING_ADD);
|
||||
}
|
||||
} else if (mDemoFrame == 16) {
|
||||
|
||||
@@ -287,7 +287,7 @@ void dLytMeterHeart_c::executeInternal() {
|
||||
if (mEffectHeartIdx >= 0) {
|
||||
nw4r::math::MTX34 mtx = mpHeartPanes[mEffectHeartIdx]->GetGlobalMtx();
|
||||
mVec3_c pos(mtx._03, mtx._13, 0.0f);
|
||||
EffectsStruct::fn_800298C0(PARTICLE_RESOURCE_ID_MAPPING_972_, &pos, nullptr, nullptr, nullptr, nullptr);
|
||||
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_972_, pos, nullptr, nullptr, nullptr, nullptr);
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_HEART_ADD);
|
||||
mEffectHeartIdx = -1;
|
||||
}
|
||||
|
||||
@@ -1410,7 +1410,7 @@ void dLytMeterItemSelect_c::executeState_DemoMove() {
|
||||
|
||||
nw4r::math::MTX34 mtx = mpPanes[i + ITEM_SELECT_PANE_ICON_OFFSET]->GetGlobalMtx();
|
||||
mVec3_c pos(mtx._03, mtx._13, 0.0f);
|
||||
EffectsStruct::fn_800298C0(PARTICLE_RESOURCE_ID_MAPPING_740_, &pos, nullptr, nullptr, nullptr, nullptr);
|
||||
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_740_, pos, nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
if (mIsBocoburinLocked[i]) {
|
||||
mIsBocoburinLocked[i] = false;
|
||||
|
||||
@@ -391,16 +391,16 @@ void LytMeterTimerPart1_c::createEffect(s32 fruitIndex) {
|
||||
pos.x = mtx._03;
|
||||
pos.y = mtx._13;
|
||||
pos.z = 0.0f;
|
||||
EffectsStruct::fn_800298C0(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_135_, &pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_CIRCLE],
|
||||
dJEffManager_c::spawnUIEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_135_, pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_CIRCLE],
|
||||
&mColors2[TIMER_01_COLOR_01_CIRCLE]
|
||||
);
|
||||
EffectsStruct::fn_800298C0(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_136_, &pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_SHADOW],
|
||||
dJEffManager_c::spawnUIEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_136_, pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_SHADOW],
|
||||
&mColors2[TIMER_01_COLOR_01_SHADOW]
|
||||
);
|
||||
EffectsStruct::fn_800298C0(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_137_, &pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_RAINBOW_CIRCLE],
|
||||
dJEffManager_c::spawnUIEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_137_, pos, nullptr, nullptr, &mColors1[TIMER_01_COLOR_00_RAINBOW_CIRCLE],
|
||||
&mColors2[TIMER_01_COLOR_01_RAINBOW_CIRCLE]
|
||||
);
|
||||
}
|
||||
@@ -1000,8 +1000,8 @@ void LytMeterTimerPart2_c::createSingleFruitEffect() {
|
||||
pos.x = mtx._03;
|
||||
pos.y = mtx._13;
|
||||
pos.z = 0.0f;
|
||||
EffectsStruct::fn_800298C0(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_174_, &pos, nullptr, nullptr, &mColors1[TIMER_02_COLOR_00_00],
|
||||
dJEffManager_c::spawnUIEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_174_, pos, nullptr, nullptr, &mColors1[TIMER_02_COLOR_00_00],
|
||||
&mColors2[TIMER_02_COLOR_01_00]
|
||||
);
|
||||
}
|
||||
@@ -1012,8 +1012,8 @@ void LytMeterTimerPart2_c::createFruitCompleteEffect() {
|
||||
pos.x = mtx._03;
|
||||
pos.y = mtx._13;
|
||||
pos.z = 0.0f;
|
||||
EffectsStruct::fn_800298C0(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_206_, &pos, nullptr, nullptr, &mColors1[TIMER_02_COLOR_00_01],
|
||||
dJEffManager_c::spawnUIEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_206_, pos, nullptr, nullptr, &mColors1[TIMER_02_COLOR_00_01],
|
||||
&mColors2[TIMER_02_COLOR_01_01]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ void EggTextureProc::doDraw() {}
|
||||
|
||||
void EggTextureProc::doRemove() {}
|
||||
|
||||
bool EggTextureProc::create(int prioOpa, int prioXlu, mAllocator_c *alloc) {
|
||||
bool UnkProc::create(int prioOpa, int prioXlu, mAllocator_c *alloc) {
|
||||
if (!m3d::proc_c::create(alloc, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ bool EggTextureProc::create(int prioOpa, int prioXlu, mAllocator_c *alloc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EggTextureProc::createXlu(int prioXlu, mAllocator_c *alloc) {
|
||||
bool UnkProc::createXlu(int prioXlu, mAllocator_c *alloc) {
|
||||
if (!m3d::proc_c::create(alloc, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+250
-12
@@ -2,10 +2,13 @@
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "c/c_math.h"
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_base.h"
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/d_stage_mgr.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "f/f_base.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "m/m_color.h"
|
||||
#include "m/m_mtx.h"
|
||||
@@ -21,11 +24,28 @@
|
||||
#include "toBeSorted/blur_and_palette_manager.h"
|
||||
#include "toBeSorted/d_particle.h"
|
||||
#include "toBeSorted/effects_struct.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/lyt_related_floats.h"
|
||||
|
||||
#include "rvl/GX.h"
|
||||
#include "rvl/MTX.h"
|
||||
|
||||
void float_ordering_1(s32 a) {
|
||||
(f32) a;
|
||||
}
|
||||
|
||||
void float_ordering_2() {
|
||||
255.0f;
|
||||
}
|
||||
|
||||
void float_ordering_3(u32 a) {
|
||||
(f32) a;
|
||||
}
|
||||
|
||||
void float_ordering_4() {
|
||||
0.0f;
|
||||
}
|
||||
|
||||
typedef TList<EffectsStruct, offsetof(EffectsStruct, mNode)> EffectsList;
|
||||
EffectsList sPlayingEffectsList;
|
||||
CommonEmitterCallback sCommonEmitterCallbacks[2];
|
||||
@@ -86,13 +106,14 @@ JPABaseEmitter *dEmitterBase_c::GetNextEmitter(JPABaseEmitter *head) {
|
||||
}
|
||||
|
||||
bool dEmitterBase_c::createEmitters(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
) {
|
||||
u16 iter = effectResourceId;
|
||||
JPABaseEmitter *head = nullptr;
|
||||
JPABaseEmitter *last;
|
||||
for (; iter != 0xFFFF; iter = dParticle::mgr_c::GetInstance()->getJpnData(iter)) {
|
||||
last = dParticle::mgr_c::GetInstance()->createEmitter(iter, fn_80028900(iter), position, rot, scale);
|
||||
last = dParticle::mgr_c::GetInstance()->createEmitter(iter, getGroupId(iter), position, rot, scale);
|
||||
if (last != nullptr) {
|
||||
if (head != nullptr) {
|
||||
head->setUserWork(reinterpret_cast<u32>(last));
|
||||
@@ -290,7 +311,7 @@ EffectsStruct::~EffectsStruct() {
|
||||
}
|
||||
|
||||
void EffectsStruct::remove(bool bForceDeleteEmitters) {
|
||||
mFlags &= ~0x1;
|
||||
offFlag(EMITTER_0x1);
|
||||
JPABaseEmitter *emitter = bForceDeleteEmitters ? mpEmitterHead : nullptr;
|
||||
deactivateEmitters();
|
||||
for (; emitter != nullptr; emitter = GetNextEmitter(emitter)) {
|
||||
@@ -304,12 +325,12 @@ void EffectsStruct::addToActiveEmittersList(u16 resourceId, bool bFlags) {
|
||||
mFlags = 0;
|
||||
setImmortal();
|
||||
sPlayingEffectsList.append(this);
|
||||
mFlags |= 1;
|
||||
onFlag(EMITTER_0x1);
|
||||
if (bFlags) {
|
||||
mFlags |= 4;
|
||||
onFlag(EMITTER_0x4);
|
||||
}
|
||||
if (dParticle::mgr_c::GetInstance()->getResUserWork(resourceId) & 0x4000) {
|
||||
mFlags |= 0x10;
|
||||
onFlag(EMITTER_0x10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +338,7 @@ bool EffectsStruct::areAllEmittersDone() {
|
||||
bool allDone = true;
|
||||
|
||||
if (mpEmitterHead != nullptr) {
|
||||
if ((mFlags & 0x8) != 0 && field_0x2C != 0) {
|
||||
if (checkFlag(EMITTER_Fading) && mFadeTimer != 0) {
|
||||
return false;
|
||||
}
|
||||
for (JPABaseEmitter *emitter = mpEmitterHead; emitter != nullptr; emitter = GetNextEmitter(emitter)) {
|
||||
@@ -334,6 +355,63 @@ bool EffectsStruct::areAllEmittersDone() {
|
||||
return allDone;
|
||||
}
|
||||
|
||||
void EffectsStruct::execute() {
|
||||
if (mpOwner != nullptr && (mpOwner->delete_request || mpOwner->lifecycle_state == fBase_c::TO_BE_DELETED)) {
|
||||
mpOwner = nullptr;
|
||||
}
|
||||
if (shouldBePaused(mpOwner)) {
|
||||
if (!checkFlag(EMITTER_0x10)) {
|
||||
stopCalcEmitters();
|
||||
if (mpOwner != nullptr && !mpOwner->isBasePropertyFlag(0x100)) {
|
||||
if (!mpEmitterHead->checkStatus(JPAEmtrStts_StopDraw)) {
|
||||
onFlag(EMITTER_0x20);
|
||||
stopDrawParticles();
|
||||
}
|
||||
} else {
|
||||
if (checkFlag(EMITTER_0x20)) {
|
||||
offFlag(EMITTER_0x20);
|
||||
playDrawParticles();
|
||||
}
|
||||
}
|
||||
}
|
||||
onFlag(EMITTER_0x1);
|
||||
} else {
|
||||
playCalcEmitters();
|
||||
if (checkFlag(EMITTER_0x20)) {
|
||||
offFlag(EMITTER_0x20);
|
||||
playDrawParticles();
|
||||
}
|
||||
if (checkFlag(EMITTER_Fading) && mFadeTimer != 0) {
|
||||
mFadeTimer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EffectsStruct::getOwnerPolyAttrs(s32 *pOut1, s32 *pOut2) {
|
||||
if (mpOwner != nullptr && mpOwner->group_type == fBase_c::ACTOR) {
|
||||
dAcBase_c *actor = static_cast<dAcBase_c *>(mpOwner);
|
||||
*pOut1 = actor->polyAttr0;
|
||||
*pOut2 = actor->polyAttr1;
|
||||
return true;
|
||||
} else {
|
||||
*pOut1 = 0;
|
||||
*pOut2 = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void EffectsStruct::realizeAlpha() {
|
||||
setGlobalAlpha(mFadeTimer * (255.0f / mFadeDuration));
|
||||
}
|
||||
|
||||
void EffectsStruct::setFading(u8 lifetime) {
|
||||
if (!checkFlag(EMITTER_Fading)) {
|
||||
mFadeTimer = lifetime;
|
||||
onFlag(EMITTER_Fading);
|
||||
mFadeDuration = lifetime;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" bool fn_80054AD0();
|
||||
void dEffect2D_c::draw() {
|
||||
f32 proj[GX_PROJECTION_SZ];
|
||||
@@ -360,7 +438,7 @@ void dEffect2D_c::create(u32 groupId, u8 prio) {
|
||||
setPriority(prio);
|
||||
}
|
||||
|
||||
void dJEffEmitterCallback_c::executeAfter(JPABaseParticle *) {}
|
||||
void dMassObjEmitterCallback_c::executeAfter(JPABaseParticle *) {}
|
||||
|
||||
void dShpEmitterProc::doDraw() {
|
||||
mMtx_c viewMtx;
|
||||
@@ -478,14 +556,14 @@ void dShpEmitter_c::draw(JPABaseEmitter *emitter, JPABaseParticle *particle) {
|
||||
particle->setInvisibleParticleFlag();
|
||||
}
|
||||
|
||||
void dJEffManager_c::remove() {
|
||||
void dMassObjEmitter_c::remove() {
|
||||
setEmitterCallback(nullptr);
|
||||
mpEmitterHead = nullptr;
|
||||
}
|
||||
|
||||
extern "C" u32 sNumberOfMgrs; // should be const?
|
||||
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_119_;
|
||||
extern "C" dJEffManager_c *CURRENT_EFFECT_MANAGER_INIT;
|
||||
extern "C" dMassObjEmitter_c *CURRENT_EFFECT_MANAGER_INIT;
|
||||
|
||||
// various grasses being cut
|
||||
extern const u16 sEffectResourceIds[];
|
||||
@@ -568,10 +646,103 @@ void dJEffManager_c::removeEffManagers() {
|
||||
static u32 sInts[] = {0x28, 0x29, 0x87, 0x88, 0x89, 0x8A, 0x8C, 0x8D, 0x91, 0x86, 0x1, 0x2};
|
||||
static u32 sInts2[] = {0x2, 0x87, 0x8B};
|
||||
|
||||
s32 dEmitterBase_c::getGroupId(u16 resourceId) {
|
||||
u32 mask = dParticle::mgr_c::GetInstance()->getResUserWork(resourceId);
|
||||
s32 bit = 1;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if ((mask & (1 << i)) != 0) {
|
||||
bit = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int i = sInts[bit];
|
||||
// TODO explain this
|
||||
if ((mask & 0x8000) != 0) {
|
||||
if (i == 3) {
|
||||
i = 2;
|
||||
} else if (i == 5) {
|
||||
i = 4;
|
||||
} else if (i == 7) {
|
||||
i = 6;
|
||||
} else if (i == 1) {
|
||||
i = 0;
|
||||
} else if (i == 11) {
|
||||
i = 10;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void dJEffManager_c::execute() {
|
||||
for (EffectsList::Iterator it = sPlayingEffectsList.GetBeginIter(); it != sPlayingEffectsList.GetEndIter();) {
|
||||
EffectsList::Iterator itNext = it;
|
||||
++itNext;
|
||||
it->execute();
|
||||
if (it->checkFlag(EffectsStruct::EMITTER_Fading)) {
|
||||
it->realizeAlpha();
|
||||
}
|
||||
if (it->checkFlag(EffectsStruct::EMITTER_0x1)) {
|
||||
it->offFlag(EffectsStruct::EMITTER_0x1);
|
||||
} else {
|
||||
if (it->areAllEmittersDone()) {
|
||||
it->remove(false);
|
||||
} else {
|
||||
it->onFlag(EffectsStruct::EMITTER_0x2);
|
||||
}
|
||||
}
|
||||
it = itNext;
|
||||
}
|
||||
|
||||
if (dStageMgr_c::GetInstance() != nullptr) {
|
||||
CURRENT_EFFECT_MANAGER_INIT->setGlobalAlpha(dStageMgr_c::GetInstance()->getGlobalAlpha());
|
||||
}
|
||||
|
||||
for (s32 i = 0; i < sNumberOfMgrs; i++) {
|
||||
mColor c = sManagers[i].getField_0x67C();
|
||||
sManagers[i].loadColors(&c, nullptr, 0, 0);
|
||||
sManagers[i].execute();
|
||||
}
|
||||
|
||||
if ((dBase_c::s_ExecuteControlFlags & 0x6F9) == 0) {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
dParticle::mgr_c::GetInstance()->calc(i);
|
||||
}
|
||||
} else {
|
||||
dParticle::mgr_c::GetInstance()->calc(9);
|
||||
}
|
||||
|
||||
dParticle::mgr_c::GetInstance()->calc(12);
|
||||
dParticle::mgr_c::GetInstance()->calc(13);
|
||||
dParticle::mgr_c::GetInstance()->calc(14);
|
||||
}
|
||||
|
||||
void dJEffManager_c::draw() {
|
||||
for (s32 i = 0; i < 12; i++) {
|
||||
sFogProcs[i].entry();
|
||||
}
|
||||
|
||||
s2DEffects[0].addToDrawList();
|
||||
s2DEffects[1].addToDrawList();
|
||||
s2DEffects[2].addToDrawList();
|
||||
|
||||
for (s32 i = 0; i < 47; i++) {
|
||||
sShpEmitters[i].draw();
|
||||
}
|
||||
}
|
||||
|
||||
bool EffectsStruct::shouldBePaused(dBase_c *owner) {
|
||||
return owner != nullptr && !owner->isBasePropertyFlag(dBase_c::BASE_PROP_0x4) &&
|
||||
(EventManager::isInEvent() || owner->isProcControlFlag(fBase_c::DISABLE_EXECUTE) ||
|
||||
// TODO execute control flags
|
||||
(owner->s_ExecuteControlFlags & 0x6fb));
|
||||
}
|
||||
|
||||
bool dJEffManager_c::createEffManagers() {
|
||||
EGG::Heap *heap = dHeap::work1Heap.heap;
|
||||
ms_allocator = new (heap, 4) mHeapAllocator_c();
|
||||
sManagers = new (heap, 4) dJEffManager_c[sNumberOfMgrs];
|
||||
sManagers = new (heap, 4) dMassObjEmitter_c[sNumberOfMgrs];
|
||||
|
||||
for (s32 idx = 0; idx < sNumberOfMgrs; idx++) {
|
||||
// TODO explain this
|
||||
@@ -604,7 +775,50 @@ bool dJEffManager_c::createEffManagers() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void dEmitterBase_c::loadColors(JPABaseEmitter *emitter, const GXColor *color1, const GXColor *color2, s32 plltIdx1, s32 plltIdx2) {
|
||||
dEmitterBase_c *dJEffManager_c::spawnEffectInternal(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
) {
|
||||
if (!sEmitter.createEmitters(effectResourceId, position, rot, scale, c1, c2, idx1, idx2)) {
|
||||
return nullptr;
|
||||
}
|
||||
return &sEmitter;
|
||||
}
|
||||
|
||||
dEmitterBase_c *dJEffManager_c::spawnEffectInternal(
|
||||
u16 effectResourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
) {
|
||||
dEmitterBase_c *e = spawnEffectInternal(effectResourceId, mVec3_c::Zero, nullptr, nullptr, c1, c2, idx1, idx2);
|
||||
if (e != nullptr) {
|
||||
e->setTransform(transform);
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
dEmitterBase_c *dJEffManager_c::spawnEffect(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2, s32 idx1, s32 idx2
|
||||
) {
|
||||
return spawnEffectInternal(effectResourceId, position, rot, scale, c1, c2, idx1, idx2);
|
||||
}
|
||||
|
||||
dEmitterBase_c *dJEffManager_c::spawnUIEffect(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2
|
||||
) {
|
||||
mVec3_c adjustedPosition(position.x * getlbl_80571C50(), position.y, position.z);
|
||||
return spawnEffectInternal(effectResourceId, adjustedPosition, rot, scale, c1, c2, 0, 0);
|
||||
}
|
||||
|
||||
dEmitterBase_c *dJEffManager_c::spawnEffect(
|
||||
u16 effectResourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2
|
||||
) {
|
||||
return spawnEffectInternal(effectResourceId, transform, c1, c2, idx1, idx2);
|
||||
}
|
||||
|
||||
void dEmitterBase_c::loadColors(
|
||||
JPABaseEmitter *emitter, const GXColor *color1, const GXColor *color2, s32 plltIdx1, s32 plltIdx2
|
||||
) {
|
||||
BlurAndPaletteManager &mgr = BlurAndPaletteManager::GetInstance();
|
||||
u8 r1 = 0xFF;
|
||||
u8 g1 = 0xFF;
|
||||
@@ -711,3 +925,27 @@ void EffectsStruct::removeFromActiveEmittersList() {
|
||||
sPlayingEffectsList.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool EffectsStruct::createEffect(
|
||||
bool bFlags, u16 resourceId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2
|
||||
) {
|
||||
if (!bFlags && canReuse(resourceId)) {
|
||||
setPosRotScale(pos, rot, scale);
|
||||
s32 idx1 = 0;
|
||||
s32 idx2 = 0;
|
||||
getOwnerPolyAttrs(&idx1, &idx2);
|
||||
loadColors(c1, c2, idx1, idx2);
|
||||
onFlag(EMITTER_0x1);
|
||||
} else {
|
||||
remove(false);
|
||||
s32 idx1 = 0;
|
||||
s32 idx2 = 0;
|
||||
getOwnerPolyAttrs(&idx1, &idx2);
|
||||
if (createEmitters(resourceId, pos, rot, scale, c1, c2, idx1, idx2)) {
|
||||
addToActiveEmittersList(resourceId, bFlags);
|
||||
}
|
||||
}
|
||||
|
||||
return hasEmitters();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user