Started d_a_arrow (#64)

* More d_bg header improvements

* Cleanup, use mtx inlines in more places

* Added JntHit_c to headers

* Started d_a_arrow
This commit is contained in:
LagoLunatic
2023-09-21 00:09:23 -04:00
committed by GitHub
parent 12ddfa5d00
commit 1ad444aa73
27 changed files with 476 additions and 255 deletions
+5 -1
View File
@@ -22,7 +22,11 @@ private:
/* 0x10 */ // __vtable__
public:
cBgS_Chk();
cBgS_Chk() {
mPolyPassChk = NULL;
mGrpPassChk = NULL;
unk_0x0C = 1;
}
void SetExtChk(cBgS_Chk&);
bool ChkSameActorPid(unsigned int) const;
+3 -3
View File
@@ -18,13 +18,13 @@ public:
/* 0x054 */ bool mBackFlag;
public:
cBgS_LinChk();
cBgS_LinChk() { ct(); }
void ct();
void Set2(cXyz*, cXyz*, unsigned int);
void PreCalc();
void GetCross();
virtual ~cBgS_LinChk();
virtual ~cBgS_LinChk() {}
void ClrHit() { field_0x4c &= ~16; }
void SetHit() { field_0x4c |= 16; }
@@ -37,6 +37,6 @@ public:
bool GetPreWallChk() const { return mPreWallChk; }
bool GetPreGroundChk() const { return mPreGroundChk; }
bool GetPreRoofChk() const { return mPreRoofChk; }
};
}; // Size: 0x58
#endif /* C_BG_S_LIN_CHK_H */
+1 -1
View File
@@ -87,7 +87,7 @@ public:
virtual void ClassifyPlane();
virtual void ChkPolyThrough(int, cBgS_PolyPassChk*);
virtual void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
virtual void ChkGrpThrough(int, cBgS_GrpPassChk*, int);
virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
/* 0x08 */ Mtx* mpModelMtx;
/* 0x0C */ Mtx mOldMtx;
+2 -2
View File
@@ -15,8 +15,8 @@ class cM3dGCps : public cM3dGLin {
public:
/* 0x1C */ f32 mRadius;
cM3dGCps(void);
virtual ~cM3dGCps(void);
cM3dGCps(void) {}
virtual ~cM3dGCps(void) {}
void Set(const cXyz&, const cXyz&, f32);
void Set(const cM3dGCpsS&);
void SetCps(const cM3dGCps&);
+90
View File
@@ -0,0 +1,90 @@
#include "f_op/f_op_actor_mng.h"
#include "d/d_cc_d.h"
#include "d/d_bg_s_lin_chk.h"
#include "d/d_bg_s_gnd_chk.h"
#include "d/d_particle.h"
#include "dolphin/types.h"
class daArrow_c : fopAc_ac_c {
public:
enum ArrowType {
NORMAL_ARROWS = 0,
FIRE_ARROWS = 1,
ICE_ARROWS = 2,
LIGHT_ARROWS = 3,
};
BOOL _createHeap();
void _atHit(dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*);
void checkCreater();
void setLightEffect();
void setBlur();
void createBlur();
void setArrowShootSe();
void setDrawShapeMaterial();
void arrowShooting();
void arrowUseMp();
void ShieldReflect();
void check_water_in();
BOOL changeArrowMp();
void changeArrowType();
void changeArrowTypeNotReady();
void setRoomInfo();
void setKeepMatrix();
void setStopActorMatrix();
void procWait();
void procMove();
void procReturn();
void procStop_BG();
void procStop_Actor();
void procWater();
void checkRestMp();
void setTypeByPlayer();
void createInit();
BOOL _execute();
BOOL _draw();
s32 _create();
daArrow_c();
BOOL _delete();
public:
/* 0x290 */ bool mbShotByZelda;
/* 0x291 */ u8 field_0x291[0x294 - 0x291];
/* 0x294 */ J3DModel* mpModel;
/* 0x298 */ u8 field_0x298[0x2A0 - 0x298];
/* 0x2A0 */ dBgS_ArrowLinChk mLinChk;
/* 0x30C */ dBgS_ObjGndChk mGndChk;
/* 0x360 */ dCcD_Stts mStts;
/* 0x39C */ dCcD_Cps mCps;
/* 0x4D4 */ dCcD_Sph mSph;
/* 0x600 */ u8 field_0x600[0x601 - 0x600];
/* 0x601 */ u8 mArrowType;
/* 0x602 */ s16 field_0x602;
/* 0x604 */ s16 field_0x604;
/* 0x606 */ u8 field_0x606[0x610 - 0x606];
/* 0x610 */ s32 mHitActorProcID;
/* 0x614 */ s32 mHitJointIndex;
/* 0x618 */ cXyz field_0x618;
/* 0x624 */ u8 field_0x624[0x668 - 0x624];
/* 0x668 */ dPa_followEcallBack mPtclFollowCb;
/* 0x67C */ csXyz field_0x67c;
/* 0x682 */ u8 field_0x682;
/* 0x683 */ u8 field_0x683[0x684 - 0x683];
/* 0x684 */ u32 field_0x684;
/* 0x688 */ bool field_0x688;
/* 0x689 */ u8 field_0x689[0x6A8 - 0x689];
/* 0x6A8 */ cXyz field_0x6a8;
/* 0x6B4 */ u8 field_0x6B4[0x6E6 - 0x6B4];
/* 0x6E6 */ csXyz field_0x6e6;
/* 0x6EC */ fopAc_ac_c* field_0x6ec;
/* 0x6F0 */ cXyz mNearestHitPos;
/* 0x6FC */ f32 mNearestHitDist;
/* 0x700 */ bool mbHitActor;
/* 0x701 */ u8 field_0x701[0x704 - 0x701];
static u8 m_keep_type;
static const char m_arc_name[];
};
STATIC_ASSERT(sizeof(daArrow_c) == 0x704);
+2 -2
View File
@@ -90,8 +90,8 @@ public:
/* 0x300 */ f32 field_0x300;
/* 0x304 */ daPy_demo_c mDemo;
virtual void getLeftHandMatrix();
virtual void getRightHandMatrix();
virtual MtxP getLeftHandMatrix();
virtual MtxP getRightHandMatrix();
virtual void getGroundY();
virtual void getTactMusic() const;
virtual void getTactTimerCancel() const;
+2 -2
View File
@@ -839,8 +839,8 @@ public:
void checkRopeTag();
void checkPlayerNoDraw();
void getGroundY();
void getLeftHandMatrix();
void getRightHandMatrix();
MtxP getLeftHandMatrix();
MtxP getRightHandMatrix();
void checkPlayerFly() const;
void checkFrontRoll() const;
void checkBottleSwing() const;
+2 -2
View File
@@ -7,8 +7,8 @@
class dBgS_GndChk : public cBgS_GndChk, public dBgS_Chk {
public:
/* 8007757C */ dBgS_GndChk() {
this->SetPolyPassChk(this->GetPolyPassChkInfo());
this->SetGrpPassChk(this->GetGrpPassChkInfo());
SetPolyPassChk(GetPolyPassChkInfo());
SetGrpPassChk(GetGrpPassChkInfo());
}
/* 800775F0 */ virtual ~dBgS_GndChk() {}
}; // Size: 0x54
+19 -9
View File
@@ -6,23 +6,33 @@
class dBgS_GrpPassChk : public cBgS_GrpPassChk {
public:
enum {
/* 0x1 */ NORMAL_GRP = 1,
/* 0x2 */ WATER_GRP = 2,
/* 0x3 */ FULL_GRP = NORMAL_GRP | WATER_GRP | 4 | 8,
NORMAL_GRP = 0x01,
WATER_GRP = 0x02,
YOGAN_GRP = 0x04, // Lava
DOKU_GRP = 0x08, // Unused, for poison?
SPL_GRP = WATER_GRP | YOGAN_GRP | DOKU_GRP,
FULL_GRP = NORMAL_GRP | SPL_GRP,
LIGHT_GRP = 0x10,
};
/* 80077BA0 */ dBgS_GrpPassChk() { mGrp = NORMAL_GRP; }
/* 80077BC4 */ virtual ~dBgS_GrpPassChk() {}
void OnWaterGrp() { mGrp |= WATER_GRP; }
void OnSpl() { mGrp |= WATER_GRP; }
void OnNormalGrp() { mGrp |= NORMAL_GRP; }
void OffNormalGrp() { mGrp &= ~NORMAL_GRP; }
void OffFullGrp() { mGrp &= ~FULL_GRP; }
void OnWaterGrp() { mGrp |= WATER_GRP; }
void OnYoganGrp() { mGrp |= YOGAN_GRP; }
void OnSpl() { mGrp |= SPL_GRP; }
void OnAll() { mGrp |= FULL_GRP; }
u32 MaskNormalGrp() const {return mGrp & 1; }
u32 MaskWaterGrp() const {return mGrp & 2; }
void OnLightGrp() { mGrp |= LIGHT_GRP; }
void OffNormalGrp() { mGrp &= ~NORMAL_GRP; }
void OffWaterGrp() { mGrp &= ~WATER_GRP; }
void OffFullGrp() { mGrp &= ~FULL_GRP; }
u32 MaskNormalGrp() const { return mGrp & NORMAL_GRP; }
u32 MaskWaterGrp() const { return mGrp & WATER_GRP; }
u32 MaskYoganGrp() const { return mGrp & YOGAN_GRP; }
u32 MaskDokuGrp() const { return mGrp & DOKU_GRP; }
u32 MaskLightGrp() const { return mGrp & LIGHT_GRP; }
private:
/* 0x4 */ u32 mGrp;
};
+11 -4
View File
@@ -8,10 +8,13 @@ class fopAc_ac_c;
class dBgS_LinChk : public cBgS_LinChk, public dBgS_Chk {
public:
/* 80077C68 */ dBgS_LinChk();
/* 80077C68 */ dBgS_LinChk() {
SetPolyPassChk(GetPolyPassChkInfo());
SetGrpPassChk(GetGrpPassChkInfo());
}
/* 80077D64 */ void Set(cXyz const* pi_start, cXyz const* pi_end, fopAc_ac_c const*);
/* 80077CDC */ virtual ~dBgS_LinChk();
/* 80077CDC */ virtual ~dBgS_LinChk() {}
/* 0x00 cBgS_LinChk */;
/* 0x58 dBgS_Chk */;
@@ -40,9 +43,13 @@ public:
class dBgS_ArrowLinChk : public dBgS_LinChk {
public:
/* 800781D8 */ dBgS_ArrowLinChk();
/* 800781D8 */ dBgS_ArrowLinChk() {
SetArrow(); // Don't check arrows
OnYoganGrp(); // Check lava
OnNormalGrp();
}
/* 80078240 */ virtual ~dBgS_ArrowLinChk();
/* 80078240 */ virtual ~dBgS_ArrowLinChk() {}
};
class dBgS_ObjLinChk : public dBgS_LinChk {
+11 -5
View File
@@ -10,10 +10,10 @@ public:
/* 0x4 */ u8 mbObjThrough;
/* 0x5 */ u8 mbCamThrough;
/* 0x6 */ u8 mbLinkThrough;
/* 0x7 */ u8 mbArrowsAndLightThrough;
/* 0x7 */ u8 mbArrowThrough; // Also light
/* 0x8 */ u8 mbBombThrough;
/* 0x9 */ u8 mbBoomerangThrough;
/* 0xA */ u8 mbHookshotThrough;
/* 0xA */ u8 mbRopeThrough; // Actually Hookshot?
};
class dBgS_PolyPassChk : public cBgS_PolyPassChk {
@@ -22,14 +22,20 @@ public:
mbObjThrough = 0;
mbCamThrough = 0;
mbLinkThrough = 0;
mbArrowsAndLightThrough = 0;
mbArrowThrough = 0;
mbBombThrough = 0;
mbBoomerangThrough = 0;
mbHookshotThrough = 0;
mbRopeThrough = 0;
}
virtual ~dBgS_PolyPassChk() {}
void SetObj() { mbObjThrough = 1; }
void SetObj() { mbObjThrough = true; }
void SetCam() { mbCamThrough = true; }
void SetLink() { mbLinkThrough = true; }
void SetArrow() { mbArrowThrough = true; }
void SetBomb() { mbBombThrough = true; }
void SetBoomerang() { mbBoomerangThrough = true; }
void SetRope() { mbRopeThrough = true; }
};
STATIC_ASSERT(sizeof(dBgS_PolyPassChk) == 0xC);
+2 -1
View File
@@ -2,6 +2,7 @@
#define D_BG_W_H
#include "SSystem/SComponent/c_bg_w.h"
#include "SSystem/SComponent/c_sxyz.h"
class dBgS_Acch;
class cM3dGPla;
@@ -45,7 +46,7 @@ public:
virtual ~dBgW() {}
virtual void ChkPolyThrough(int, cBgS_PolyPassChk*);
virtual void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
virtual void ChkGrpThrough(int, cBgS_GrpPassChk*, int);
virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
virtual void CrrPos(cBgS_PolyInfo&, void*, bool, cXyz*, csXyz*, csXyz*);
virtual void TransPos(cBgS_PolyInfo&, void*, bool, cXyz*, csXyz*, csXyz*);
virtual void MatrixCrrPos(cBgS_PolyInfo&, void*, bool, cXyz*, csXyz*, csXyz*);
+6 -2
View File
@@ -173,6 +173,7 @@ public:
u8 GetHitMark() { return mHitMark; }
void SetRVec(cXyz& vec) { mRVec = vec; }
void SetHitPos(cXyz& pos) { mHitPos = pos; }
cXyz* GetHitPosP() { return &mHitPos; }
// private:
/* 0x1C */ u8 mSe;
@@ -202,6 +203,7 @@ public:
void SetRVec(cXyz& vec) { mRVec = vec; }
cXyz* GetVecP() { return &mVec; }
void SetHitPos(cXyz& pos) { mHitPos = pos; }
cXyz* GetHitPosP() { return &mHitPos; }
private:
/* 0x1C */ u8 mSe;
@@ -344,6 +346,8 @@ public:
void SetAtRVec(cXyz& vec) { mGObjAt.SetRVec(vec); }
void SetTgHitPos(cXyz& pos) { mGObjTg.SetHitPos(pos); }
void SetAtHitPos(cXyz& pos) { mGObjAt.SetHitPos(pos); }
cXyz* GetAtHitPosP() { return mGObjAt.GetHitPosP(); }
cXyz* GetTgHitPosP() { return mGObjTg.GetHitPosP(); }
protected:
/* 0x050 */ dCcD_GObjAt mGObjAt;
@@ -372,7 +376,7 @@ public:
void Set(dCcD_SrcSph const&);
void StartCAt(cXyz&);
void MoveCAt(cXyz&);
virtual cCcD_ShapeAttr* GetShapeAttr();
virtual cCcD_ShapeAttr* GetShapeAttr() { return (cCcD_ShapeAttr*)this; }
virtual ~dCcD_Sph() {}
}; // Size = 0x12C
@@ -380,7 +384,7 @@ public:
class dCcD_Cps : public dCcD_GObjInf, public cCcD_CpsAttr {
public:
void Set(dCcD_SrcCps const&);
cCcD_ShapeAttr* GetShapeAttr();
cCcD_ShapeAttr* GetShapeAttr() { return (cCcD_ShapeAttr*)this; }
void CalcAtVec();
void CalcTgVec();
virtual ~dCcD_Cps() {}
+11
View File
@@ -186,6 +186,9 @@ public:
dTimer_c* getTimerPtr() { return mTimerInfo.mTimerPtr; }
s32 getTimerMode() { return mTimerInfo.mTimerMode; }
s16 getItemMagicCount() { return mItemMagicCount; }
void setItemMagicCount(s16 magic) { mItemMagicCount = magic; }
/* 0x0000 */ dBgS mBgS;
/* 0x1404 */ dCcS mCcS;
@@ -984,6 +987,14 @@ inline void dComIfGp_setMessageCountNumber(s16 num) {
g_dComIfG_gameInfo.play.setMessageCountNumber(num);
}
inline s16 dComIfGp_getItemMagicCount() {
return g_dComIfG_gameInfo.play.getItemMagicCount();
}
inline void dComIfGp_setItemMagicCount(s16 magic) {
g_dComIfG_gameInfo.play.setItemMagicCount(magic);
}
/**
* === EVENT ===*/
+30
View File
@@ -0,0 +1,30 @@
#ifndef D_JNT_HIT_H
#define D_JNT_HIT_H
#include "global.h"
#include "SSystem/SComponent/c_xyz.h"
#include "JSystem/J3DGraphAnimator/J3DModel.h"
struct __jnt_hit_data_c {
public:
/* 0x0 */ s16 mJointIndex;
/* 0x2 */ s16 field_0x2;
/* 0x4 */ f32 field_0x4;
/* 0x8 */ cXyz* field_0x8;
};
class JntHit_c {
public:
J3DModel* getModel() { return mpModel; }
/* 0x00 */ __jnt_hit_data_c* mpHitData;
/* 0x04 */ J3DModel* mpModel;
/* 0x08 */ cXyz* field_0x08;
/* 0x0C */ short* field_0x0c;
/* 0x10 */ short* field_0x10;
/* 0x14 */ short* mpJointIndexes;
/* 0x18 */ s16 mHitDataCount;
/* 0x1A */ u8 field_0x1A[0x20 - 0x1A];
};
#endif /* D_JNT_HIT_H */
+1
View File
@@ -47,6 +47,7 @@ public:
class dPa_followEcallBack : public dPa_levelEcallBack {
public:
dPa_followEcallBack(u8, u8);
virtual ~dPa_followEcallBack();
virtual void execute(JPABaseEmitter*);
+2 -2
View File
@@ -168,7 +168,7 @@ struct actor_attention_types {
/* 0x14 */ u32 mFlags;
}; // Size = 0x18
class dJntCol_c;
class JntHit_c;
struct cull_sphere {
/* 0x0 */ Vec mCenter;
@@ -211,7 +211,7 @@ public:
} mCull;
/* 0x248 */ f32 mCullSizeFar;
/* 0x24C */ J3DModel* model;
/* 0x250 */ dJntCol_c* mJntCol;
/* 0x250 */ JntHit_c* mJntHit;
/* 0x254 */ f32 speedF;
/* 0x258 */ f32 mGravity;
/* 0x25C */ f32 mMaxFallSpeed;
+4 -4
View File
@@ -119,8 +119,8 @@ inline void fopAcM_SetParam(void* p_actor, u32 param) {
fpcM_SetParam(p_actor, param);
}
inline void fopAcM_SetJntCol(fopAc_ac_c* i_actorP, dJntCol_c* i_jntColP) {
i_actorP->mJntCol = i_jntColP;
inline void fopAcM_SetJntHit(fopAc_ac_c* i_actorP, JntHit_c* i_jntHitP) {
i_actorP->mJntHit = i_jntHitP;
}
inline s16 fopAcM_GetProfName(void* pActor) {
@@ -251,8 +251,8 @@ inline f32 fopAcM_GetMaxFallSpeed(fopAc_ac_c* p_actor) {
return p_actor->mMaxFallSpeed;
}
inline dJntCol_c* fopAcM_GetJntCol(fopAc_ac_c* i_actor) {
return i_actor->mJntCol;
inline JntHit_c* fopAcM_GetJntHit(fopAc_ac_c* i_actor) {
return i_actor->mJntHit;
}
inline void fopAcM_setCullSizeFar(fopAc_ac_c* i_actor, f32 i_far) {
+11 -5
View File
@@ -135,6 +135,12 @@ public:
*/
/* 8000CD64 */ static inline void transS(cXyz const& xyz) { MTXTrans(now, xyz.x, xyz.y, xyz.z); }
/**
* Translates a new Matrix by the given cXyz and then concatenates it with the `now` matrix
* @param xyz The xyz translation vector
*/
/* 8000CD64 */ static inline void transM(cXyz const& xyz) { transM(xyz.x, xyz.y, xyz.z); }
/**
* Translates a new Matrix by the given X, Y, and Z values and then concatenates it with the `now` matrix
* @param x The x-axis translation value
@@ -153,7 +159,7 @@ public:
* Scales a new Matrix by the given cXyz and then concatenates it with the `now` matrix
* @param xyz The xyz scale vector
*/
/* 8000CE70 */ static void scaleM(cXyz const& xyz);
/* 8000CE70 */ static void scaleM(cXyz const& xyz) { scaleM(xyz.x, xyz.y, xyz.z); }
/**
* Scales a new Matrix by the given X, Y, and Z values and then concatenates it with the `now` matrix
@@ -166,7 +172,7 @@ public:
/* 8000CE9C */ static void XYZrotS(csXyz const& xyz);
/**
* Rotates the `now` matrix by the given csXyz in the order Z, Y, X
* Rotates the `now` matrix by the given csXyz in the order X, Y, Z
* @param xyz The xyz rotation vector
*/
/* 8000CED4 */ static void XYZrotM(csXyz const& xyz);
@@ -174,10 +180,10 @@ public:
/* 8000CF0C */ static void ZXYrotS(csXyz const& xyz);
/**
* Rotates the `now` matrix by the given csXyz in the order X, Y, Z
* Rotates the `now` matrix by the given csXyz in the order Z, X, Y
* @param xyz The xyz rotation vector
*/
/* 8000CF44 */ static void ZXYrotM(csXyz const& xyz);
/* 8000CF44 */ static void ZXYrotM(csXyz const& xyz) { ZXYrotM(xyz.x, xyz.y, xyz.z); }
/* 8000CF7C */ static void quatM(Quaternion const*);
@@ -232,7 +238,7 @@ public:
static void XYZrotS(s16 x, s16 y, s16 z) { mDoMtx_XYZrotS(now, x, y, z); }
/**
* Rotates the `now` matrix by the given X, Y, and Z values in the order Z, Y, X
* Rotates the `now` matrix by the given X, Y, and Z values in the order X, Y, Z
* @param x The x-axis rotation value
* @param y The y-axis rotation value
* @param z The z-axis rotation value
+245 -189
View File
@@ -3,47 +3,128 @@
// Translation Unit: d_a_arrow.cpp
//
#include "d_a_arrow.h"
#include "d/actor/d_a_arrow.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "m_Do/m_Do_mtx.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"
#include "d/d_npc.h"
#include "d/actor/d_a_player.h"
#include "d/d_jnt_hit.h"
#include "dolphin/types.h"
const char daArrow_c::m_arc_name[] = "Link";
/* 800D455C-800D457C .text createHeap_CB__FP10fopAc_ac_c */
void createHeap_CB(fopAc_ac_c*) {
/* Nonmatching */
static BOOL createHeap_CB(fopAc_ac_c* i_this) {
return ((daArrow_c*)i_this)->_createHeap();
}
/* 800D457C-800D4648 .text _createHeap__9daArrow_cFv */
void daArrow_c::_createHeap() {
/* Nonmatching */
BOOL daArrow_c::_createHeap() {
// arrowglitter.bdl for Light Arrows, arrow.bdl otherwise.
s32 modelFileIndex = (mArrowType == LIGHT_ARROWS ? 0x38 : 0x37) & 0xFFFF;
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(m_arc_name, modelFileIndex);
JUT_ASSERT(190, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData, 0x00080000, 0x11000022);
if (!mpModel) {
return FALSE;
}
return TRUE;
}
/* 800D4648-800D4668 .text atHit_CB__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */
void atHit_CB(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*) {
/* Nonmatching */
void atHit_CB(fopAc_ac_c* i_this, dCcD_GObjInf* thisObjInf, fopAc_ac_c* hitActor, dCcD_GObjInf* hitObjInf) {
((daArrow_c*)i_this)->_atHit(thisObjInf, hitActor, hitObjInf);
}
/* 800D4668-800D47C0 .text _atHit__9daArrow_cFP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */
void daArrow_c::_atHit(dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*) {
/* Nonmatching */
void daArrow_c::_atHit(dCcD_GObjInf* thisObjInf, fopAc_ac_c* hitActor, dCcD_GObjInf* hitObjInf) {
// Keep track of which actor this arrow hit as well as the position the hit occurred at.
if (!hitActor) {
return;
}
if (!fopAc_IsActor(hitActor)) {
return;
}
if (!fopAcM_GetJntHit(hitActor)) {
return;
}
cXyz hitPos(*thisObjInf->GetAtHitPosP());
f32 hitDist = (hitPos - current.pos).abs();
if (hitDist < mNearestHitDist) {
mNearestHitDist = hitDist;
mHitActorProcID = fpcM_GetID(hitActor);
if (hitObjInf->ChkTgShield()) {
mbHitActor = false;
field_0x6ec = NULL;
} else {
mbHitActor = true;
field_0x6ec = hitActor;
}
mNearestHitPos = *thisObjInf->GetAtHitPosP();
}
}
/* 800D47C0-800D4814 .text checkCreater__9daArrow_cFv */
void daArrow_c::checkCreater() {
/* Nonmatching */
// Check if this arrow was fired by Princess Zelda (during the Ganondorf fight).
fopAc_ac_c* archer;
if (fopAcM_SearchByID(mParentPcId, &archer)) {
if (fpcM_GetName(archer) == PROC_PZ) {
mbShotByZelda = true;
}
}
}
/* 800D4814-800D48E8 .text setLightEffect__9daArrow_cFv */
void daArrow_c::setLightEffect() {
/* Nonmatching */
if (field_0x682 == mArrowType) {
if (mArrowType == NORMAL_ARROWS) {
return;
}
if (!field_0x688) {
field_0x684 = fopAcM_createChild(
PROC_ARROW_LIGHTEFF, fpcM_GetID(this),
mArrowType, &field_0x6a8,
current.roomNo, &shape_angle, NULL, -1, NULL
);
if (field_0x684 != -1) {
field_0x688 = true;
}
}
} else {
fopAcM_delete(fopAcM_SearchByID(field_0x684));
field_0x688 = false;
}
field_0x682 = mArrowType;
}
/* 800D48E8-800D4994 .text setBlur__9daArrow_cFv */
void daArrow_c::setBlur() {
/* Nonmatching */
JPABaseEmitter* emitter = mPtclFollowCb.getEmitter();
if (!emitter) {
return;
}
s32 alpha = emitter->getGlobalAlpha();
if (alpha - 50 <= 0) {
mPtclFollowCb.end();
} else {
emitter->setGlobalAlpha(alpha - 50);
}
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(field_0x67c);
emitter->setGlobalRTMatrix(mDoMtx_stack_c::get());
}
/* 800D4994-800D4A04 .text createBlur__9daArrow_cFv */
void daArrow_c::createBlur() {
/* Nonmatching */
if (!mPtclFollowCb.getEmitter()) {
dComIfGp_particle_setToon(0x48, &current.pos, NULL, NULL, 0xFF, &mPtclFollowCb, -1, NULL, NULL, NULL);
}
}
/* 800D4A04-800D4ADC .text setArrowShootSe__9daArrow_cFv */
@@ -63,7 +144,15 @@ void daArrow_c::arrowShooting() {
/* 800D4D98-800D4DC0 .text arrowUseMp__9daArrow_cFv */
void daArrow_c::arrowUseMp() {
/* Nonmatching */
static const s16 use_mp[4] = {
-0, // Normal Arrows
-1, // Fire Arrows
-1, // Ice Arrows
-2, // Light Arrows
};
s32 magic = dComIfGp_getItemMagicCount();
dComIfGp_setItemMagicCount(magic + use_mp[mArrowType]);
}
/* 800D4DC0-800D50A0 .text ShieldReflect__9daArrow_cFv */
@@ -77,8 +166,9 @@ void daArrow_c::check_water_in() {
}
/* 800D5388-800D53AC .text changeArrowMp__9daArrow_cFv */
void daArrow_c::changeArrowMp() {
/* Nonmatching */
BOOL daArrow_c::changeArrowMp() {
u8 magic = dComIfGs_getMagic();
return magic >= 1;
}
/* 800D53AC-800D553C .text changeArrowType__9daArrow_cFv */
@@ -93,17 +183,101 @@ void daArrow_c::changeArrowTypeNotReady() {
/* 800D560C-800D56B0 .text setRoomInfo__9daArrow_cFv */
void daArrow_c::setRoomInfo() {
/* Nonmatching */
u32 roomNo;
mGndChk.SetPos(&current.pos);
f32 groundY = dComIfG_Bgsp()->GroundCross(&mGndChk);
if (groundY != -1000000000.0f) {
roomNo = dComIfG_Bgsp()->GetRoomId(mGndChk);
mTevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mGndChk);
} else {
roomNo = dComIfGp_roomControl_getStayNo();
}
mTevStr.mRoomNo = roomNo;
mStts.SetRoomId(roomNo);
current.roomNo = roomNo;
}
/* 800D56B0-800D5854 .text setKeepMatrix__9daArrow_cFv */
void daArrow_c::setKeepMatrix() {
/* Nonmatching */
// Transform the arrow onto its archer's hand.
if (mbShotByZelda) {
fopNpc_npc_c* zelda;
fopAcM_SearchByID(mParentPcId, (fopAc_ac_c**)&zelda);
mDoMtx_stack_c::transS(0.7f, -0.07f, -0.2f);
mDoMtx_stack_c::XYZrotM(0x238E, 0x2CDF, 0x29BE);
// Copy the matrix of Zelda's hand_R1 joint to the arrow model.
// TODO: After daPz_c is implemented, this should use her daPz_c::getRightHandMatrix() inline method.
MtxP handMtx = zelda->mpMcaMorf->getModel()->mpNodeMtx[0x13];
cMtx_concat(handMtx, mDoMtx_stack_c::get(), mDoMtx_stack_c::get());
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
MtxP mtx = mDoMtx_stack_c::get();
current.pos.set(mtx[0][3], mtx[1][3], mtx[2][3]);
mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle);
current.angle.y = shape_angle.y;
current.angle.x = -shape_angle.x;
} else {
daPy_py_c* player = daPy_getPlayerActorClass();
mDoMtx_stack_c::transS(0.7f, -0.07f, -0.2f);
// TODO: How did they pass an unsigned short (0xB0B6) to a function that takes a signed short?
mDoMtx_stack_c::XYZrotM(0xB0B6, 0x238E, -0x6333);
MtxP handMtx = player->getLeftHandMatrix();
cMtx_concat(handMtx, mDoMtx_stack_c::get(), mDoMtx_stack_c::get());
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
MtxP mtx = mDoMtx_stack_c::get();
current.pos.set(mtx[0][3], mtx[1][3], mtx[2][3]);
mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle);
current.angle.y = shape_angle.y;
current.angle.x = -shape_angle.x;
}
}
/* 800D5854-800D5A70 .text setStopActorMatrix__9daArrow_cFv */
void daArrow_c::setStopActorMatrix() {
/* Nonmatching */
s16 xRot = 0;
if (cLib_calcTimer(&field_0x604) != 0) {
f32 temp = (field_0x604 / 40.0f);
xRot = 1024.0f * temp*temp * cM_ssin(field_0x604 * 0x52FB);
}
fopAc_ac_c* hitActor = fopAcM_SearchByID(mHitActorProcID);
if (!hitActor) {
return;
}
JntHit_c* jntHit = fopAcM_GetJntHit(hitActor);
if (!jntHit) {
return;
}
J3DModel* hitModel = jntHit->getModel();
static cXyz offset_arrow_pos(0.0f, 0.0f, -50.0f);
mDoMtx_stack_c::copy(hitModel->mpNodeMtx[mHitJointIndex]);
csXyz hitJointRot;
mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &hitJointRot);
mDoMtx_stack_c::transM(field_0x618);
mDoMtx_stack_c::ZXYrotM(field_0x6e6);
cXyz pos(0.0f, 0.0f, 0.0f);
mDoMtx_stack_c::multVecZero(&pos);
current.pos = pos;
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(hitJointRot);
mDoMtx_stack_c::ZXYrotM(field_0x6e6);
mDoMtx_stack_c::XrotM(xRot);
mDoMtx_stack_c::transM(offset_arrow_pos);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
/* 800D5A70-800D5B20 .text procWait__9daArrow_cFv */
@@ -138,12 +312,23 @@ void daArrow_c::procWater() {
/* 800D72BC-800D72EC .text checkRestMp__9daArrow_cFv */
void daArrow_c::checkRestMp() {
/* Nonmatching */
static const s16 use_mp[4] = {
0, // Normal Arrows
1, // Fire Arrows
1, // Ice Arrows
2, // Light Arrows
};
u8 currMagic = dComIfGs_getMagic();
if (currMagic < use_mp[m_keep_type]) {
m_keep_type = 0;
}
}
/* 800D72EC-800D7320 .text setTypeByPlayer__9daArrow_cFv */
void daArrow_c::setTypeByPlayer() {
/* Nonmatching */
checkRestMp();
mArrowType = m_keep_type;
}
/* 800D7320-800D74FC .text createInit__9daArrow_cFv */
@@ -152,207 +337,78 @@ void daArrow_c::createInit() {
}
/* 800D74FC-800D7820 .text _execute__9daArrow_cFv */
void daArrow_c::_execute() {
BOOL daArrow_c::_execute() {
/* Nonmatching */
}
/* 800D7820-800D7960 .text _draw__9daArrow_cFv */
void daArrow_c::_draw() {
BOOL daArrow_c::_draw() {
/* Nonmatching */
}
/* 800D7960-800D7A38 .text _create__9daArrow_cFv */
void daArrow_c::_create() {
s32 daArrow_c::_create() {
/* Nonmatching */
}
/* 800D7A38-800D7DB4 .text __ct__9daArrow_cFv */
daArrow_c::daArrow_c() {
/* Nonmatching */
}
/* 800D7DB4-800D7E80 .text __dt__8dCcD_SphFv */
dCcD_Sph::~dCcD_Sph() {
/* Nonmatching */
}
/* 800D7E80-800D7F0C .text __dt__12cCcD_SphAttrFv */
cCcD_SphAttr::~cCcD_SphAttr() {
/* Nonmatching */
}
/* 800D7F0C-800D7F54 .text __dt__8cM3dGSphFv */
cM3dGSph::~cM3dGSph() {
/* Nonmatching */
}
/* 800D7F54-800D8034 .text __dt__8dCcD_CpsFv */
dCcD_Cps::~dCcD_Cps() {
/* Nonmatching */
}
/* 800D8034-800D807C .text __dt__9cCcD_SttsFv */
cCcD_Stts::~cCcD_Stts() {
/* Nonmatching */
}
/* 800D807C-800D81D0 .text __dt__16dBgS_ArrowLinChkFv */
dBgS_ArrowLinChk::~dBgS_ArrowLinChk() {
/* Nonmatching */
}
daArrow_c::daArrow_c() : mPtclFollowCb(0, 0) {}
/* 800D81D0-800D8200 .text _delete__9daArrow_cFv */
void daArrow_c::_delete() {
/* Nonmatching */
BOOL daArrow_c::_delete() {
mPtclFollowCb.end();
return TRUE;
}
/* 800D8200-800D8220 .text daArrowCreate__FPv */
void daArrowCreate(void*) {
s32 daArrowCreate(void* i_this) {
/* Nonmatching */
return ((daArrow_c*)i_this)->_create();
}
/* 800D8220-800D8240 .text daArrowDelete__FPv */
void daArrowDelete(void*) {
BOOL daArrowDelete(void* i_this) {
/* Nonmatching */
return ((daArrow_c*)i_this)->_delete();
}
/* 800D8240-800D8260 .text daArrowExecute__FPv */
void daArrowExecute(void*) {
BOOL daArrowExecute(void* i_this) {
/* Nonmatching */
return ((daArrow_c*)i_this)->_execute();
}
/* 800D8260-800D8280 .text daArrowDraw__FPv */
void daArrowDraw(void*) {
/* Nonmatching */
BOOL daArrowDraw(void* i_this) {
return ((daArrow_c*)i_this)->_draw();
}
/* 800D8280-800D8288 .text daArrowIsDelete__FPv */
void daArrowIsDelete(void*) {
/* Nonmatching */
BOOL daArrowIsDelete(void* i_this) {
return TRUE;
}
/* 800D8288-800D8298 .text GetShapeAttr__8dCcD_SphFv */
void dCcD_Sph::GetShapeAttr() {
/* Nonmatching */
}
/* 800D8298-800D82A0 .text GetCoCP__12cCcD_SphAttrCFv */
void cCcD_SphAttr::GetCoCP() const {
/* Nonmatching */
}
/* 800D82A0-800D82A8 .text CrossAtTg__12cCcD_SphAttrCFRC12cCcD_AabAttrP4cXyz */
void cCcD_SphAttr::CrossAtTg(const cCcD_AabAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D82A8-800D82B0 .text CrossAtTg__12cCcD_SphAttrCFRC12cCcD_PntAttrP4cXyz */
void cCcD_SphAttr::CrossAtTg(const cCcD_PntAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D82B0-800D82E8 .text CrossAtTg__12cCcD_SphAttrCFRC14cCcD_ShapeAttrP4cXyz */
void cCcD_SphAttr::CrossAtTg(const cCcD_ShapeAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D82E8-800D82F0 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_AabAttrPf */
void cCcD_SphAttr::CrossCo(const cCcD_AabAttr&, float*) const {
/* Nonmatching */
}
/* 800D82F0-800D82F8 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_TriAttrPf */
void cCcD_SphAttr::CrossCo(const cCcD_TriAttr&, float*) const {
/* Nonmatching */
}
/* 800D82F8-800D8300 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_PntAttrPf */
void cCcD_SphAttr::CrossCo(const cCcD_PntAttr&, float*) const {
/* Nonmatching */
}
/* 800D8300-800D8338 .text CrossCo__12cCcD_SphAttrCFRC14cCcD_ShapeAttrPf */
void cCcD_SphAttr::CrossCo(const cCcD_ShapeAttr&, float*) const {
/* Nonmatching */
}
/* 800D8338-800D8348 .text GetShapeAttr__8dCcD_CpsFv */
void dCcD_Cps::GetShapeAttr() {
/* Nonmatching */
}
/* 800D8348-800D8350 .text CrossAtTg__12cCcD_CpsAttrCFRC12cCcD_AabAttrP4cXyz */
void cCcD_CpsAttr::CrossAtTg(const cCcD_AabAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D8350-800D8358 .text CrossAtTg__12cCcD_CpsAttrCFRC12cCcD_PntAttrP4cXyz */
void cCcD_CpsAttr::CrossAtTg(const cCcD_PntAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D8358-800D8390 .text CrossAtTg__12cCcD_CpsAttrCFRC14cCcD_ShapeAttrP4cXyz */
void cCcD_CpsAttr::CrossAtTg(const cCcD_ShapeAttr&, cXyz*) const {
/* Nonmatching */
}
/* 800D8390-800D8398 .text CrossCo__12cCcD_CpsAttrCFRC12cCcD_AabAttrPf */
void cCcD_CpsAttr::CrossCo(const cCcD_AabAttr&, float*) const {
/* Nonmatching */
}
/* 800D8398-800D83A0 .text CrossCo__12cCcD_CpsAttrCFRC12cCcD_TriAttrPf */
void cCcD_CpsAttr::CrossCo(const cCcD_TriAttr&, float*) const {
/* Nonmatching */
}
/* 800D83A0-800D83A8 .text CrossCo__12cCcD_CpsAttrCFRC12cCcD_PntAttrPf */
void cCcD_CpsAttr::CrossCo(const cCcD_PntAttr&, float*) const {
/* Nonmatching */
}
/* 800D83A8-800D83E0 .text CrossCo__12cCcD_CpsAttrCFRC14cCcD_ShapeAttrPf */
void cCcD_CpsAttr::CrossCo(const cCcD_ShapeAttr&, float*) const {
/* Nonmatching */
}
/* 800D83E0-800D83FC .text cLib_calcTimer<s>__FPs */
void cLib_calcTimer<short>(short*) {
/* Nonmatching */
}
/* 800D83FC-800D8404 .text @20@__dt__16dBgS_ArrowLinChkFv */
void @20@__dt__16dBgS_ArrowLinChkFv {
/* Nonmatching */
}
/* 800D8404-800D840C .text @100@__dt__16dBgS_ArrowLinChkFv */
void @100@__dt__16dBgS_ArrowLinChkFv {
/* Nonmatching */
}
/* 800D840C-800D8414 .text @88@__dt__16dBgS_ArrowLinChkFv */
void @88@__dt__16dBgS_ArrowLinChkFv {
/* Nonmatching */
}
/* 800D8414-800D841C .text @280@__dt__8dCcD_CpsFv */
void @280@__dt__8dCcD_CpsFv {
/* Nonmatching */
}
/* 800D841C-800D8424 .text @248@__dt__8dCcD_CpsFv */
void @248@__dt__8dCcD_CpsFv {
/* Nonmatching */
}
/* 800D8424-800D842C .text @280@__dt__8dCcD_SphFv */
void @280@__dt__8dCcD_SphFv {
/* Nonmatching */
}
/* 800D842C-800D8434 .text @248@__dt__8dCcD_SphFv */
void @248@__dt__8dCcD_SphFv {
/* Nonmatching */
}
actor_method_class daArrowMethodTable = {
(process_method_func)daArrowCreate,
(process_method_func)daArrowDelete,
(process_method_func)daArrowExecute,
(process_method_func)daArrowIsDelete,
(process_method_func)daArrowDraw,
};
extern actor_process_profile_definition g_profile_ARROW = {
/* LayerID */ fpcLy_CURRENT_e,
/* ListID */ 9,
/* ListPrio */ fpcLy_CURRENT_e,
/* ProcName */ PROC_ARROW,
/* Proc SubMtd */ &g_fpcLf_Method.mBase,
/* Size */ sizeof(daArrow_c),
/* SizeOther */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Priority */ 0x01BF,
/* Actor SubMtd */ &daArrowMethodTable,
/* Status */ 0x00044000,
/* Group */ fopAc_ACTOR_e,
/* CullType */ fopAc_CULLBOX_CUSTOM_e,
};
+1 -1
View File
@@ -241,7 +241,7 @@ s32 daBranch_Create(fopAc_ac_c* i_this) {
J3DMaterial* mat = modelData->getMaterialNodePointer(j);
if (mat) {
J3DFog* fog = mat->getPEBlock()->getFog();
fog->field_0x0 = 2;
fog->mType = 2;
}
}
}
+2 -2
View File
@@ -65,7 +65,7 @@ s32 daKaji_c::_create() {
if (fopAcM_entrySolidHeap(this, (heapCallbackFunc)&CheckCreateHeap, 0x660)) {
mDoMtx_stack_c::transS(getPosition());
mDoMtx_stack_c::YrotM(shape_angle.y);
mDoMtx_stack_c::scaleM(mScale.x, mScale.y, mScale.z);
mDoMtx_stack_c::scaleM(mScale);
MTXCopy(mDoMtx_stack_c::get(), mMtx);
l_p_ship = (daObjPirateship::Act_c*)fopAcM_SearchByID(mParentPcId);
@@ -102,7 +102,7 @@ BOOL daKaji_c::_execute() {
mpMorf->getModel()->setBaseScale(mScale);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), mMtx);
+3 -8
View File
@@ -202,9 +202,9 @@ void daNh_c::setBaseMtx() {
glowOffset.y = l_HIO.prm.mGlowOffsetY;
cXyz glowPos;
cMtx_multVec(mDoMtx_stack_c::get(), &glowOffset, &glowPos);
PSMTXTrans(mDoMtx_stack_c::get(), glowPos.x, glowPos.y, glowPos.z);
mDoMtx_stack_c::transS(glowPos);
mDoMtx_stack_c::scaleM(l_HIO.prm.mGlowScale, l_HIO.prm.mGlowScale, l_HIO.prm.mGlowScale);
MTXCopy(mDoMtx_stack_c::get(), mGlowMtx);
cMtx_copy(mDoMtx_stack_c::get(), mGlowMtx);
}
/* 800F9980-800F9A54 .text createHeap__6daNh_cFv */
@@ -229,12 +229,7 @@ static BOOL checkCreateHeap(fopAc_ac_c* i_this) {
/* 800F9A74-800F9C8C .text create__6daNh_cFv */
s32 daNh_c::create() {
static u32 a_heap_size_tbl;
static s8 init;
if (!init) {
a_heap_size_tbl = 0x4000;
init = 1;
}
static u32 a_heap_size_tbl = 0x4000;
s32 phase_state = cPhs_COMPLEATE_e;
+2 -2
View File
@@ -467,8 +467,8 @@ namespace daObjMovebox {
}
daObj::quat_rotBaseY(&temp2, temp3);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
mDoMtx_stack_c::quatM(&temp2);
mDoMtx_stack_c::ZXYrotM(shape_angle);
if (isFloating) {
mDoMtx_stack_c::transM(0.0f, -mUnknown624, 0.0f);
}
+1 -1
View File
@@ -291,7 +291,7 @@ namespace daObjPaper {
/* 000008DC-00000948 .text set_mtx__Q210daObjPaper5Act_cFv */
void daObjPaper::Act_c::set_mtx() {
mDoMtx_stack_c::transS(getPosition());
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
+3 -3
View File
@@ -41,10 +41,10 @@ s32 daSceneChgCreate(void* i_this) {
fopAcM_SetupActor(scnChg, d_a_scene_change_c);
MTXTrans(mDoMtx_stack_c::now, scnChg->current.pos.x, scnChg->current.pos.y, scnChg->current.pos.z);
mDoMtx_ZXYrotM(mDoMtx_stack_c::now, scnChg->shape_angle.x, scnChg->shape_angle.y, scnChg->shape_angle.z);
mDoMtx_stack_c::transS(scnChg->current.pos);
mDoMtx_stack_c::ZXYrotM(scnChg->shape_angle);
MTXCopy(mDoMtx_stack_c::now, scnChg->mTransformMtx);
cMtx_copy(mDoMtx_stack_c::get(), scnChg->mTransformMtx);
return cPhs_COMPLEATE_e;
}
+4 -4
View File
@@ -41,10 +41,10 @@ int daSpotbox_c::draw() {
}
int daSpotbox_c::execute() {
PSMTXTrans(mDoMtx_stack_c::now, this->current.pos.x, this->current.pos.y, this->current.pos.z);
mDoMtx_YrotM(mDoMtx_stack_c::now, this->current.angle.y);
mDoMtx_stack_c::scaleM(this->mScale.x, this->mScale.y, this->mScale.z);
PSMTXCopy(mDoMtx_stack_c::now, this->mtx);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(current.angle.y);
mDoMtx_stack_c::scaleM(mScale);
cMtx_copy(mDoMtx_stack_c::get(), mtx);
return TRUE;
}