daObjTpost_c Nearly OK (#60)

* daObjTpost_c Nearly OK

Also a little bit more work on fopNpc_npc_c

* Remove Duplicate Struct
This commit is contained in:
SuperDude88
2023-09-19 19:49:23 -04:00
committed by GitHub
parent 667d122882
commit 54a8ffbe37
13 changed files with 1177 additions and 353 deletions
+7 -7
View File
@@ -29,14 +29,14 @@ public:
/* 0x4 */ WALL_H_DIRECT = 4,
};
/* 80075EAC */ dBgS_AcchCir();
/* 80075F14 */ void ClrWallHit();
/* 80075F40 */ void SetWallR(f32);
/* 80075F48 */ void CalcWallRR();
/* 80075F58 */ void SetWall(f32, f32);
/* 80075F80 */ void SetWallHDirect(f32);
dBgS_AcchCir();
void ClrWallHit();
void SetWallR(f32);
void CalcWallRR();
void SetWall(f32, f32);
void SetWallHDirect(f32);
/* 80077414 */ virtual ~dBgS_AcchCir() {}
virtual ~dBgS_AcchCir() {}
f32 GetWallH() { return m_wall_h; }
f32 GetWallR() { return m_wall_r; }
+32 -4
View File
@@ -164,6 +164,10 @@ public:
fopAc_ac_c* getPlayer(int idx) { return (fopAc_ac_c*)mpPlayer[idx]; }
s8 getPlayerCameraID(int idx) { return mCurCamera[idx]; }
int getItemRupeeCount() { return mItemRupeeCount; }
void setItemRupeeCount(int count) { mItemRupeeCount += count; }
void setMessageCountNumber(s16 num) { mMsgCountNumber = num; }
void setLkDemoAnmArchive(JKRArchive* i_arc) { mpLkDArc = i_arc; }
void setStatus(u16 status) { mStatus = status; }
@@ -263,7 +267,7 @@ public:
/* 0x48E8 */ u8 field_0x48E8[0x48F6 - 0x48E8];
/* 0x48F6 */ s16 mItemPendantNumCount;
/* 0x48F8 */ u8 field_0x48F8[0x4918 - 0x48F8];
/* 0x4918 */ u16 mCurrAuctionItemNameMsgID;
/* 0x4918 */ u16 mMsgCountNumber;
/* 0x491A */ s16 field_0x491a;
/* 0x491C */ s16 field_0x491c;
/* 0x491E */ s16 field_0x491e;
@@ -406,6 +410,10 @@ inline u8 dComIfGs_getWalletSize() {
return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getWalletSize();
}
inline int dComIfGs_getRupee() {
return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getRupee();
}
inline u8 dComIfGs_getMagic() {
return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getMagic();
}
@@ -454,6 +462,10 @@ inline u8 dComIfGs_getReserveNum(int i_idx) {
return g_dComIfG_gameInfo.save.getPlayer().getBagItemRecord().getReserveNum(i_idx);
}
inline void dComIfGs_setReserveItemEmpty() {
g_dComIfG_gameInfo.save.getPlayer().getBagItem().setReserveItemEmpty();
}
inline void dComIfGs_setEventReg(u16 i_reg, u8 i_no) {
g_dComIfG_gameInfo.save.getEvent().setEventReg(i_reg, i_no);
}
@@ -960,6 +972,18 @@ inline BOOL dComIfGp_checkCameraAttentionStatus(int idx, u32 flag) {
return g_dComIfG_gameInfo.play.checkCameraAttentionStatus(idx, flag);
}
inline int dComIfGp_getItemRupeeCount() {
return g_dComIfG_gameInfo.play.getItemRupeeCount();
}
inline void dComIfGp_setItemRupeeCount(int count) {
g_dComIfG_gameInfo.play.setItemRupeeCount(count);
}
inline void dComIfGp_setMessageCountNumber(s16 num) {
g_dComIfG_gameInfo.play.setMessageCountNumber(num);
}
/**
* === EVENT ===*/
@@ -983,6 +1007,10 @@ inline void dComIfGp_event_offEventFlag(s16 flag) {
return g_dComIfG_gameInfo.play.getEvent().offEventFlag(flag);
}
inline u8 dComIfGp_event_getPreItemNo() {
return g_dComIfG_gameInfo.play.getEvent().getPreItemNo();
}
inline void dComIfGp_event_setItemPartnerId(u32 id) {
return g_dComIfG_gameInfo.play.getEvent().setPtI_Id(id);
}
@@ -995,11 +1023,11 @@ inline u32 dComIfGp_evmng_getEventIdx(char* pName, u8 evNo) {
return dComIfGp_getEventManager().getEventIdx(pName, evNo);
}
inline u32 dComIfGp_evmng_getMyStaffId(char* pName, fopAc_ac_c* pActor, s32 param_3) {
inline int dComIfGp_evmng_getMyStaffId(char* pName, fopAc_ac_c* pActor, s32 param_3) {
return dComIfGp_getEventManager().getMyStaffId(pName, pActor, param_3);
}
inline u32 dComIfGp_evmng_getMyActIdx(int staffIdx, const char* const* pActions, int actionCount, int force, int param_5) {
inline int dComIfGp_evmng_getMyActIdx(int staffIdx, const char* const* pActions, int actionCount, int force, int param_5) {
return dComIfGp_getEventManager().getMyActIdx(staffIdx, pActions, actionCount, force, param_5);
}
@@ -1035,7 +1063,7 @@ inline BOOL dComIfGp_evmng_getIsAddvance(s32 staffIdx) {
return dComIfGp_getEventManager().getIsAddvance(staffIdx);
}
inline void dComIfGp_evmng_cutEnd(s32 staffIdx) {
inline void dComIfGp_evmng_cutEnd(int staffIdx) {
return dComIfGp_getEventManager().cutEnd(staffIdx);
}
+1
View File
@@ -62,6 +62,7 @@ public:
u8 getTalkXYBtn() { return mTalkButton; }
bool chkTalkXY() { return mTalkButton == 1 || mTalkButton == 2 || mTalkButton == 3; }
void setPtI_Id(u32 id) { mPtItem = id; }
u8 getPreItemNo() { return mItemNo; }
u16 chkEventFlag(u16 flag) { return flag & mEventFlag; }
void onEventFlag(u16 flag) { mEventFlag |= flag; }
+15
View File
@@ -0,0 +1,15 @@
#ifndef D_LETTER_H
#define D_LETTER_H
bool dLetter_isNoSend(u16);
void dLetter_send(u16);
bool dLetter_isSend(u16);
bool dLetter_stock(u16);
bool dLetter_isStock(u16);
void dLetter_read(u16);
bool dLetter_isRead(u16);
void dLetter_delivery(u16);
void dLetter_autoStock(u16);
bool dLetter_isDelivery(u16);
#endif /* D_LETTER_H */
+14 -2
View File
@@ -5,7 +5,7 @@
class STControl {
public:
void STControl(s16, s16, s16, s16, f32, f32, s16, s16);
STControl(s16, s16, s16, s16, f32, f32, s16, s16);
void setWaitParm(s16, s16, s16, s16, f32, f32, s16, s16);
void init();
void Xinit();
@@ -38,4 +38,16 @@ public:
/* 0x26 */ s16 field_0x26;
};
#endif /* D_LIB_H */
class dLib_anm_prm_c {
public:
/* 0x00 */ s8 field_0x00;
/* 0x01 */ s8 field_0x01;
/* 0x02 */ s16 field_0x02;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ u32 loopMode;
};
void dLib_bcks_setAnm(const char*, mDoExt_McaMorf*, s8*, s8*, s8*, const int*, const dLib_anm_prm_c*, bool);
#endif /* D_LIB_H */
+22 -7
View File
@@ -37,14 +37,19 @@ class dNpc_JntCtrl_c {
/* 0x32 */ s16 field_0x32;
public:
dNpc_JntCtrl_c() {
field_0x0C = 0;
field_0x0B = 0;
}
bool angCalcS(s16*, s16, s16, s16);
void limitter(s16*, s16, s16);
void follow(s16*, s16, s16, int);
bool follow(s16*, s16, s16, int);
void move(s16, int);
void lookAtTarget(s16*, cXyz*, cXyz, s16, s16, bool);
void setParam(s16, s16, s16, s16, s16, s16, s16, s16, s16);
s16 chkLim(s16, int, int);
s32 chkLim(s16, int, int);
void turn_fromBackbone2Head(s16, s16*, s16*, bool);
void turn_fromHead2Backbone(s16, s16*, s16*);
s16 follow_current(s16*, s16);
@@ -53,10 +58,10 @@ public:
class dNpc_EventCut_c {
/* 0x00 */ char* mpEvtStaffName;
/* 0x04 */ s32 mEvtStaffId;
/* 0x04 */ int mEvtStaffId;
/* 0x08 */ fopAc_ac_c* mpActor;
/* 0x0C */ fopNpc_npc_c* mpTalkActor;
/* 0x10 */ s32 mCurActIdx;
/* 0x10 */ int mCurActIdx;
/* 0x14 */ u32 field_0x14;
/* 0x18 */ int mTimer;
/* 0x1C */ char* mpActorName;
@@ -78,6 +83,12 @@ class dNpc_EventCut_c {
/* 0x68 */ u8* field_0x68;
public:
dNpc_EventCut_c() {
mpActor = 0;
mpTalkActor = 0;
field_0x68 = 0;
}
void setActorInfo(char*, fopAc_ac_c*);
void setActorInfo2(char*, fopNpc_npc_c*);
@@ -166,8 +177,12 @@ enum dNpc_MessageStatus_e {
class fopNpc_npc_c : public fopAc_ac_c {
public:
fopNpc_npc_c() {
mCurrMsgBsPcId = -1;
mpCurrMsg = 0;
}
/* 0x290 */ dNpc_JntCtrl_c mJntCtrl;
/* 0x2C4 */ dNpc_EventCut_c mEventCtrl;
/* 0x2C4 */ dNpc_EventCut_c mEventCut;
/* 0x330 */ mDoExt_McaMorf* mpMcaMorf;
/* 0x334 */ dBgS_ObjAcch mObjAcch;
/* 0x4F8 */ dBgS_AcchCir mAcchCir;
@@ -179,8 +194,8 @@ public:
/* 0x6B0 */ msg_class* mpCurrMsg;
/* 0x6B4 */ u8 pad_0x6B4[0x6C0 - 0x6B4];
virtual u32 next_msgStatus(u32*) { return 0x10; }
virtual u32 getMsg() { return 1; }
virtual u16 next_msgStatus(u32* msgId) { return dNpcMsgStts_MSG_ENDS_e; }
virtual u32 getMsg() { return 0; }
virtual void anmAtr(u16) {}
void setCollision(float radius, float height);
+2 -1
View File
@@ -7,9 +7,10 @@
class dSv_player_status_a_c {
public:
/* 800589A8 */ void init();
u8 getSelectEquip(int i_no) { return mSelectEquip[i_no]; }
u8 getWalletSize() { return mWalletSize; }
int getRupee() const { return mRupee; }
u8 getMagic() { return mMagic; }
/* 0x00 */ u16 mMaxLife;
+2
View File
@@ -918,6 +918,8 @@ int dStage_mapInfo_GetOceanZ(stage_map_info_class*);
int dStage_mapInfo_GetOceanX(stage_map_info_class*);
void dStage_infoCreate();
dStage_objectNameInf* dStage_searchName(const char*);
inline s32 dStage_stagInfo_GetSaveTbl(stage_stag_info_class* i_stagInfo) {
return (i_stagInfo->field_0x09 >> 1) & 0x7F;
}
+1 -1
View File
@@ -411,7 +411,7 @@ f32 fopAcM_searchActorDistanceXZ(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
f32 fopAcM_searchActorDistanceXZ2(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
s32 fopAcM_rollPlayerCrash(fopAc_ac_c*, f32, u32, f32, f32, int, f32);
s32 fopAcM_rollPlayerCrash(fopAc_ac_c*, f32, u32);
s32 fopAcM_checkCullingBox(f32[3][4], f32, f32, f32, f32, f32, f32);
s32 fopAcM_cullingCheck(fopAc_ac_c*);
void* event_second_actor(u16);
+16
View File
@@ -248,11 +248,27 @@ public:
mDoExt_McaMorf(J3DModelData*, mDoExt_McaMorfCallBack1_c*, mDoExt_McaMorfCallBack2_c*, J3DAnmTransform*, int, float, int, int, int, void*, unsigned long, unsigned long);
virtual ~mDoExt_McaMorf();
void calc();
void calc(u16);
void setAnm(J3DAnmTransform*, int, f32, f32, f32, f32, void*);
void setMorf(f32);
J3DModel* getModel() { return mpModel; }
void setFrame(f32 frame) { mFrameCtrl.setFrame(frame); }
f32 getFrame() { return mFrameCtrl.getFrame(); }
bool isStop() const { //regswap somewhere here
bool stopped = true;
if (!mFrameCtrl.checkState(1) && mFrameCtrl.getRate() != 0.0f) {
stopped = false;
}
return stopped;
}
void update();
void updateDL();
void entry();
void entryDL();
void entryDL(J3DMaterialTable*);
void play(Vec *, u32, s8);
void stopZelAnime();
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -87,7 +87,7 @@ void dComIfG_play_c::itemInit() {
for (int i = 0; i < 4; i++) {
}
mCurrAuctionItemNameMsgID = 0;
mMsgCountNumber = 0;
field_0x491a = 0;
field_0x491c = 0;
field_0x491e = 0;
+84 -28
View File
@@ -35,9 +35,10 @@ void dNpc_JntCtrl_c::limitter(s16* targetDiff, s16 maxDiff, s16 minDiff) {
}
}
/* 8021A884-8021A97C .text follow__14dNpc_JntCtrl_cFPsssi */
void dNpc_JntCtrl_c::follow(short*, short, short, int) {
/* Nonmatching */
bool dNpc_JntCtrl_c::follow(s16* outY, s16 targetY, s16 maxVel, int param_4) {
angCalcS(outY, targetY, 4, maxVel);
return *outY != targetY;
}
/* 8021A97C-8021AABC .text move__14dNpc_JntCtrl_cFsi */
@@ -289,16 +290,18 @@ u8 dNpc_PathRun_c::pointArg(u8 idx) {
return arg;
}
bool dNpc_PathRun_c::setNearPathIndx(cXyz* param_1, float param_2) {
bool dNpc_PathRun_c::setNearPathIndx(cXyz* param_1, f32 param_2) {
bool set = false;
if(mPath != 0) {
f32 max_dist = 1000000000.0f;
u8 pointIdx = 0;
for(int i = 0; i < maxPoint(); i++) {
cXyz point = getPoint(i);
cXyz diff = (*param_1 - point);
f32 temp = diff.getMagXZ();
f32 dist = sqrtf(param_2 * (diff.y * diff.y) + temp);
f32 xz_mag = diff.getMagXZ();
f32 y_mag = param_2 * (diff.y * diff.y);
f32 dist = sqrtf(y_mag + xz_mag);
if(max_dist > dist) {
max_dist = dist;
@@ -575,12 +578,12 @@ bool dNpc_setAnm_2(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 speed, int
}
void dNpc_HeadAnm_c::swing_vertical_init(s16 param_1, s16 param_2, s16 param_3, int param_4) {
if(param_4 == 0 || mFunc != &swing_vertical) {
if(param_4 == 0 || mFunc != &swing_horizone) { //these ptmfs should be going in rodata instead of data
field_0x1C = 0;
field_0x20 = param_1;
field_0x1E = param_2;
field_0x14 = param_3;
mFunc = &swing_vertical;
mFunc = &swing_vertical; //these ptmfs should be going in rodata instead of data
}
}
@@ -589,14 +592,13 @@ void dNpc_HeadAnm_c::swing_vertical() {
/* Nonmatching */
}
/* 8021C3C8-8021C478 .text swing_horizone_init__14dNpc_HeadAnm_cFsssi */
void dNpc_HeadAnm_c::swing_horizone_init(s16 param_1, s16 param_2, s16 param_3, int param_4) {
if(param_4 == 0 || mFunc != &swing_horizone) {
if(param_4 == 0 || mFunc != &swing_vertical) { //these ptmfs should be going in rodata instead of data
field_0x1C = 0;
field_0x20 = param_1;
field_0x1E = param_2;
field_0x18 = param_3;
mFunc = &swing_horizone;
mFunc = &swing_horizone; //these ptmfs should be going in rodata instead of data
}
}
@@ -615,9 +617,15 @@ void dNpc_HeadAnm_c::move() {
}
}
/* 8021C5D8-8021C620 .text chkLim__14dNpc_JntCtrl_cFsii */
s16 dNpc_JntCtrl_c::chkLim(short, int, int) {
/* Nonmatching */
s32 dNpc_JntCtrl_c::chkLim(s16 param_1, int param_2, int param_3) {
//if(maxRotations[param_2][param_3] > param_1) {
// param_1 = maxRotations[param_2][param_3];
//}
//if(param_1 < minRotations[param_2][param_3]) {
// param_1 = minRotations[param_2][param_3];
//}
//return param_1;
}
void dNpc_JntCtrl_c::turn_fromBackbone2Head(s16 param_1, s16* param_2, s16* param_3, bool param_4) {
@@ -1026,23 +1034,43 @@ fopAc_ac_c* dNpc_EventCut_c::findActorCallBack(fopAc_ac_c* pActor, void* pData)
dNpc_EventCut_c* cut = static_cast<dNpc_EventCut_c*>(pData);
if(cut == 0) {
pActor = 0;
return 0;
}
else if(cut->mSetID == 0 || pActor->mSetID != cut->mSetID) {
if(cut->mpActorName == 0) {
pActor = 0;
}
else {
//if(dStage_searchName(cut->mpActorName) == 0) {
// pActor = 0;
//}
//else {
//}
}
}
else {
if(cut->mSetID != 0 && pActor->mSetID == cut->mSetID) {
cut->mTargetActorPos = pActor->current.pos;
cut->mpTargetActor = pActor;
return pActor;
}
else {
if(cut->mpActorName == 0) {
return 0;
}
else {
dStage_objectNameInf* obj = dStage_searchName(cut->mpActorName);
if(obj == 0) {
return 0;
}
else {
if(obj->mProcName == fopAcM_GetProfName(pActor) && obj->mSubtype == pActor->mSubtype) {
f32 mag = sqrtf(cut->mTargetActorPos.getSquareMag());
if(mag == 0.0f) {
cut->mTargetActorPos = pActor->current.pos;
cut->mpTargetActor = pActor;
}
else {
f32 mag1 = sqrtf((cut->mTargetActorPos - cut->mpActor->current.pos).getSquareMag());
f32 mag2 = sqrtf((pActor->current.pos - cut->mpActor->current.pos).getSquareMag());
if(mag2 < mag1) {
cut->mTargetActorPos = pActor->current.pos;
cut->mpTargetActor = pActor;
}
}
}
}
}
}
return 0;
@@ -1262,3 +1290,31 @@ void dNpc_EventCut_c::cutTalkMsgProc() {
}
}
}
dCcD_SrcCyl dNpc_cyl_src = {
0,
0,
0,
0,
0xFFFFFFBF, // Tg damage types
3,
0x75,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
// Cylinder
0.0, // X
0.0, // Y
0.0, // Z
0.0, // Radius
0.0, // Height
};