Skip to content

Commit

Permalink
d_a_player_particle (#674)
Browse files Browse the repository at this point in the history
* daPy_mtxPosFollowEcallBack_c::execute matching

* daPy_waterDropEcallBack_c::end matching

* daPy_dmEcallBack_c::execute matching

* daPy_fanSwingEcallBack_c::execute matching

* daPy_waterDropPcallBack_c::execute matching

* daPy_sightPacket_c::draw matching

* daPy_sightPacket_c::setSight matching

* daPy_swBlur_c::initSwBlur matching

* daPy_swBlur_c matching

* daPy_lk_c::setWaterDrop matching

* daPy_lk_c::setFootMark matching

* daPy_footEffect_c work

* daPy_lk_c::resetFootEffect matching

* daPy_lk_c::setSwimTail matching

* daPy_lk_c::setCutWaterSplash matching

* daPy_lk_c::setDamageCurseEmitter matching

* daPy_lk_c::setDamageElecEmitter matching

* daPy_lk_c::setDamageEmitter matching

* daPy_lk_c::endFlameDamageEmitter matching

* daPy_lk_c::setSwimWaterDrop matching

* daPy_lk_c::setItemWaterEffect matching

* daPy_lk_c::setFootEffectType matching

* daPy_lk_c::setFootEffect matching

* daPy_lk_c::setAuraEffect work

* daPy_lk_c::setWaterRipple matching

* d_a_player_particle minor cleanup

* daPy_lk_c::setAuraEffect matching

* Removed comment

* Removed another old comment

* PR suggestions
  • Loading branch information
DanTGL authored Aug 9, 2024
1 parent f367078 commit c2bacf5
Show file tree
Hide file tree
Showing 11 changed files with 1,023 additions and 96 deletions.
4 changes: 2 additions & 2 deletions include/JSystem/JParticle/JPAParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class JPABaseParticle {
void getHeight() {}
void getLifeTime() const {}
void getLocalPosition(JGeometry::TVec3<f32>&) const {}
void getOffsetPosition(JGeometry::TVec3<f32>&) const {}
void getOffsetPosition(JGeometry::TVec3<f32>& out) const { out.set(mPosition); }
void getVelVec(JGeometry::TVec3<f32>&) const {}
void getWidth() {}
void setDeleteParticleFlag() {}
Expand Down Expand Up @@ -108,4 +108,4 @@ class JPAParticleCallBack {
virtual void draw(JPABaseEmitter*, JPABaseParticle*);
};

#endif /* JPAPARTICLE_H */
#endif /* JPAPARTICLE_H */
4 changes: 3 additions & 1 deletion include/d/actor/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class daPy_py_c : public fopAc_ac_c {
daPyFlg0_UNK8 = 0x00000008,
daPyFlg0_DEKU_SP_RETURN_FLG = 0x00000010,
daPyFlg0_CUT_AT_FLG = 0x00000040,
daPyFlg0_UNK80 = 0x00000080,
daPyFlg0_UNK100 = 0x00000100,
daPyFlg0_SHIP_DROP = 0x00000200,
daPyFlg0_PUSH_PULL_KEEP = 0x00000800,
Expand Down Expand Up @@ -135,6 +136,7 @@ class daPy_py_c : public fopAc_ac_c {
enum daPy_RFLG0 {
daPyRFlg0_UNK2 = 0x00000002,
daPyRFlg0_ROPE_GRAB_RIGHT_HAND = 0x00000004,
daPyRFlg0_UNK10 = 0x00000010,
daPyRFlg0_GRAB_UP_END = 0x00000020,
daPyRFlg0_AUTO_JUMP_LAND = 0x00000040,
daPyRFlg0_UNK80 = 0x00000080,
Expand Down Expand Up @@ -346,7 +348,7 @@ class daPy_py_c : public fopAc_ac_c {
/* 0x29C */ u32 mNoResetFlg0;
/* 0x2A0 */ u32 mNoResetFlg1;
/* 0x2A4 */ u32 mResetFlg0;
/* 0x2A8 */ f32 field_0x2a8;
/* 0x2A8 */ f32 mMaxNormalSpeed;
/* 0x2AC */ f32 mHeight;
/* 0x2B0 */ f32 field_0x2b0;
/* 0x2B4 */ csXyz mBodyAngle;
Expand Down
52 changes: 38 additions & 14 deletions include/d/actor/d_a_player_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ class daPy_sightPacket_c : public dDlst_base_c {
void onLockFlg() { mLockFlag = true; }
void offLockFlg() { mLockFlag = false; }
void setPos(const cXyz* i_pos) { mPos = *i_pos; }
void setSightTex(void* sightTex) { mSightTex = sightTex; }
void setSightTex(void* sightTex) { mpSightTex = sightTex; }
void setLockTex(void* lockTex) { mpLockTex = lockTex; }
void setImage(ResTIMG* image) { mpImg = image; }

private:
/* 0x04 */ bool mDrawFlag;
/* 0x05 */ bool mLockFlag;
/* 0x06 */ u8 field_0x6[2];
/* 0x06 */ u8 field_0x6;
/* 0x07 */ u8 mLockAlpha;
/* 0x08 */ cXyz mPos;
/* 0x14 */ Mtx field_0x14;
/* 0x14 */ Mtx mMtx;
/* 0x44 */ ResTIMG* mpImg;
/* 0x48 */ void* mpLockTex;
/* 0x4C */ void* mSightTex;
/* 0x4C */ void* mpSightTex;
};

class daPy_actorKeep_c {
Expand All @@ -78,10 +79,19 @@ class daPy_footEffect_c {

dPa_smokeEcallBack* getSmokeCallBack() { return &mSmokeCb; }
dPa_followEcallBack* getOtherCallBack() { return &mFollowCb; }


void setID(s32 id) { mId = id; }
s32 getID() const { return mId; }
void setAngle(csXyz* angle) { mAngle = *angle; }
const csXyz& getAngle() { return mAngle; }
void setPos(const cXyz* pos) { mPos = *pos; }
const cXyz& getPos() { return mPos; }

/* 0x00 */ dPa_smokeEcallBack mSmokeCb;
/* 0x20 */ dPa_followEcallBack mFollowCb;
/* 0x34 */ u8 field_0x34[0x4C - 0x34];
/* 0x34 */ cXyz mPos;
/* 0x40 */ csXyz mAngle;
/* 0x48 */ s32 mId;
};

class daPy_fanSwingEcallBack_c : public dPa_levelEcallBack {
Expand All @@ -108,8 +118,8 @@ class daPy_waterDropPcallBack_c : public JPACallBackBase2<JPABaseEmitter*, JPABa
void execute(JPABaseEmitter*, JPABaseParticle*);
~daPy_waterDropPcallBack_c() {}

/* 0x4 */ u8 field_0x4[0x4];
/* 0x8 */ dBgS_ObjGndChk field_0x8;
/* 0x4 */ BOOL field_0x4;
/* 0x8 */ dBgS_ObjGndChk mGndChk;
};

class daPy_swimTailEcallBack_c : public dPa_levelEcallBack {
Expand All @@ -127,12 +137,16 @@ class daPy_swimTailEcallBack_c : public dPa_levelEcallBack {
field_0x20 = NULL;
}

JPABaseEmitter* getEmitter() { return mpEmitter; }
cXyz& getPos() { return mPos; }
void setPos(cXyz& pos) { mPos = pos; }

/* 0x04 */ bool field_0x04;
/* 0x05 */ bool field_0x05;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ f32 field_0x0C;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ cXyz field_0x14;
/* 0x14 */ cXyz mPos;
/* 0x20 */ const csXyz* field_0x20;
/* 0x24 */ JPABaseEmitter* mpEmitter;
}; // Size: 0x28
Expand All @@ -145,10 +159,14 @@ class daPy_followEcallBack_c : public dPa_levelEcallBack {
void setup(JPABaseEmitter*, const cXyz*, const csXyz*, s8);
void end();
~daPy_followEcallBack_c() {}
JPABaseEmitter* getEmitter() { return mpEmitter; }
void setPos(const cXyz* pos) { mPos = *pos; }
cXyz& getPos() { return mPos; }
void setAngle(s16 x, s16 y, s16 z) { mAngle.set(x, y, z); }

/* 0x04 */ JPABaseEmitter* mpEmitter;
/* 0x08 */ cXyz field_0x08;
/* 0x14 */ csXyz field_0x14;
/* 0x08 */ cXyz mPos;
/* 0x14 */ csXyz mAngle;
/* 0x1A */ u8 field_0x1A[0x1C - 0x1A];
}; // Size: 0x1C

Expand All @@ -162,7 +180,7 @@ class daPy_waterDropEcallBack_c : public daPy_followEcallBack_c {

static daPy_waterDropPcallBack_c m_pcallback;

/* 0x1C */ u8 field_0x1C[0x4];
/* 0x1C */ BOOL field_0x1C;
}; // Size: 0x20

class daPy_dmEcallBack_c : public daPy_mtxFollowEcallBack_c {
Expand Down Expand Up @@ -240,6 +258,12 @@ class daPy_matAnm_c : public J3DMaterialAnm {
}; // Size: 0x7C

class daPy_swBlur_c : public J3DPacket {
public:
enum BlurColorType {
NORMAL_SLASH_BLUR,
ELIXIR_SOUP_SLASH_BLUR,
PARRYING_SLASH_BLUR,
};
public:
void initSwBlur(MtxP, int, f32, int);
void copySwBlur(MtxP, int);
Expand All @@ -250,8 +274,8 @@ class daPy_swBlur_c : public J3DPacket {
/* 0x014 */ int field_0x014;
/* 0x018 */ int field_0x018;
/* 0x01C */ int mBlurColorType;
/* 0x020 */ f32 field_0x020;
/* 0x024 */ void* mpPosBuffer;
/* 0x020 */ f32 mBlurTopRate;
/* 0x024 */ Vec* mpPosBuffer;
/* 0x028 */ cXyz field_0x028;
/* 0x034 */ cXyz field_0x034[60];
/* 0x304 */ cXyz field_0x304[60];
Expand Down
3 changes: 2 additions & 1 deletion include/d/d_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum CcG_Tg_HitMark {
enum dCcG_At_Spl {
/* 0x0 */ dCcG_At_Spl_UNK0 = 0,
/* 0x1 */ dCcG_At_Spl_UNK1 = 1,
/* 0x3 */ dCcG_At_Spl_UNK3 = 3,
/* 0x6 */ dCcG_At_Spl_UNK6 = 6,
/* 0x9 */ dCcG_At_Spl_UNK9 = 9,
/* 0xB */ dCcG_At_Spl_UNKB = 0xB,
Expand Down Expand Up @@ -486,4 +487,4 @@ class dCcD_Tri : public dCcD_GObjInf, public cCcD_TriAttr {

dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* param_0);

#endif /* D_CC_D_CC_D_H */
#endif /* D_CC_D_CC_D_H */
2 changes: 2 additions & 0 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -3416,6 +3416,8 @@ inline u32 dComIfGp_particle_getParticleNum() { return g_dComIfG_gameInfo.play.g
inline u32 dComIfGp_particle_getEmitterNum() { return g_dComIfG_gameInfo.play.getParticle()->getEmitterNum(); }
inline JKRHeap* dComIfGp_particle_getCommonHeap() { return g_dComIfG_gameInfo.play.getParticle()->getHeap(); }

inline s32 dComIfGp_particle_checkAtrCodeEffect(int code) { return g_dComIfG_gameInfo.play.getParticle()->checkAtrCodeEffect(code); }

/**
* === ATTENTION ===
*/
Expand Down
1 change: 1 addition & 0 deletions include/d/d_kankyo.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,5 +457,6 @@ void dKy_setLight_mine(dKy_tevstr_c* pTevStr);
BOOL dKy_daynighttact_stop_chk();
void dKy_contrast_flg_set(u8);
u8 dKy_contrast_flg_get();
BOOL dKyr_player_overhead_bg_chk();

#endif /* D_KANKYO_D_KANKYO_H */
2 changes: 1 addition & 1 deletion include/d/d_particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class dPa_control_c {
void setSimpleLand(int, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*, int*, int);
void setSimpleLand(cBgS_PolyInfo&, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*,
int*, int);
void checkAtrCodeEffect(int);
s32 checkAtrCodeEffect(int);
void setNormalStripes(u16, cXyz const*, csXyz const*, cXyz const*, u8, u16);
bool newSimple(u16, u8);
bool setSimple(u16, cXyz const*, u8, GXColor const&, GXColor const&, int);
Expand Down
27 changes: 2 additions & 25 deletions src/d/actor/d_a_player_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,6 @@ JGeometry::TVec3<f32> l_hammer_splash_particle_scale(0.67f, 0.67f, 0.67f);

#include "d/actor/d_a_player_HIO.inc"

static u8 l_sightDL[] ALIGN_DECL(32) = {
0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80, 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00,
0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00,
0x61, 0x28, 0x38, 0x03, 0xC0,
0x61, 0xC0, 0x08, 0x42, 0x8F,
0x61, 0xC1, 0x08, 0xE6, 0x70,
0x61, 0x43, 0x00, 0x00, 0x01,
0x61, 0x40, 0x00, 0x00, 0x06,
0x61, 0x41, 0x00, 0x04, 0xAD,
0x61, 0xF3, 0x64, 0x00, 0x00,
0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01,
0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00,
0x61, 0x00, 0x00, 0x00, 0x01,
0x98, 0x00, 0x04, 0x01, 0x01, 0x00, 0x01,
0x01, 0xFF, 0x01, 0x00, 0x00, 0x01, 0x01, 0xFF, 0x00, 0x01, 0x00, 0xFF, 0xFF,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
};

static void dummydatafunc(f32* temp, f64* temp2) {
// temporary hack to improve diffs until sdata2 offsets are figured out
*temp = 2.0f;
Expand Down Expand Up @@ -3809,7 +3786,7 @@ BOOL daPy_lk_c::playerDelete() {
dKy_plight_cut(&mLightInfluence);
mDoAud_seDeleteObject(&mSwordTopPos);
mDoAud_seDeleteObject(&mRopePos);
mDoAud_seDeleteObject(&m338C.field_0x08);
mDoAud_seDeleteObject(&m338C.mPos);
mDoAud_seDeleteObject(mFanWindCps.GetEndP());

for (i = 0; i < (int)ARRAY_SIZE(m_anm_heap_under); i++) {
Expand Down Expand Up @@ -4216,7 +4193,7 @@ void daPy_lk_c::playerInit() {
mAcch.OnLineCheck();
mAcch.ClrRoofNone();
mAcch.SetRoofCrrHeight(125.0f);
field_0x2a8 = daPy_HIO_move_c0::m.field_0x18;
mMaxNormalSpeed = daPy_HIO_move_c0::m.field_0x18;
gravity = daPy_HIO_autoJump_c0::m.field_0xC;
maxFallSpeed = daPy_HIO_autoJump_c0::m.field_0x10;
mAcchCir[0].SetWall(30.1f, 35.0f);
Expand Down
Loading

0 comments on commit c2bacf5

Please sign in to comment.