Match 5 d_bg_w_kcol funcs (#2856)

* dBgWKCol::CaptPoly equivalent

* dBgWKCol::CaptPoly OK

* Switch s32->int for the rest of the dBgW functions just in case

This doesn't immediately help any other functions besides CaptPoly, but I suspect it could help prevent issues in the future since it's more likely to be what the original devs did.

* Debug var fix

* Match 3 more kcol funcs

* Remove unused lits

* Update nonmatching comments

* Fix ChkShdwDrawThrough
This commit is contained in:
LagoLunatic
2025-11-23 22:07:35 -08:00
committed by GitHub
parent 178191908c
commit 97c60c9092
5 changed files with 252 additions and 258 deletions
+15 -15
View File
@@ -175,9 +175,9 @@ public:
virtual bool RoofChk(dBgS_RoofChk*) = 0;
virtual bool SplGrpChk(dBgS_SplGrpChk*) = 0;
virtual bool SphChk(dBgS_SphChk*, void*) = 0;
/* 8007B0E4 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const;
virtual s32 GetExitId(cBgS_PolyInfo const&) = 0;
virtual s32 GetPolyColor(cBgS_PolyInfo const&) = 0;
/* 8007B0E4 */ virtual int GetGrpRoomIndex(cBgS_PolyInfo const&) const;
virtual int GetExitId(cBgS_PolyInfo const&) = 0;
virtual int GetPolyColor(cBgS_PolyInfo const&) = 0;
virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(int) = 0;
@@ -194,16 +194,16 @@ public:
virtual u32 GetUnderwaterRoofCode(int) = 0;
virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
virtual int GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual s32 GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt0(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt1(cBgS_PolyInfo const&) = 0;
virtual int GetGroundCode(cBgS_PolyInfo const&) = 0;
virtual u32 GetIronBallThrough(int) = 0;
virtual u32 GetAttackThrough(int) = 0;
virtual s32 GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual int GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual int GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual int GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual int GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual int GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
@@ -287,8 +287,8 @@ public:
/* 8007D470 */ virtual bool RoofChk(dBgS_RoofChk*);
/* 8007D830 */ virtual bool SplGrpChk(dBgS_SplGrpChk*);
/* 8007DF00 */ virtual bool SphChk(dBgS_SphChk*, void*);
/* 8007B3AC */ virtual s32 GetExitId(cBgS_PolyInfo const&);
/* 8007B3D8 */ virtual s32 GetPolyColor(cBgS_PolyInfo const&);
/* 8007B3AC */ virtual int GetExitId(cBgS_PolyInfo const&);
/* 8007B3D8 */ virtual int GetPolyColor(cBgS_PolyInfo const&);
/* 8007B404 */ virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&);
/* 8007B430 */ virtual int GetSpecialCode(cBgS_PolyInfo const&);
/* 8007B460 */ virtual int GetSpecialCode(int);
@@ -305,16 +305,16 @@ public:
/* 8007B630 */ virtual u32 GetUnderwaterRoofCode(int);
/* 8007B4B4 */ virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&);
/* 8007B6AC */ virtual int GetLinkNo(cBgS_PolyInfo const&);
/* 8007B6D8 */ virtual s32 GetWallCode(cBgS_PolyInfo const&);
/* 8007B6D8 */ virtual int GetWallCode(cBgS_PolyInfo const&);
/* 8007B704 */ virtual int GetPolyAtt0(cBgS_PolyInfo const&);
/* 8007B734 */ virtual int GetPolyAtt1(cBgS_PolyInfo const&);
/* 8007B760 */ virtual int GetGroundCode(cBgS_PolyInfo const&);
/* 8007B7DC */ virtual u32 GetIronBallThrough(int);
/* 8007B800 */ virtual u32 GetAttackThrough(int);
/* 8007B87C */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const&);
/* 8007B8A8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const&);
/* 8007B8D8 */ virtual s32 GetRoomPathId(cBgS_PolyInfo const&);
/* 8007B904 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 8007B87C */ virtual int GetCamMoveBG(cBgS_PolyInfo const&);
/* 8007B8A8 */ virtual int GetRoomCamId(cBgS_PolyInfo const&);
/* 8007B8D8 */ virtual int GetRoomPathId(cBgS_PolyInfo const&);
/* 8007B904 */ virtual int GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 8007DF28 */ virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 8007DF58 */ virtual int GetGrpSoundId(cBgS_PolyInfo const&);
/* 8007DF88 */ virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*,
+8 -8
View File
@@ -67,9 +67,9 @@ public:
virtual bool RoofChk(dBgS_RoofChk*) = 0;
virtual bool SplGrpChk(dBgS_SplGrpChk*) = 0;
virtual bool SphChk(dBgS_SphChk*, void*) = 0;
virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const = 0;
virtual s32 GetExitId(cBgS_PolyInfo const&) = 0;
virtual s32 GetPolyColor(cBgS_PolyInfo const&) = 0;
virtual int GetGrpRoomIndex(cBgS_PolyInfo const&) const = 0;
virtual int GetExitId(cBgS_PolyInfo const&) = 0;
virtual int GetPolyColor(cBgS_PolyInfo const&) = 0;
virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(int) = 0;
@@ -86,16 +86,16 @@ public:
virtual u32 GetUnderwaterRoofCode(int) = 0;
virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
virtual int GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual s32 GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt0(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt1(cBgS_PolyInfo const&) = 0;
virtual int GetGroundCode(cBgS_PolyInfo const&) = 0;
virtual u32 GetIronBallThrough(int) = 0;
virtual u32 GetAttackThrough(int) = 0;
virtual s32 GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual int GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual int GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual int GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual int GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual int GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
+9 -9
View File
@@ -47,7 +47,7 @@ public:
/* 8007E9D4 */ bool GetTriPnt(KC_PrismData const*, Vec*, Vec*, Vec*) const;
/* 8007EB70 */ void getPolyCode(int, dBgPc*) const;
/* 8007EBC4 */ bool chkPolyThrough(dBgPc*, cBgS_PolyPassChk*, cBgS_GrpPassChk*, cXyz&) const;
/* 8007FF00 */ u8 ChkShdwDrawThrough(dBgPc*);
/* 8007FF00 */ bool ChkShdwDrawThrough(dBgPc*);
/* 8007E74C */ virtual ~dBgWKCol();
/* 8007E86C */ virtual bool ChkNotReady() const;
@@ -69,9 +69,9 @@ public:
/* 80081E18 */ virtual bool RoofChk(dBgS_RoofChk*);
/* 80082184 */ virtual bool SplGrpChk(dBgS_SplGrpChk*);
/* 800824EC */ virtual bool SphChk(dBgS_SphChk*, void*);
/* 800829F0 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const;
/* 80082A20 */ virtual s32 GetExitId(cBgS_PolyInfo const&);
/* 80082A50 */ virtual s32 GetPolyColor(cBgS_PolyInfo const&);
/* 800829F0 */ virtual int GetGrpRoomIndex(cBgS_PolyInfo const&) const;
/* 80082A20 */ virtual int GetExitId(cBgS_PolyInfo const&);
/* 80082A50 */ virtual int GetPolyColor(cBgS_PolyInfo const&);
/* 80082A80 */ virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&);
/* 80082AB0 */ virtual int GetSpecialCode(cBgS_PolyInfo const&);
/* 80082AE0 */ virtual int GetSpecialCode(int);
@@ -88,16 +88,16 @@ public:
/* 80082CCC */ virtual u32 GetUnderwaterRoofCode(int);
/* 80082B3C */ virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&);
/* 80082D24 */ virtual int GetLinkNo(cBgS_PolyInfo const&);
/* 80082D54 */ virtual s32 GetWallCode(cBgS_PolyInfo const&);
/* 80082D54 */ virtual int GetWallCode(cBgS_PolyInfo const&);
/* 80082D84 */ virtual int GetPolyAtt0(cBgS_PolyInfo const&);
/* 80082DB4 */ virtual int GetPolyAtt1(cBgS_PolyInfo const&);
/* 80082DE4 */ virtual int GetGroundCode(cBgS_PolyInfo const&);
/* 80082E14 */ virtual u32 GetIronBallThrough(int);
/* 80082E40 */ virtual u32 GetAttackThrough(int);
/* 80082E6C */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const&);
/* 80082E9C */ virtual s32 GetRoomCamId(cBgS_PolyInfo const&);
/* 80082ECC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const&);
/* 80082EFC */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 80082E6C */ virtual int GetCamMoveBG(cBgS_PolyInfo const&);
/* 80082E9C */ virtual int GetRoomCamId(cBgS_PolyInfo const&);
/* 80082ECC */ virtual int GetRoomPathId(cBgS_PolyInfo const&);
/* 80082EFC */ virtual int GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 80082F2C */ virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 80082F5C */ virtual int GetGrpSoundId(cBgS_PolyInfo const&);
/* 80082F8C */ virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*,
+18 -18
View File
@@ -309,7 +309,7 @@ void cBgW::MakeNodeTreeGrpRp(int i_grp_idx) {
*pm_node_tree[pm_bgd->m_g_tbl[i_grp_idx].m_tree_idx].GetMaxP());
}
s32 child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF)
break;
@@ -518,7 +518,7 @@ bool cBgW::LineCheckGrpRp(cBgS_LinChk* i_linchk, int i_grp_idx, int depth) {
chk = true;
}
s32 child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF)
break;
@@ -655,7 +655,7 @@ bool cBgW::GroundCrossGrpRp(cBgS_GndChk* i_gndchk, int i_grp_idx, int i_depth) {
chk = true;
}
s32 child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_grp_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF)
break;
@@ -772,7 +772,7 @@ void cBgW::ShdwDrawGrpRp(cBgS_ShdwDraw* i_shdw, int i_idx) {
ShdwDrawRp(i_shdw, pm_bgd->m_g_tbl[i_idx].m_tree_idx);
}
s32 child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -806,7 +806,7 @@ bool cBgW::ChkGrpThrough(int param_0, cBgS_GrpPassChk* param_1, int param_2) {
}
/* 8007B0E4-8007B164 075A24 0080+00 2/0 1/0 0/0 .text GetGrpRoomIndex__4cBgWCFRC13cBgS_PolyInfo */
s32 cBgW::GetGrpRoomIndex(cBgS_PolyInfo const& poly) const {
int cBgW::GetGrpRoomIndex(cBgS_PolyInfo const& poly) const {
int grp_index = GetTriGrp(poly.GetPolyIndex());
u16 parent_idx = pm_bgd->m_g_tbl[grp_index].m_parent;
@@ -888,12 +888,12 @@ u32 cBgW::GetMaskPolyInf0_NoShift(int poly_index, u32 mask) const {
/* 8007B3AC-8007B3D8 075CEC 002C+00 1/0 1/0 0/0 .text GetExitId__4dBgWFRC13cBgS_PolyInfo
*/
s32 dBgW::GetExitId(cBgS_PolyInfo const& poly) {
int dBgW::GetExitId(cBgS_PolyInfo const& poly) {
return GetPolyInf0(poly.GetPolyIndex(), 0x3F, 0);
}
/* 8007B3D8-8007B404 075D18 002C+00 1/0 1/0 0/0 .text GetPolyColor__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetPolyColor(cBgS_PolyInfo const& poly) {
int dBgW::GetPolyColor(cBgS_PolyInfo const& poly) {
return GetPolyInf0(poly.GetPolyIndex(), 0x3FC0, 6);
}
@@ -986,7 +986,7 @@ int dBgW::GetLinkNo(cBgS_PolyInfo const& poly) {
}
/* 8007B6D8-8007B704 076018 002C+00 1/0 1/0 0/0 .text GetWallCode__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetWallCode(cBgS_PolyInfo const& poly) {
int dBgW::GetWallCode(cBgS_PolyInfo const& poly) {
return GetPolyInf1(poly.GetPolyIndex(), 0xF00, 8);
}
@@ -1029,22 +1029,22 @@ u32 cBgW::GetPolyInf2(int poly_index, u32 mask, u32 shift) const {
}
/* 8007B87C-8007B8A8 0761BC 002C+00 1/0 1/0 0/0 .text GetCamMoveBG__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetCamMoveBG(cBgS_PolyInfo const& poly) {
int dBgW::GetCamMoveBG(cBgS_PolyInfo const& poly) {
return GetPolyInf2(poly.GetPolyIndex(), 0xFF, 0);
}
/* 8007B8A8-8007B8D8 0761E8 0030+00 1/0 1/0 0/0 .text GetRoomCamId__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetRoomCamId(cBgS_PolyInfo const& poly) {
int dBgW::GetRoomCamId(cBgS_PolyInfo const& poly) {
return GetPolyInf2(poly.GetPolyIndex(), 0xFF00, 8);
}
/* 8007B8D8-8007B904 076218 002C+00 1/0 1/0 0/0 .text GetRoomPathId__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetRoomPathId(cBgS_PolyInfo const& poly) {
int dBgW::GetRoomPathId(cBgS_PolyInfo const& poly) {
return GetPolyInf2(poly.GetPolyIndex(), 0xFF0000, 16);
}
/* 8007B904-8007B930 076244 002C+00 1/0 1/0 0/0 .text GetRoomPathPntNo__4dBgWFRC13cBgS_PolyInfo */
s32 dBgW::GetRoomPathPntNo(cBgS_PolyInfo const& poly) {
int dBgW::GetRoomPathPntNo(cBgS_PolyInfo const& poly) {
return GetPolyInf2(poly.GetPolyIndex(), 0xFF000000, 24);
}
@@ -1369,7 +1369,7 @@ bool dBgW::WallCorrectGrpRp(dBgS_Acch* i_acch, int i_idx, int i_depth) {
chk = true;
}
s32 child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -1527,7 +1527,7 @@ bool dBgW::WallCorrectGrpRpSort(dBgS_Acch* i_acch, int i_idx, int i_depth) {
WallCorrectRpSort(i_acch, pm_bgd->m_g_tbl[i_idx].m_tree_idx);
}
s32 child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -1832,7 +1832,7 @@ bool dBgW::RoofChkGrpRp(dBgS_RoofChk* i_roofchk, int i_idx, int i_depth) {
chk = true;
}
s32 child_idx = data->m_first_child;
int child_idx = data->m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -1929,7 +1929,7 @@ bool dBgW::SplGrpChkGrpRp(dBgS_SplGrpChk* i_splchk, int i_idx, int i_depth) {
chk = true;
}
s32 child_idx = data->m_first_child;
int child_idx = data->m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -2008,7 +2008,7 @@ void dBgW::CaptPolyGrpRp(dBgS_CaptPoly& i_captpoly, int i_idx, int i_depth) {
CaptPolyRp(i_captpoly, pm_bgd->m_g_tbl[i_idx].m_tree_idx);
}
s32 child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
int child_idx = pm_bgd->m_g_tbl[i_idx].m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
@@ -2112,7 +2112,7 @@ bool dBgW::SphChkGrpRp(dBgS_SphChk* i_sphchk, void* i_data, int i_idx, int i_dep
chk = true;
}
s32 child_idx = data->m_first_child;
int child_idx = data->m_first_child;
while (true) {
if (child_idx == 0xFFFF) {
break;
+202 -208
View File
File diff suppressed because it is too large Load Diff