d_bg_s work

This commit is contained in:
Jasper St. Pierre
2023-12-02 14:47:52 -08:00
parent 8e970b3566
commit af144f369a
8 changed files with 116 additions and 26 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ public:
void ChkLock() {}
bool ChkMoveBg() { return mFlags & MOVE_BG_e; }
void ChkNoCalcVtx() {}
void ChkPriority(int) {}
bool ChkPriority(int prio) { return mWallCorrectPriority == prio; }
void ChkRoofRegist() {}
void ChkThrough() {}
void ChkWallRegist() {}
+8 -8
View File
@@ -121,13 +121,13 @@ public:
void Set(cXyz* i_pos, cXyz* i_line, void* param_2, cXyz* param_3) {
mpLine0 = i_line;
pm_pos = i_pos;
field_0x058 = param_2;
field_0x58 = param_2;
SetActorPid(fpcM_ERROR_PROCESS_ID_e);
field_0x3c = param_3->y;
field_0x40 = param_3->z;
}
void SetGndUpY(f32 param_0) { mOffsY2 = param_0; }
void SetGndUpY(f32 param_0) { mGndUpY = param_0; }
void ClrNoRoof() {
mGndChk.OffWall();
@@ -139,12 +139,12 @@ public:
/* 0x040 */ f32 field_0x40;
/* 0x044 */ cXyz* pm_pos;
/* 0x048 */ cXyz* mpLine0;
/* 0x04C */ u8 field_0x04C[0x058 - 0x04C];
/* 0x058 */ void* field_0x058;
/* 0x05C */ f32 field_0x05c;
/* 0x060 */ u8 field_0x060;
/* 0x064 */ f32 mOffsY2;
/* 0x068 */ f32 field_0x068;
/* 0x04C */ cXyz field_0x4c;
/* 0x058 */ void* field_0x58;
/* 0x05C */ f32 field_0x5c;
/* 0x060 */ u8 field_0x60;
/* 0x064 */ f32 mGndUpY;
/* 0x068 */ f32 field_0x68;
/* 0x06C */ cM3dGCyl mCyl0;
/* 0x084 */ cM3dGCyl mCyl1;
/* 0x09C */ cM3dGLin mLin;
+9 -2
View File
@@ -98,10 +98,17 @@ public:
f32 GetWallAllLowH_R();
f32 GetSpeedY();
f32 GetWallAddY(Vec&);
void SetNowActorInfo(int, void*, unsigned int);
void SetNowActorInfo(int bg_index, void* bgw, unsigned int apid) {
m_bg_index = bg_index;
field_0x78 = bgw;
field_0x7c = apid;
}
void SetWallPolyIndex(int, int);
void CalcMovePosWork();
void CalcWallRR();
void CalcWallRR() {
for (s32 i = 0; i < m_tbl_size; i++)
pm_acch_cir[i].CalcWallRR();
}
void SetMoveBGOnly();
void ClrMoveBGOnly();
void SetGndThinCellingOff();
+3 -3
View File
@@ -23,13 +23,13 @@ public:
void SetPos(cXyz& pos) { m_pos = pos; }
cXyz* GetPosP() { return &m_pos; }
f32 GetNowY() { return m_pos.y; }
void SetNowY(f32 y) { m_pos.y = y; }
f32 GetNowY() { return m_now_y; }
void SetNowY(f32 y) { m_now_y = y; }
private:
/* 0x38 */ cXyz m_pos;
/* 0x44 */ void* field_0x44;
/* 0x48 */ void* field_0x48;
/* 0x48 */ f32 m_now_y;
}; // Size: 0x4C
STATIC_ASSERT(sizeof(dBgS_RoofChk) == 0x4C);
+25
View File
@@ -0,0 +1,25 @@
#ifndef D_BG_D_BG_S_SPH_CHK_H
#define D_BG_D_BG_S_SPH_CHK_H
#include "SSystem/SComponent/c_bg_s_poly_info.h"
#include "SSystem/SComponent/c_m3d_g_sph.h"
#include "SSystem/SComponent/c_xyz.h"
#include "d/d_bg_s_chk.h"
class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
dBgS_SphChk();
void Init() {
ClearPi();
}
virtual ~dBgS_SphChk() {}
typedef void(*Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
void SetCallback(Callback cb) { mpCallback = cb; }
private:
/* 0x4c */ Callback mpCallback;
}; // Size: 0x50
#endif /* D_BG_D_BG_S_SPH_CHK_H */
+3 -3
View File
@@ -36,13 +36,13 @@ public:
void WallCorrectGrpRp(dBgS_Acch*, int, int);
void RwgRoofChk(u16, dBgS_RoofChk*);
void RoofChkRp(dBgS_RoofChk*, int);
void RoofChkGrpRp(dBgS_RoofChk*, int, int);
bool RoofChkGrpRp(dBgS_RoofChk*, int, int);
void RwgSplGrpChk(u16, dBgS_SplGrpChk*);
void SplGrpChkRp(dBgS_SplGrpChk*, int);
void SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
bool SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
void RwgSphChk(u16, dBgS_SphChk*, void*);
void SphChkRp(dBgS_SphChk*, void*, int);
void SphChkGrpRp(dBgS_SphChk*, void*, int, int);
bool SphChkGrpRp(dBgS_SphChk*, void*, int, int);
void positionWallCrrPos(cM3dGTri&, dBgS_CrrPos*, cXyz*, f32, f32);
void RwgWallCrrPos(u16, dBgS_CrrPos*);
void WallCrrPosRp(dBgS_CrrPos*, int);
+64 -6
View File
@@ -4,6 +4,8 @@
//
#include "d/d_bg_s.h"
#include "d/d_bg_s_acch.h"
#include "d/d_bg_s_sph_chk.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor_mng.h"
@@ -325,27 +327,83 @@ bool dBgS::LineCrossNonMoveBG(cBgS_LinChk* chk) {
}
/* 800A12A4-800A13E0 .text WallCorrect__4dBgSFP9dBgS_Acch */
void dBgS::WallCorrect(dBgS_Acch*) {
void dBgS::WallCorrect(dBgS_Acch* acch) {
/* Nonmatching */
acch->CalcWallRR();
acch->SetWallCir();
acch->SetLin();
acch->CalcWallBmdCyl();
for (s32 prio = 0; prio < 3; prio++) {
for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) {
cBgS_ChkElm* elm = &m_chk_element[bg_index];
if (elm->ChkUsed() && elm->m_bgw_base_ptr->pm_vtx_tbl != NULL) {
acch->SetNowActorInfo(bg_index, elm->m_bgw_base_ptr, elm->m_actor_id);
if (!acch->ChkSameActorPid(elm->m_actor_id)) {
dBgW* bgwp = (dBgW*)elm->m_bgw_base_ptr;
if (bgwp->ChkPriority(prio))
bgwp->WallCorrectGrpRp(acch, bgwp->m_rootGrpIdx, 1);
}
}
}
}
}
/* 800A13E0-800A14FC .text RoofChk__4dBgSFP12dBgS_RoofChk */
f32 dBgS::RoofChk(dBgS_RoofChk*) {
f32 dBgS::RoofChk(dBgS_RoofChk* chk) {
/* Nonmatching */
chk->SetNowY(1e+09);
chk->ClearPi();
for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) {
cBgS_ChkElm* elm = &m_chk_element[bg_index];
if (elm->ChkUsed() && elm->m_bgw_base_ptr->pm_vtx_tbl != NULL && !chk->ChkSameActorPid(elm->m_actor_id)) {
dBgW* bgwp = (dBgW*)elm->m_bgw_base_ptr;
if (bgwp->RoofChkGrpRp(chk, elm->m_bgw_base_ptr->m_rootGrpIdx, 1)) {
chk->SetActorInfo(bg_index, elm->m_bgw_base_ptr, elm->m_actor_id);
}
}
}
return chk->GetNowY();
}
/* 800A14FC-800A160C .text SplGrpChk__4dBgSFP14dBgS_SplGrpChk */
bool dBgS::SplGrpChk(dBgS_SplGrpChk*) {
/* Nonmatching */
bool dBgS::SplGrpChk(dBgS_SplGrpChk* chk) {
bool ret = false;
chk->Init();
for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) {
cBgS_ChkElm* elm = &m_chk_element[bg_index];
if (elm->ChkUsed() && elm->m_bgw_base_ptr->pm_vtx_tbl != NULL && !chk->ChkSameActorPid(elm->m_actor_id)) {
dBgW* bgwp = (dBgW*)elm->m_bgw_base_ptr;
if (bgwp->SplGrpChkGrpRp(chk, elm->m_bgw_base_ptr->m_rootGrpIdx, 1)) {
ret = true;
chk->SetActorInfo(bg_index, elm->m_bgw_base_ptr, elm->m_actor_id);
chk->OnFind();
}
}
}
return ret;
}
/* 800A160C-800A1730 .text SphChk__4dBgSFP11dBgS_SphChkPv */
bool dBgS::SphChk(dBgS_SphChk*, void*) {
bool dBgS::SphChk(dBgS_SphChk* chk, void* user) {
/* Nonmatching */
bool ret = false;
chk->Init();
for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) {
cBgS_ChkElm* elm = &m_chk_element[bg_index];
if (elm->ChkUsed() && elm->m_bgw_base_ptr->pm_vtx_tbl != NULL && !chk->ChkSameActorPid(elm->m_actor_id)) {
dBgW* bgwp = (dBgW*)elm->m_bgw_base_ptr;
if (bgwp->SphChkGrpRp(chk, user, elm->m_bgw_base_ptr->m_rootGrpIdx, 1)) {
chk->SetActorInfo(bg_index, elm->m_bgw_base_ptr, elm->m_actor_id);
ret = true;
}
}
}
return ret;
}
/* 800A1730-800A1954 .text WallCrrPos__4dBgSFP11dBgS_CrrPos */
void dBgS::WallCrrPos(dBgS_CrrPos*) {
void dBgS::WallCrrPos(dBgS_CrrPos* crr) {
/* Nonmatching */
}
+3 -3
View File
@@ -47,7 +47,7 @@ void dBgW::RoofChkRp(dBgS_RoofChk*, int) {
}
/* 800A7514-800A767C .text RoofChkGrpRp__4dBgWFP12dBgS_RoofChkii */
void dBgW::RoofChkGrpRp(dBgS_RoofChk*, int, int) {
bool dBgW::RoofChkGrpRp(dBgS_RoofChk*, int, int) {
/* Nonmatching */
}
@@ -62,7 +62,7 @@ void dBgW::SplGrpChkRp(dBgS_SplGrpChk*, int) {
}
/* 800A7A74-800A7BDC .text SplGrpChkGrpRp__4dBgWFP14dBgS_SplGrpChkii */
void dBgW::SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int) {
bool dBgW::SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int) {
/* Nonmatching */
}
@@ -77,7 +77,7 @@ void dBgW::SphChkRp(dBgS_SphChk*, void*, int) {
}
/* 800A8038-800A8158 .text SphChkGrpRp__4dBgWFP11dBgS_SphChkPvii */
void dBgW::SphChkGrpRp(dBgS_SphChk*, void*, int, int) {
bool dBgW::SphChkGrpRp(dBgS_SphChk*, void*, int, int) {
/* Nonmatching */
}