This commit is contained in:
robojumper
2025-05-04 16:28:18 +02:00
parent a800282135
commit 820c08e1d6
15 changed files with 248 additions and 109 deletions
@@ -9,7 +9,7 @@ __dt__23sFState_c<10dAcOtubo_c>Fv = .text:0x00000280; // type:function size:0x58
__dt__26sFStateFct_c<10dAcOtubo_c>Fv = .text:0x000002E0; // type:function size:0x6C
__dt__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000350; // type:function size:0xA0
__dt__49sFStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003F0; // type:function size:0xA4
__dt__17EffectsStruct_ExtFv = .text:0x000004A0; // type:function size:0x5C
__dt__14dWaterEffect_cFv = .text:0x000004A0; // type:function size:0x5C
createHeap__10dAcOtubo_cFv = .text:0x00000500; // type:function size:0x90
actorCreate__10dAcOtubo_cFv = .text:0x00000590; // type:function size:0x2B0
changeState__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000840; // type:function size:0x10
@@ -102,7 +102,7 @@ __vt__49sFStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c> = .data:0x00000108; //
__vt__79sStateMgr_c<10dAcOtubo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000138; // type:object size:0x30
__vt__26sFStateFct_c<10dAcOtubo_c> = .data:0x00000168; // type:object size:0x14
__vt__23sFState_c<10dAcOtubo_c> = .data:0x00000180; // type:object size:0x18
__vt__17EffectsStruct_Ext = .data:0x00000198; // type:object size:0xC
__vt__14dWaterEffect_c = .data:0x00000198; // type:object size:0xC
__vt__15dShadowCircle_c = .data:0x000001A4; // type:object size:0xC
__vt__25sFStateID_c<10dAcOtubo_c> = .data:0x000002F0; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
+26 -26
View File
@@ -938,25 +938,25 @@ create__13dShpEmitter_cFP16mHeapAllocator_c = .text:0x80028010; // type:function
init__13dShpEmitter_cFPCcPCcb = .text:0x80028080; // type:function size:0x100
clear__13dShpEmitter_cFv = .text:0x80028180; // type:function size:0x10
draw__13dShpEmitter_cFP14JPABaseEmitterP15JPABaseParticle = .text:0x80028190; // type:function size:0x270
fn_80028400 = .text:0x80028400; // type:function size:0x18
draw__21CommonEmitterCallbackFP14JPABaseEmitter = .text:0x80028400; // type:function size:0x18
fn_80028420 = .text:0x80028420; // type:function size:0x58
executeAfter__22dJEffEmitterCallback_cFP15JPABaseParticle = .text:0x80028480; // type:function size:0x170
execute__22dJEffEmitterCallback_cFv = .text:0x800285F0; // type:function size:0x19C
executeAfter__25dMassObjEmitterCallback_cFP14JPABaseEmitter = .text:0x80028480; // type:function size:0x170
execute__25dMassObjEmitterCallback_cFv = .text:0x800285F0; // type:function size:0x19C
fn_80028790 = .text:0x80028790; // type:function size:0x88
create__14dJEffManager_cFUs = .text:0x80028820; // type:function size:0x9C
create__17dMassObjEmitter_cFUs = .text:0x80028820; // type:function size:0x9C
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
vt_0x20__18dEmitterCallback_cFP14JPABaseEmitter = .text:0x80029070; // type:function size:0x4
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
shouldBePaused__13EffectsStructFP7dBase_c = .text:0x80029300; // type:function size:0x94
createEffManagers__14dJEffManager_cFv = .text:0x800293A0; // type:function size:0x1EC
__ct__17dMassObjEmitter_cFv = .text:0x80029590; // type:function size:0xC8
__dt__22dJEffEmitterCallback_cFv = .text:0x80029660; // type:function size:0x90
__dt__25dMassObjEmitterCallback_cFv = .text:0x80029660; // type:function size:0x90
__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
@@ -973,33 +973,33 @@ 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
createEffect__13EffectsStructFbUsRC7mVec3_cPC7mAng3_cPC7mVec3_cPC8_GXColorPC8_GXColor = .text:0x8002A0D0; // type:function size:0x15C
fn_8002A230 = .text:0x8002A230; // type:function size:0x150
createEffect__13EffectsStructFbUsRC6mMtx_cPC8_GXColorPC8_GXColor = .text:0x8002A230; // type:function size:0x150
fn_8002A380 = .text:0x8002A380; // type:function size:0xCC
fn_8002A450 = .text:0x8002A450; // type:function size:0x1C0
fn_8002A610 = .text:0x8002A610; // type:function size:0x678
fn_8002AC90 = .text:0x8002AC90; // type:function size:0x460
fn_8002B0F0 = .text:0x8002B0F0; // type:function size:0x8
init__17EffectsStruct_ExtFP7dBase_cfff = .text:0x8002B100; // type:function size:0x14
fn_8002B120__17EffectsStruct_ExtFff = .text:0x8002B120; // type:function size:0x1F4
fn_8002B320 = .text:0x8002B320; // type:function size:0x4
fn_8002B330 = .text:0x8002B330; // type:function size:0x4
fn_8002B340 = .text:0x8002B340; // type:function size:0x4
fn_8002B350 = .text:0x8002B350; // type:function size:0x4
init__14dWaterEffect_cFP12dAcObjBase_cfff = .text:0x8002B100; // type:function size:0x14
execute__14dWaterEffect_cFff = .text:0x8002B120; // type:function size:0x1F4
drawAfter__18JPAEmitterCallBackFP14JPABaseEmitter = .text:0x8002B320; // type:function size:0x4
draw__18JPAEmitterCallBackFP14JPABaseEmitter = .text:0x8002B330; // type:function size:0x4
execute__18JPAEmitterCallBackFP14JPABaseEmitter = .text:0x8002B340; // type:function size:0x4
executeAfter__18JPAEmitterCallBackFP14JPABaseEmitter = .text:0x8002B350; // type:function size:0x4
__dt__21CommonEmitterCallbackFv = .text:0x8002B360; // type:function size:0x58
fn_8002B3C0 = .text:0x8002B3C0; // type:function size:0x4
execute__19JPAParticleCallBackFP14JPABaseEmitterP15JPABaseParticle = .text:0x8002B3C0; // type:function size:0x4
__dt__13dShpEmitter_cFv = .text:0x8002B3D0; // type:function size:0x7C
__dt__15dShpEmitterProcFv = .text:0x8002B450; // type:function size:0x68
fn_8002B4C0 = .text:0x8002B4C0; // type:function size:0x5C
fn_8002B520 = .text:0x8002B520; // type:function size:0x58
__dt__11dShpProc1_cFv = .text:0x8002B4C0; // type:function size:0x5C
__dt__14dShpProcBase_cFv = .text:0x8002B520; // type:function size:0x58
drawXlu__15dShpEmitterProcFv = .text:0x8002B580; // type:function size:0x4
drawOpa__15dShpEmitterProcFv = .text:0x8002B590; // type:function size:0x4
__dt__11dEffect2D_cFv = .text:0x8002B5A0; // type:function size:0x58
__dt__18dParticleFogProc_cFv = .text:0x8002B600; // type:function size:0x5C
drawXlu__18dParticleFogProc_cFv = .text:0x8002B660; // type:function size:0x4
drawOpa__18dParticleFogProc_cFv = .text:0x8002B670; // type:function size:0x4
fn_8002B680 = .text:0x8002B680; // type:function size:0x4
fn_8002B690 = .text:0x8002B690; // type:function size:0x4
fn_8002B6A0 = .text:0x8002B6A0; // type:function size:0x4
draw__19JPAParticleCallBackFP14JPABaseEmitterP15JPABaseParticle = .text:0x8002B680; // type:function size:0x4
drawXlu__11dShpProc1_cFv = .text:0x8002B690; // type:function size:0x4
drawOpa__11dShpProc1_cFv = .text:0x8002B6A0; // type:function size:0x4
__sinit_\d_effects_1_cpp = .text:0x8002B6B0; // type:function size:0x158
__ct__21CommonEmitterCallbackFv = .text:0x8002B810; // type:function size:0x18
__arraydtor$9497 = .text:0x8002B830; // type:function size:0x1C
@@ -29904,8 +29904,8 @@ __vt__21BlurAndPaletteManager = .data:0x80500E80; // type:object size:0xC
lbl_80500E8C = .data:0x80500E8C; // type:object size:0xC
lbl_80500E98 = .data:0x80500E98; // type:object size:0x10 data:string
lbl_80500EA8 = .data:0x80500EA8; // type:object size:0x444
__vt__14dJEffManager_c = .data:0x805012EC; // type:object size:0xC
__vt__22dJEffEmitterCallback_c = .data:0x805012F8; // type:object size:0x24
__vt__17dMassObjEmitter_c = .data:0x805012EC; // type:object size:0xC
__vt__25dMassObjEmitterCallback_c = .data:0x805012F8; // type:object size:0x24
__vt__21CommonEmitterCallback = .data:0x8050131C; // type:object size:0x1C
__vt__13dShpEmitter_c = .data:0x80501338; // type:object size:0x14
__vt__15dShpEmitterProc = .data:0x8050134C; // type:object size:0x2C
@@ -48465,12 +48465,12 @@ lbl_8058F1F0 = .bss:0x8058F1F0; // type:object size:0x20 data:byte
lbl_8058F210 = .bss:0x8058F210; // type:object size:0x10
sInstance__21BlurAndPaletteManager = .bss:0x8058F220; // type:object size:0x5D70
lbl_80594F90 = .bss:0x80594F90; // type:object size:0x10 data:4byte
lbl_80594FA0 = .bss:0x80594FA0; // type:object size:0x18 data:4byte
sPlayingEffectsList__14dJEffManager_c = .bss:0x80594FA0; // type:object size:0x18 data:4byte
lbl_80594FB8 = .bss:0x80594FB8; // type:object size:0x1C
lbl_80594FD4 = .bss:0x80594FD4; // type:object size:0x1E2C
GLOBAL_EFFECT_THING = .bss:0x80596E00; // type:object size:0x30 data:4byte
lbl_80596E30 = .bss:0x80596E30; // type:object size:0x18C
lbl_80596FBC = .bss:0x80596FBC; // type:object size:0x3C
sShpEmitters__14dJEffManager_c = .bss:0x80594FD4; // type:object size:0x1E2C
sEmitter__14dJEffManager_c = .bss:0x80596E00; // type:object size:0x30 data:4byte
sFogProcs__14dJEffManager_c = .bss:0x80596E30; // type:object size:0x18C
s2DEffects__14dJEffManager_c = .bss:0x80596FBC; // type:object size:0x3C
lbl_80596FF8 = .bss:0x80596FF8; // type:object size:0x18 data:2byte
lbl_80597010 = .bss:0x80597010; // type:object size:0x10 data:2byte
lbl_80597020 = .bss:0x80597020; // type:object size:0x10 data:float
+1 -1
View File
@@ -143,7 +143,7 @@ public:
rot_copy = rotation;
}
mVec3_c &GetPostion() {
mVec3_c &GetPosition() {
return position;
}
mAng3_c &GetRotation() {
+1 -1
View File
@@ -90,7 +90,7 @@ private:
/* 0x764 */ dCcD_Sph mSph;
/* 0x8B4 */ STATE_MGR_DECLARE(dAcOtubo_c);
/* 0x8F0 */ dAcObjRef_unk mField_0x8F0;
/* 0x91C */ EffectsStruct_Ext mEff_0x91C;
/* 0x91C */ dWaterEffect_c mEff_0x91C;
/* 0x964 */ dAcRef_c<dAcNpcCeLady_c> mCeLady;
/* 0x970 */ dAcRef_c<dAcNpcCeFriend_c> mCeFriend;
/* 0x97C */ mQuat_c mQuat_0x97C;
+1 -1
View File
@@ -69,7 +69,7 @@ public:
const mQuat_c &GetQuat() const {
return mQuat;
}
const mVec3_c &GetPostion() const {
const mVec3_c &GetPosition() const {
return mPositionMaybe;
}
const f32 GetOffset() const {
+8
View File
@@ -1,6 +1,7 @@
#ifndef D_UNK_MDL_STUFF_2_H
#define D_UNK_MDL_STUFF_2_H
#include "common.h"
#include "m/m3d/m_proc.h"
#include "m/m_allocator.h"
#include "m/m_mtx.h"
@@ -11,6 +12,7 @@
/** a process for drawing shapes directly */
class dShpProcBase_c : public m3d::proc_c {
public:
dShpProcBase_c(): mLightSetId(1) {}
virtual ~dShpProcBase_c() {}
void setResMat(nw4r::g3d::ResMat mat);
@@ -45,6 +47,12 @@ protected:
class dShpProc1_c : public dShpProcBase_c {
public:
virtual ~dShpProc1_c() {}
/* vt 0x18 */ virtual void drawOpa() override {
draw();
}
/* vt 0x1C */ virtual void drawXlu() override {
draw();
};
void clearTransforms() {
mpTransforms = nullptr;
+76 -53
View File
@@ -5,6 +5,8 @@
#include "JSystem/JParticle/JPAEmitter.h"
#include "JSystem/JParticle/JPAParticle.h"
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_base.h"
#include "m/m2d.h"
#include "m/m_allocator.h"
@@ -96,6 +98,10 @@ public:
mpOwner = owner;
}
inline dBase_c *getOwner() const {
return mpOwner;
}
void addToActiveEmittersList(u16 resourceId, bool bFlags);
void removeFromActiveEmittersList();
void execute();
@@ -136,6 +142,7 @@ protected:
bool bFlags, u16 resourceId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
const GXColor *c2
);
bool createEffect(bool bFlags, u16 resourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2);
static bool shouldBePaused(dBase_c *owner);
bool getOwnerPolyAttrs(s32 *pOut1, s32 *pOut2);
@@ -152,30 +159,37 @@ protected:
/* 0x32 */ u16 mEffect;
};
// Not sure if these belongs here, but it uses EffectsStruct
// Related Functions in the 8002B100 area
class EffectsStruct_Ext {
public:
EffectsStruct_Ext() : mField_0x00(1), mField_0x01(0) {}
void init(dBase_c *, f32, f32, f32);
void setField_0x00(u8 val) {
mField_0x00 = val;
}
void setField_0x01(u8 val) {
mField_0x01 = val;
}
void fn_8002B120(f32, f32);
/* 0x00 */ u8 mField_0x00;
/* 0x01 */ u8 mField_0x01;
/* 0x04 */ f32 mField_0x04;
/* 0x08 */ f32 mField_0x08;
/* 0x0C */ f32 mField_0x0C;
class dWaterEffect_c {
private:
/* 0x00 */ bool mIsInWater;
/* 0x01 */ bool mIsSmall;
/* 0x04 */ f32 mHeight;
/* 0x08 */ f32 mDepth;
/* 0x0C */ f32 mScale;
/* 0x10 */ EffectsStruct mEff;
virtual ~EffectsStruct_Ext() {}
dAcObjBase_c *getActor() const {
return static_cast<dAcObjBase_c *>(mEff.getOwner());
}
f32 getActorGroundPos(dAcObjBase_c *obj) const {
return obj->position.y + mDepth;
}
f32 getActorCeilPos(dAcObjBase_c *obj) const {
return obj->position.y + mHeight;
}
public:
dWaterEffect_c() : mIsInWater(1), mIsSmall(false) {}
virtual ~dWaterEffect_c() {}
void init(dAcObjBase_c *, f32 height, f32 scale, f32 depth);
void execute(f32 water, f32 ground);
void setIsSmall(bool val) {
mIsSmall = val;
}
};
/** An emitter callback can be part of multiple emitters. */
@@ -219,11 +233,11 @@ public:
doDraw();
}
void create(s32 idx, s32 unk, s32 unk2, mHeapAllocator_c *alloc);
bool create(u32 idx, s32 prioOpa, s32 prioXlu, mHeapAllocator_c *alloc);
private:
void doDraw();
/* 0x18 */ u8 _0x18[0x1C - 0x18];
/* 0x18 */ u32 mIdx;
/* 0x1C */ bool field_0x1C;
};
@@ -239,38 +253,13 @@ private:
/* 0x10 */ u32 mGroupId;
};
class dMassObjEmitterCallback_c : public dEmitterCallback_c {
public:
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];
// TODO unclear structure boundary
};
class CommonEmitterCallback : public JPAEmitterCallBack {
public:
CommonEmitterCallback() : field_0x04(0) {}
virtual ~CommonEmitterCallback() {}
virtual void executeAfter(JPABaseEmitter *) override;
void init(s32 v) {
field_0x04 = v;
}
private:
/* 0x04 */ s32 field_0x04;
};
class dShpEmitter_c;
class dShpEmitterProc : public dShpProc1_c {
public:
dShpEmitterProc() : mpOwner(nullptr) {}
virtual ~dShpEmitterProc() {
mpTransforms = nullptr;
mpOwner = nullptr;
}
virtual void drawOpa() override {
doDraw();
@@ -293,7 +282,7 @@ private:
// TODO: This is read from JParticle as alpha, but used as the nw4r::g3d lightSetId.
// Is this a creative use of the particle color value, given that particles themselves
// are never drawn?
/* 0x3C */ u8 mAlpha[100];
/* 0x38 */ u8 mAlpha[100];
};
class dShpEmitter_c : public JPAParticleCallBack {
@@ -314,6 +303,32 @@ private:
/* 0xA0 */ s32 field_0xA0;
};
class CommonEmitterCallback : public JPAEmitterCallBack {
public:
CommonEmitterCallback() : field_0x04(0) {}
virtual ~CommonEmitterCallback() {}
virtual void draw(JPABaseEmitter *) override;
void init(s32 v) {
field_0x04 = v;
}
private:
/* 0x04 */ s32 field_0x04;
};
class dMassObjEmitterCallback_c : public dEmitterCallback_c {
public:
virtual ~dMassObjEmitterCallback_c() {}
virtual void executeAfter(JPABaseEmitter *) override;
void execute();
/* 0x010 */ mVec3_c field_0x010[0x32];
/* 0x268 */ mVec3_c field_0x268[0x32];
/* 0x4C0 */ u8 _0x4C0[0x650 - 0x4C0];
// TODO unclear structure boundary
};
class dMassObjEmitter_c : public dEmitterBase_c {
public:
dMassObjEmitter_c() {}
@@ -409,6 +424,14 @@ public:
BWallF210,
};
typedef TList<EffectsStruct, offsetof(EffectsStruct, mNode)> EffectsList;
static EffectsList sPlayingEffectsList;
static CommonEmitterCallback sCommonEmitterCallbacks[2];
static dShpEmitter_c sShpEmitters[47];
static dEmitterBase_c sEmitter;
static dParticleFogProc_c sFogProcs[12];
static dEffect2D_c s2DEffects[3];
private:
static dEmitterBase_c *spawnEffectInternal(
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
+1 -1
View File
@@ -136,7 +136,7 @@ int dAcOChair_c::actorExecute() {
// Calculate the HealCooldown (Heal link if needed)
if (!checkObjectProperty(0x8000)) {
if (!isBench()) {
mCyl.SetC(GetPostion());
mCyl.SetC(GetPosition());
dCcS::GetInstance()->Set(&mCyl);
}
mHealTimer = FIRST_HEAL_COOLDOWN;
+2 -2
View File
@@ -74,7 +74,7 @@ int dAcOtubo_c::actorCreate() {
mObjAcch.Set(this, 1, &mAcchCir);
mAcchCir.SetWall(20.f, 30.f);
mEff_0x91C.init(this, 60.f, mScale.x, 0.f);
mEff_0x91C.setField_0x01(1);
mEff_0x91C.setIsSmall(true);
int unkParam = getParams_0x3000();
if (unkParam != 1 && unkParam != 2) {
fn_8002EA30(-60.f, -20.f, 2.f, 1.f, 4.f, &mObjAcch);
@@ -604,7 +604,7 @@ void dAcOtubo_c::fn_272_2670() {
f32 groundH = mObjAcch.GetGroundH();
f32 waterH = mObjAcch.GetWtrGroundH();
bool noSound = mbSubmerged;
mEff_0x91C.fn_8002B120(waterH, groundH);
mEff_0x91C.execute(waterH, groundH);
if (checkSubmerged()) {
forwardAccel = -0.8f;
+1 -1
View File
@@ -348,7 +348,7 @@ void dAcOTumbleWeed_c::tumbleBounceMaybe() {
}
void dAcOTumbleWeed_c::adjustTimeScale() {
mTimeArea.check(getRoomId(), GetPostion(), 0, 30.f, 0.1f);
mTimeArea.check(getRoomId(), GetPosition(), 0, 30.f, 0.1f);
if (0.f < mTimeArea.getDistMaybe()) {
sLib::chase(&mScale.y, 0.f, 0.07f);
mScale.z = mScale.y;
+1 -1
View File
@@ -1182,7 +1182,7 @@ void dBgS::SetLightingCode(dAcObjBase_c *pObj, const cBgS_PolyInfo &info) {
f32 dBgS::SetLightingCode(dAcObjBase_c *pObj, f32 height) {
dBgS_ObjGndChk objGndChk;
mVec3_c pos = pObj->GetPostion();
mVec3_c pos = pObj->GetPosition();
pos.y += height;
objGndChk.SetPos(&pos);
f32 gndCross = GroundCross(&objGndChk);
+1 -1
View File
@@ -85,7 +85,7 @@ void dBgS_Acch::Set(dAcObjBase_c *pObj, int tblSize, dBgS_AcchCir *pAcchCir) {
mpAcchCir = pAcchCir;
mpMyObj = pObj;
mActorId = pObj->getID();
mpPos = &pObj->GetPostion();
mpPos = &pObj->GetPosition();
mpOldPos = &pObj->GetOldPosition();
mpSpeed = &pObj->GetVelocity();
if (mpSpeed) {
+1 -1
View File
@@ -176,7 +176,7 @@ u32 dCcMassS_Mng::Chk(mVec3_c *p_xyz, dAcObjBase_c **p_actor, dCcMassS_HitInf *p
if (field_0x3A8 & 0x10) {
mVec3_c vec;
PSVECSubtract((*p_actor)->GetPostion(), *p_xyz, vec);
PSVECSubtract((*p_actor)->GetPosition(), *p_xyz, vec);
vec.y = 0;
f32 vecMag = PSVECMag(vec);
if (cM3d_IsZero(vecMag)) {
+1 -1
View File
@@ -515,7 +515,7 @@ bool mShadowChild_c::setGeom(const GXTexObj *texObj, const mMtx_c &mtx, const mQ
void mShadowChild_c::updateMtx() {
const mQuat_c &q = GetQuat();
const mVec3_c &pos = GetPostion();
const mVec3_c &pos = GetPosition();
Set0x13C(q.w);
+125 -17
View File
@@ -3,25 +3,31 @@
#include "c/c_math.h"
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_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 "f/f_profile_name.h"
#include "m/m3d/m3d.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 "nw4r/g3d/g3d_camera.h"
#include "nw4r/g3d/g3d_state.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "nw4r/g3d/res/g3d_resmat.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "nw4r/g3d/res/g3d_resshp.h"
#include "rvl/MTX/mtx.h"
#include "rvl/MTX/mtxvec.h"
#include "nw4r/math/math_arithmetic.h"
#include "sized_string.h"
#include "toBeSorted/arc_managers/oarc_manager.h"
#include "toBeSorted/blur_and_palette_manager.h"
#include "toBeSorted/d_d3d.h"
#include "toBeSorted/d_particle.h"
#include "toBeSorted/effects_struct.h"
#include "toBeSorted/event_manager.h"
@@ -30,6 +36,9 @@
#include "rvl/GX.h"
#include "rvl/MTX.h"
// TODO: This file suffers from vtable and weak function order problems, big time.
// Some of what we think are weak functions may not be weak functions?
void float_ordering_1(s32 a) {
(f32) a;
}
@@ -46,13 +55,12 @@ void float_ordering_4() {
0.0f;
}
typedef TList<EffectsStruct, offsetof(EffectsStruct, mNode)> EffectsList;
EffectsList sPlayingEffectsList;
CommonEmitterCallback sCommonEmitterCallbacks[2];
dShpEmitter_c sShpEmitters[47];
dEmitterBase_c sEmitter;
dParticleFogProc_c sFogProcs[12];
dEffect2D_c s2DEffects[3];
dJEffManager_c::EffectsList dJEffManager_c::sPlayingEffectsList;
CommonEmitterCallback dJEffManager_c::sCommonEmitterCallbacks[2];
dShpEmitter_c dJEffManager_c::sShpEmitters[47];
dEmitterBase_c dJEffManager_c::sEmitter;
dParticleFogProc_c dJEffManager_c::sFogProcs[12];
dEffect2D_c dJEffManager_c::s2DEffects[3];
// broken by -ipa file - reconsider splits?
dEmitterCallback_c::~dEmitterCallback_c() {
@@ -290,13 +298,13 @@ void dEmitterBase_c::setLifeTime(s16 lifetime) {
void dEmitterBase_c::attachEmitterCallbackId(s32 id) {
for (JPABaseEmitter *emitter = mpEmitterHead; emitter != nullptr; emitter = GetNextEmitter(emitter)) {
emitter->setEmitterCallBackPtr(&sCommonEmitterCallbacks[id]);
emitter->setEmitterCallBackPtr(&dJEffManager_c::sCommonEmitterCallbacks[id]);
}
}
void dEmitterBase_c::bindShpEmitter(s32 id, bool unused) {
for (JPABaseEmitter *emitter = mpEmitterHead; emitter != nullptr; emitter = GetNextEmitter(emitter)) {
emitter->setParticleCallBackPtr(&sShpEmitters[id]);
emitter->setParticleCallBackPtr(&dJEffManager_c::sShpEmitters[id]);
emitter->setGlobalAlpha(0);
}
}
@@ -324,7 +332,7 @@ void EffectsStruct::addToActiveEmittersList(u16 resourceId, bool bFlags) {
mEffect = resourceId;
mFlags = 0;
setImmortal();
sPlayingEffectsList.append(this);
dJEffManager_c::sPlayingEffectsList.append(this);
onFlag(EMITTER_0x1);
if (bFlags) {
onFlag(EMITTER_0x4);
@@ -412,6 +420,36 @@ void EffectsStruct::setFading(u8 lifetime) {
}
}
bool dParticleFogProc_c::create(u32 idx, s32 prioOpa, s32 prioXlu, mHeapAllocator_c *alloc) {
if (!d3d::UnkProc::create(prioOpa, prioXlu, alloc)) {
return false;
}
mIdx = idx;
// idxes 0, 2, 4, 6, 10
field_0x1C = idx <= 10 && ((1 << idx) & 0b10001010101) != 0;
return true;
}
void dParticleFogProc_c::doDraw() {
nw4r::g3d::Camera c = m3d::getCurrentCamera();
mMtx_c camMtx, texProjMtx;
c.GetCameraMtx(camMtx);
c.GetProjectionTexMtx(texProjMtx);
JPADrawInfo info;
MTXCopy(camMtx, info.mCamMtx);
MTXCopy(texProjMtx, info.mPrjMtx);
if (field_0x1C) {
m3d::getFogMgr(0); // ignored, maybe an inline on FogMgr?
nw4r::g3d::G3DState::LoadFog(0);
} else {
mColor c(0);
GXSetFog(GX_FOG_NONE, c, 0.0f, 0.0f, 0.0f, 0.0f);
GXSetFogRangeAdj(GX_FALSE, 0, nullptr);
}
GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
dJEffManager_c::draw(&info, mIdx);
}
extern "C" bool fn_80054AD0();
void dEffect2D_c::draw() {
f32 proj[GX_PROJECTION_SZ];
@@ -438,7 +476,7 @@ void dEffect2D_c::create(u32 groupId, u8 prio) {
setPriority(prio);
}
void dMassObjEmitterCallback_c::executeAfter(JPABaseParticle *) {}
void dMassObjEmitterCallback_c::executeAfter(JPABaseEmitter *) {}
void dShpEmitterProc::doDraw() {
mMtx_c viewMtx;
@@ -556,6 +594,10 @@ void dShpEmitter_c::draw(JPABaseEmitter *emitter, JPABaseParticle *particle) {
particle->setInvisibleParticleFlag();
}
void CommonEmitterCallback::draw(JPABaseEmitter *emitter) {
emitter->loadTexture(field_0x04, GX_TEXMAP0);
}
void dMassObjEmitter_c::remove() {
setEmitterCallback(nullptr);
mpEmitterHead = nullptr;
@@ -575,8 +617,8 @@ void dJEffManager_c::setupEffects() {
sShpEmitters[TsuboA].init("FX_TsuboA", "Tubo", false);
sShpEmitters[TsuboB].init("FX_TsuboB", "Tubo", false);
sShpEmitters[BRockA].init("FX_BRockA", "FXBRockA", false);
sShpEmitters[FruitA].init("FX_FruitA", "FruitA", true);
sShpEmitters[BRockA].init("FX_BRockA", "FXBRockA", true);
sShpEmitters[FruitA].init("FX_FruitA", "FruitA", false);
sShpEmitters[GrassCoil].init("FX_GrassCoil", "GrassCoilPiece", false);
sShpEmitters[BRockB].init("FX_BRockB", "RockFace", true);
sShpEmitters[Beehive].init("FX_Beehive", "Bee", false);
@@ -921,8 +963,8 @@ void dEmitterBase_c::loadColors(
}
void EffectsStruct::removeFromActiveEmittersList() {
if (sPlayingEffectsList.GetPosition(this) != sPlayingEffectsList.GetEndIter()) {
sPlayingEffectsList.remove(this);
if (dJEffManager_c::sPlayingEffectsList.GetPosition(this) != dJEffManager_c::sPlayingEffectsList.GetEndIter()) {
dJEffManager_c::sPlayingEffectsList.remove(this);
}
}
@@ -949,3 +991,69 @@ bool EffectsStruct::createEffect(
return hasEmitters();
}
bool EffectsStruct::createEffect(
bool bFlags, u16 resourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2
) {
if (!bFlags && canReuse(resourceId)) {
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, mVec3_c::Zero, nullptr, nullptr, c1, c2, idx1, idx2)) {
addToActiveEmittersList(resourceId, bFlags);
}
}
setTransform(transform);
return hasEmitters();
}
void dWaterEffect_c::init(dAcObjBase_c *base, f32 height, f32 scale, f32 f3) {
mEff.init(base);
mHeight = height;
mScale = scale;
mDepth = f3;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_91_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_127_;
void dWaterEffect_c::execute(f32 water, f32 ground) {
dAcObjBase_c *ac = getActor();
bool b = getActorGroundPos(ac) < water && ground < water;
if (b) {
if (!mIsInWater) {
mIsInWater = true;
mVec3_c pos(ac->position.x, water, ac->position.z);
mVec3_c scale(mScale, mScale, mScale);
if (mIsSmall || water - ground < 50.0f) {
// For small objects or shallow water, create a
// particle FX upon entering water
mAng3_c rot(0, cM::rndF(65536.0f), 0);
dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_91_, pos, &rot, &scale, nullptr, nullptr, 0, 0
);
} else {
// Otherwise spawn a "water spout" with a 3d model
dAcObjBase_c::create(fProfile::OBJ_WATER_SPOUT, -1, 0, &pos, nullptr, &scale, -1);
}
}
} else if (getActorGroundPos(ac) - 5.0f > water) {
mIsInWater = false;
}
if (mIsInWater && getActorCeilPos(ac) > water) {
// Spawn effect upon leaving water
mVec3_c pos(ac->position.x, water, ac->position.z);
mVec3_c scale(mScale, mScale, mScale);
mEff.fn_80029A10(PARTICLE_RESOURCE_ID_MAPPING_127_, &pos, nullptr, &scale, nullptr, nullptr);
f32 rate = nw4r::math::FAbs(ac->forwardSpeed) * 0.02f;
rate = rate > 0.95f ? 0.95f : rate;
mEff.setRate(rate + 0.05f);
}
}