Skip to content

Commit

Permalink
Merge pull request #510 from LagoLunatic/player
Browse files Browse the repository at this point in the history
player OK, started adding player flag enums and inlines, kytag05 OK
  • Loading branch information
magcius authored Oct 8, 2023
2 parents 201fdbf + 3f1d6a1 commit 89b0b1e
Show file tree
Hide file tree
Showing 21 changed files with 793 additions and 184 deletions.
6 changes: 3 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def DolphinLib(lib_name, objects):
Object(Matching, "d/actor/d_a_nh.cpp"),
Object(NonMatching, "d/actor/d_a_npc_fa1.cpp"),
Object(NonMatching, "d/actor/d_a_obj_search.cpp"),
Object(NonMatching, "d/actor/d_a_player.cpp"),
Object(Matching, "d/actor/d_a_player.cpp"),
Object(NonMatching, "d/actor/d_a_player_main.cpp"),
Object(NonMatching, "d/actor/d_a_player_npc.cpp"),
Object(NonMatching, "d/actor/d_a_sea.cpp"),
Expand Down Expand Up @@ -1237,8 +1237,8 @@ def DolphinLib(lib_name, objects):
ActorRel(NonMatching, "d_a_kytag01"),
ActorRel(NonMatching, "d_a_kytag02"),
ActorRel(NonMatching, "d_a_kytag03"),
ActorRel(Matching, "d_a_kytag04"),
ActorRel(NonMatching, "d_a_kytag05"),
ActorRel(Matching, "d_a_kytag04"),
ActorRel(Matching, "d_a_kytag05"),
ActorRel(Matching, "d_a_kytag06"),
ActorRel(NonMatching, "d_a_kytag07"),
ActorRel(NonMatching, "d_a_lamp"),
Expand Down
16 changes: 14 additions & 2 deletions include/JSystem/JParticle/JPAEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class JPABaseEmitter {
void getPivotY();

void setStatus(u32 status) { mFlags |= status; }
void clearStatus(u32 status) { mFlags &= ~status; }
bool checkStatus(u32 status) { return mFlags & status; }
void initStatus(u32 status);

u8 getGlobalAlpha() { return mGlobalPrmColor.a; }
void setGlobalAlpha(u8 alpha) { mGlobalPrmColor.a = alpha; }
Expand All @@ -102,12 +105,21 @@ class JPABaseEmitter {
void setRate(float i_rate) { mRate = i_rate; }

void stopCreateParticle() { setStatus(JPAEmtrStts_StopEmit); }
void becomeImmortalEmitter() { setStatus(JPAEmtrStts_Immortal); }
void quitImmortalEmitter() { clearStatus(JPAEmtrStts_Immortal); }

void becomeInvalidEmitter() {
mMaxFrame = -1;
stopCreateParticle();
}

void setEmitterCallBackPtr(JPACallBackBase<JPABaseEmitter*>* callback) {
mpEmitterCallBack = callback;
}
void setParticleCallBackPtr(JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>* callback) {
mpParticleCallBack = callback;
}

/* 0x000 */ VolumeFunc mVolumeFunc;
/* 0x00C */ cXyz mEmitterScale;
/* 0x018 */ cXyz mEmitterTranslation;
Expand Down Expand Up @@ -148,8 +160,8 @@ class JPABaseEmitter {
/* 0x188 */ JSUPtrList mChildParticles;
/* 0x194 */ JSUPtrList* mpPtclVacList;
/* 0x198 */ JPADataBlockLinkInfo* mpDataLinkInfo;
/* 0x19C */ JPACallBackBase<JPABaseEmitter>* mpEmitterCallBack;
/* 0x1A0 */ JPACallBackBase2<JPABaseEmitter,JPABaseParticle>* mpParticleCallBack;
/* 0x19C */ JPACallBackBase<JPABaseEmitter*>* mpEmitterCallBack;
/* 0x1A0 */ JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>* mpParticleCallBack;
/* 0x1A4 */ JMath::TRandom_fast_ mRandomSeed;
/* 0x1A8 */ Mtx mGlobalRotation;
/* 0x1D8 */ JGeometry::TVec3<f32> mGlobalScale;
Expand Down
2 changes: 1 addition & 1 deletion include/JSystem/JParticle/JPAParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class JPABaseParticle {
/* 0xC2 */ s16 mRotateSpeed;
/* 0xC4 */ u8 field_0xC4[0xC6 - 0xC4];
/* 0xC6 */ u16 mTexIdx;
/* 0xC8 */ JPACallBackBase2<JPABaseEmitter,JPABaseParticle>* mpCallBack2;
/* 0xC8 */ JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>* mpCallBack2;
/* 0xCC */ u32 mFlags;
};

Expand Down
89 changes: 72 additions & 17 deletions include/d/actor/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ class daPy_matAnm_c : public J3DMaterialAnm {
virtual void calc(J3DMaterial*) const;
};

class daPy_mtxFollowEcallBack_c {
class daPy_mtxFollowEcallBack_c : public dPa_levelEcallBack {
public:
void execute(JPABaseEmitter*);
void end();
void makeEmitter(unsigned short, float(*)[4], const cXyz*, const cXyz*);
void makeEmitterColor(unsigned short, float(*)[4], const cXyz*, const _GXColor*, const _GXColor*);
void setup(JPABaseEmitter*, const cXyz*, const csXyz*, signed char);
void makeEmitter(u16, MtxP, const cXyz*, const cXyz*);
void makeEmitterColor(u16, MtxP, const cXyz*, const _GXColor*, const _GXColor*);
void setup(JPABaseEmitter* emitter, const cXyz*, const csXyz*, s8) { mpEmitter = emitter; }

/* 0x0 */ u8 field_0x0[0xC];
/* 0x04 */ JPABaseEmitter* mpEmitter;
/* 0x08 */ MtxP mpMtx;
};

class daPy_HIO_c {
Expand Down Expand Up @@ -66,15 +67,41 @@ class daPy_demo_c {
class daPy_py_c : public fopAc_ac_c {
public:
enum daPy_PROC {};


enum daPy_FLG0 {
daPyFlg0_CUT_AT_FLG = 0x00000040,
daPyFlg0_PUSH_PULL_KEEP = 0x00000800,
daPyFlg0_UNK1000 = 0x00001000,
daPyFlg0_UNK200000 = 0x00200000,
daPyFlg0_EQUIP_HEAVY_BOOTS = 0x02000000,
daPyFlg0_NO_DRAW = 0x08000000,
daPyFlg0_HEAVY_STATE = 0x40000000,
};

enum daPy_FLG1 {
daPy_FLG1_EQUIP_DRAGON_SHIELD = 0x00000001,
daPy_FLG1_NPC_CALL_COMMAND = 0x00000002,
daPy_FLG1_FORCE_VOMIT_JUMP = 0x00000010,
daPy_FLG1_NPC_NOT_CHANGE = 0x00000040,
daPy_FLG1_CONFUSE = 0x00000100,
daPy_FLG1_SHIP_TACT = 0x00001000,
daPy_FLG1_USE_ARROW_EFFECT = 0x00002000,
daPy_FLG1_LETTER_READ_EYE_MOVE = 0x00004000,
daPy_FLG1_UNK8000 = 0x00008000,
daPy_FLG1_FOREST_WATER_USE = 0x00020000,
daPy_FLG1_WATER_DROP = 0x00080000,
daPy_FLG1_VINE_CATCH = 0x02000000,
daPy_FLG1_LAST_COMBO_WAIT = 0x20000000,
};

/* 0x290 */ u8 mAttackState;
/* 0x291 */ u8 field_0x291;
/* 0x292 */ u8 field_0x292[0x294 - 0x292];
/* 0x294 */ s16 mDamageWaitTimer;
/* 0x296 */ s16 mQuakeTimer;
/* 0x298 */ int field_0x298;
/* 0x29C */ u32 field_0x29c;
/* 0x2A0 */ u32 field_0x2a0;
/* 0x29C */ u32 mNoResetFlg0;
/* 0x2A0 */ u32 mNoResetFlg1;
/* 0x2A4 */ u32 field_0x2a4;
/* 0x2A8 */ f32 field_0x2a8;
/* 0x2AC */ u8 field_0x2AC[0x2B0 - 0x2AC];
Expand All @@ -86,9 +113,7 @@ class daPy_py_c : public fopAc_ac_c {
/* 0x2D4 */ cXyz field_0x2d4;
/* 0x2E0 */ cXyz field_0x2e0;
/* 0x2EC */ cXyz mRopePos;
/* 0x2F8 */ f32 field_0x2f8;
/* 0x2FC */ u8 field_0x2FC[0x300 - 0x2FC];
/* 0x300 */ f32 field_0x300;
/* 0x2F8 */ cXyz field_0x2f8;
/* 0x304 */ daPy_demo_c mDemo;

u8 getCutType() const { return mAttackState; }
Expand All @@ -97,9 +122,41 @@ class daPy_py_c : public fopAc_ac_c {
s16 getBodyAngleY() { return mBodyAngle.y; }
void changeDemoMoveAngle(s16 angle) { mDemo.setMoveAngle(angle); }

void onPlayerNoDraw() { field_0x29c |= 0x8000000; }
void offPlayerNoDraw() { field_0x29c &= ~0x8000000; }

void onNoResetFlg0(daPy_FLG0 flag) { mNoResetFlg0 |= flag; }
void offNoResetFlg0(daPy_FLG0 flag) { mNoResetFlg0 &= ~flag; }
bool checkNoResetFlg0(daPy_FLG0 flag) const { return mNoResetFlg0 & flag; }
bool getCutAtFlg() const { return checkNoResetFlg0(daPyFlg0_CUT_AT_FLG); }
void onPushPullKeep() { onNoResetFlg0(daPyFlg0_PUSH_PULL_KEEP); }
void offPushPullKeep() { offNoResetFlg0(daPyFlg0_PUSH_PULL_KEEP); }
bool checkEquipHeavyBoots() const { return checkNoResetFlg0(daPyFlg0_EQUIP_HEAVY_BOOTS); }
void onPlayerNoDraw() { onNoResetFlg0(daPyFlg0_NO_DRAW); }
void offPlayerNoDraw() { offNoResetFlg0(daPyFlg0_NO_DRAW); }
void onHeavyState() { onNoResetFlg0(daPyFlg0_HEAVY_STATE); }
void offHeavyState() { offNoResetFlg0(daPyFlg0_HEAVY_STATE); }

void onNoResetFlg1(daPy_FLG1 flag) { mNoResetFlg1 |= flag; }
void offNoResetFlg1(daPy_FLG1 flag) { mNoResetFlg1 &= ~flag; }
bool checkNoResetFlg1(daPy_FLG1 flag) const { return mNoResetFlg1 & flag; }
bool checkEquipDragonShield() const { return checkNoResetFlg1(daPy_FLG1_EQUIP_DRAGON_SHIELD); }
void onNpcCall() { onNoResetFlg1(daPy_FLG1_NPC_CALL_COMMAND); }
void offNpcCallCommand() { offNoResetFlg1(daPy_FLG1_NPC_CALL_COMMAND); }
bool checkNpcCallCommand() const { return checkNoResetFlg1(daPy_FLG1_NPC_CALL_COMMAND); }
void onForceVomitJump() { onNoResetFlg1(daPy_FLG1_FORCE_VOMIT_JUMP); }
void onNpcNotChange() { onNoResetFlg1(daPy_FLG1_NPC_NOT_CHANGE); }
void offNpcNotChange() { offNoResetFlg1(daPy_FLG1_NPC_NOT_CHANGE); }
void onConfuse() { onNoResetFlg1(daPy_FLG1_CONFUSE); }
void offConfuse() { offNoResetFlg1(daPy_FLG1_CONFUSE); }
bool checkConfuse() const { return checkNoResetFlg1(daPy_FLG1_CONFUSE); }
void onShipTact() { onNoResetFlg1(daPy_FLG1_SHIP_TACT); }
void offShipTact() { offNoResetFlg1(daPy_FLG1_SHIP_TACT); }
void onUseArrowEffect() { onNoResetFlg1(daPy_FLG1_USE_ARROW_EFFECT); }
void offUseArrowEffect() { offNoResetFlg1(daPy_FLG1_USE_ARROW_EFFECT); }
void onLetterReadEyeMove() { onNoResetFlg1(daPy_FLG1_LETTER_READ_EYE_MOVE); }
bool checkForestWaterUse() const { return checkNoResetFlg1(daPy_FLG1_FOREST_WATER_USE); }
void onWaterDrop() { onNoResetFlg1(daPy_FLG1_WATER_DROP); }
void onVineCatch() { onNoResetFlg1(daPy_FLG1_VINE_CATCH); }
bool checkLastComboWait() const { return checkNoResetFlg1(daPy_FLG1_LAST_COMBO_WAIT); }

virtual MtxP getLeftHandMatrix() = 0;
virtual MtxP getRightHandMatrix() = 0;
virtual void getGroundY() = 0;
Expand Down Expand Up @@ -133,7 +190,7 @@ class daPy_py_c : public fopAc_ac_c {
virtual void setHookshotCarryOffset(unsigned int, const cXyz*);
virtual void setPlayerPosAndAngle(cXyz*, s16);
virtual void setPlayerPosAndAngle(cXyz*, csXyz*);
virtual void setPlayerPosAndAngle(float (*)[4]);
virtual void setPlayerPosAndAngle(MtxP);
virtual void setThrowDamage(cXyz*, s16, f32, f32, int);
virtual void changeTextureAnime(u16, u16, int);
virtual void cancelChangeTextureAnime();
Expand All @@ -148,8 +205,6 @@ class daPy_py_c : public fopAc_ac_c {
void setDoButtonQuake();
void stopDoButtonQuake(int);
void getRopePos() const;

BOOL checkConfuse() { return field_0x2a0 & 0x100; }
};

#endif /* D_A_PLAYER */
6 changes: 6 additions & 0 deletions include/d/actor/d_a_ykgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

struct daYkgr_c {
public:
static void stop() {
if (m_emitter) {
m_alpha_flag = 0;
}
};

static JPABaseEmitter* m_emitter;
static u8 m_alpha_flag;
public:
Expand Down
106 changes: 106 additions & 0 deletions include/d/d_cam_param.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#ifndef D_CAM_PARAM_H
#define D_CAM_PARAM_H

#include "dolphin/types.h"

struct dCamera__Style;

class dCstick_c {
/* 0x00 */ f32 m00;
/* 0x04 */ f32 m04;
/* 0x08 */ u32 m08;
/* 0x0C */ u8 m0C[0x10 - 0x0C];
/* 0x10 */ void* vtbl;
};

class dCamBGChk_c {
/* 0x00 */ f32 m00;
/* 0x04 */ f32 m04;
/* 0x08 */ f32 m08;
/* 0x0C */ f32 m0C;
/* 0x10 */ f32 m10;
/* 0x14 */ f32 m14;
/* 0x18 */ f32 m18;
/* 0x1C */ f32 m1C;
/* 0x20 */ f32 m20;
/* 0x24 */ f32 m24;
/* 0x28 */ f32 m28;
/* 0x2C */ f32 m2C;
/* 0x30 */ f32 m30;
/* 0x34 */ f32 m34;
/* 0x38 */ f32 m38;
/* 0x3C */ f32 m3C;
/* 0x40 */ f32 m40;
/* 0x44 */ f32 m44;
/* 0x48 */ f32 m48;
/* 0x4C */ f32 m4C;
/* 0x50 */ f32 m50;
/* 0x54 */ f32 m54;
/* 0x58 */ f32 m58;
/* 0x5C */ f32 m5C;
};

class dCamSetup_c {
/* 0x000 */ f32 m000;
/* 0x004 */ f32 m004;
/* 0x008 */ u16 m008;
/* 0x00A */ u8 m00A[0x00C - 0x00A];
/* 0x00C */ u32 m00C;
/* 0x010 */ int m010;
/* 0x014 */ u8 m014[0x01C - 0x014];
/* 0x01C */ int m01C;
/* 0x020 */ f32 m020;
/* 0x024 */ f32 m024;
/* 0x028 */ f32 m028;
/* 0x02C */ f32 m02C;
/* 0x030 */ f32 m030;
/* 0x034 */ f32 m034;
/* 0x038 */ f32 m038;
/* 0x03C */ f32 m03C;
/* 0x040 */ f32 m040;
/* 0x044 */ f32 m044;
/* 0x048 */ f32 m048;
/* 0x04C */ f32 m04C;
/* 0x050 */ f32 m050;
/* 0x054 */ f32 m054;
/* 0x058 */ f32 m058;
/* 0x05C */ f32 m05C;
/* 0x060 */ f32 m060;
/* 0x064 */ f32 m064;
/* 0x068 */ f32 m068;
/* 0x06C */ f32 m06C;
/* 0x070 */ f32 m070;
/* 0x074 */ u32 m074;
/* 0x078 */ f32 m078;
/* 0x07C */ f32 m07C;
/* 0x080 */ f32 m080;
/* 0x084 */ f32 m084;
/* 0x088 */ f32 m088;
/* 0x08C */ f32 m08C;
/* 0x090 */ u8 m090[0x094 - 0x090];
/* 0x094 */ u32 m094;
/* 0x098 */ f32 m098;
/* 0x09C */ f32 m09C;
/* 0x0A0 */ f32 m0A0;
/* 0x0A4 */ f32 m0A4;
/* 0x0A8 */ u32 m0A8;
/* 0x0AC */ f32 m0AC;
/* 0x0B0 */ u32 m0B0;
/* 0x0B4 */ f32 m0B4;
/* 0x0B8 */ f32 m0B8;
/* 0x0BC */ f32 m0BC;
/* 0x0C0 */ f32 m0C0;
/* 0x0C4 */ f32 m0C4;
/* 0x0C8 */ u32 m0C8;
/* 0x0CC */ void* vtbl;
/* 0x0D0 */ dCstick_c mCstick;
/* 0x0E4 */ dCamBGChk_c mBGChk;
};

class dCamParam_c {
/* 0x0 */ dCamera__Style* mpStyle;
/* 0x4 */ int mStyleIdx;
/* 0x8 */ void* vtbl;
};

#endif /* D_CAM_PARAM_H */
2 changes: 2 additions & 0 deletions include/d/d_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class dCcD_GObjTg : public dCcD_GAtTgCoCommonBase {
u8 GetHitMark() { return mHitMark; }
void SetRVec(cXyz& vec) { mRVec = vec; }
cXyz* GetVecP() { return &mVec; }
cXyz* GetRVecP() { return &mRVec; }
void SetHitPos(cXyz& pos) { mHitPos = pos; }
cXyz* GetHitPosP() { return &mHitPos; }
inline void ClrHit() { ClrActorInfo(); }
Expand Down Expand Up @@ -294,6 +295,7 @@ class dCcD_GObjInf : public cCcD_GObjInf {
bool ChkAtShieldHit() { return mGObjAt.ChkRPrm(1); }
cXyz* GetAtVecP() { return mGObjAt.GetVecP(); }
cXyz* GetTgVecP() { return mGObjTg.GetVecP(); }
cXyz* GetTgRVecP() { return mGObjTg.GetRVecP(); }
void SetAtSpl(dCcG_At_Spl spl) { mGObjAt.SetAtSpl(spl); }
void SetAtHitCallback(dCcD_HitCallback callback) { mGObjAt.SetHitCallback(callback); }
void SetTgHitCallback(dCcD_HitCallback callback) { mGObjTg.SetHitCallback(callback); }
Expand Down
Loading

0 comments on commit 89b0b1e

Please sign in to comment.