various d_bg debug cleanup / d_menu_window_HIO debug (#3132)

* various d_bg debug cleanup

* matching forward decl for compiler compatibility

* fix build
This commit is contained in:
TakaRikka
2026-03-17 03:44:11 -07:00
committed by GitHub
parent eb9dc59d5b
commit 3aec45d6d7
30 changed files with 3749 additions and 1292 deletions
+3 -2
View File
@@ -20,7 +20,8 @@ static void ride_call_back(dBgW* i_bgw, fopAc_ac_c* i_bgActor, fopAc_ac_c* i_rid
obj_brg_class* a_this = (obj_brg_class*)i_bgActor;
cXyz sp74 = a_this->mBr[0].field_0x0bc - i_rideActor->current.pos;
int var_r27 = JMAFastSqrt(sp74.x * sp74.x + sp74.z * sp74.z) / (a_this->field_0xaedc * 51.0f) - -0.5f;
f32 var_f28 = JMAFastSqrt(sp74.x * sp74.x + sp74.z * sp74.z);
int var_r27 = var_f28 / (a_this->field_0xaedc * 51.0f) - -0.5f;
if (var_r27 > a_this->field_0xb1ea - 1) {
var_r27 = a_this->field_0xb1ea - 1;
@@ -37,7 +38,7 @@ static void ride_call_back(dBgW* i_bgw, fopAc_ac_c* i_bgActor, fopAc_ac_c* i_rid
if (a_this->mType & 5) {
var_f30 = 0.85f;
} else if (a_this->field_0xb1ed == 2) {
var_f30 = KREG_F(7) + 0.1f;
var_f30 = KREG_F(4) + 0.1f;
} else {
var_f30 = 1.0f;
}
+4 -1
View File
@@ -380,7 +380,10 @@ int Act_c::Draw() {
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mModel);
dComIfGd_setList();
dComIfG_Bgsp().DebugDrawPoly(mpBgW);
#if DEBUG
dComIfG_Bgsp().DebugDrawPoly(*mpBgW);
#endif
return 1;
}
+1 -1
View File
@@ -240,7 +240,7 @@ cPhs_Step daObjSwpush::Act_c::Mthd_Create() {
mDoMtx_stack_c::scaleM(field_0x5f8);
MTXCopy(mDoMtx_stack_c::get(), mMtx);
mpBgW->ClrNoCalcVtx();
mpBgW->SetBaseMtxP(mMtx);
mpBgW->SetBaseMtxP(&mMtx);
mpBgW->GlobalVtx();
mpBgW->SetBaseMtxP(NULL);
mpBgW->SetNoCalcVtx();
+1117 -352
View File
File diff suppressed because it is too large Load Diff
+176 -135
View File
@@ -11,6 +11,10 @@
#include "d/d_com_inf_game.h"
#include "global.h"
#if DEBUG
#include "d/d_debug_viewer.h"
#endif
dBgS_AcchCir::dBgS_AcchCir() {
m_flags = 0;
m_wall_rr = 0.0f;
@@ -22,26 +26,26 @@ dBgS_AcchCir::dBgS_AcchCir() {
}
void dBgS_AcchCir::ClrWallHit() {
m_flags &= ~WALL_HIT;
m_flags &= ~FLAG_WALL_HIT;
ClearPi();
}
void dBgS_AcchCir::SetWallR(f32 i_wall_r) {
m_wall_r = i_wall_r;
void dBgS_AcchCir::SetWallR(f32 wall_r) {
m_wall_r = wall_r;
}
void dBgS_AcchCir::CalcWallRR() {
m_wall_rr = m_wall_r * m_wall_r;
}
void dBgS_AcchCir::SetWall(f32 i_wall_h, f32 i_wall_r) {
SetWallH(i_wall_h);
SetWallR(i_wall_r);
void dBgS_AcchCir::SetWall(f32 wall_h, f32 wall_r) {
SetWallH(wall_h);
SetWallR(wall_r);
}
void dBgS_AcchCir::SetWallHDirect(f32 i_h_direct) {
void dBgS_AcchCir::SetWallHDirect(f32 h_direct) {
m_flags |= WALL_H_DIRECT;
m_wall_h_direct = i_h_direct;
m_wall_h_direct = h_direct;
}
dBgS_Acch::~dBgS_Acch() {}
@@ -89,40 +93,43 @@ void dBgS_Acch::Init() {
}
}
void dBgS_Acch::Set(cXyz* i_pos, cXyz* i_old_pos, fopAc_ac_c* i_actor, int i_tbl_size,
dBgS_AcchCir* i_acchcir, cXyz* i_speed, csXyz* i_angle, csXyz* i_shape_angle) {
pm_pos = i_pos;
pm_old_pos = i_old_pos;
void dBgS_Acch::Set(cXyz* ppos, cXyz* pold_pos, fopAc_ac_c* pactor, int tbl_size,
dBgS_AcchCir* pacchcir, cXyz* pspeed, csXyz* pangle, csXyz* pshape_angle) {
pm_pos = ppos;
pm_old_pos = pold_pos;
JUT_ASSERT(246, pm_pos != NULL);
JUT_ASSERT(247, pm_old_pos != NULL);
m_my_ac = i_actor;
fpc_ProcID id = fopAcM_GetID(i_actor);
m_my_ac = pactor;
fpc_ProcID id = fopAcM_GetID(pactor);
SetActorPid(id);
pm_speed = i_speed;
m_tbl_size = i_tbl_size;
pm_acch_cir = i_acchcir;
pm_angle = i_angle;
pm_shape_angle = i_shape_angle;
pm_speed = pspeed;
m_tbl_size = tbl_size;
pm_acch_cir = pacchcir;
pm_angle = pangle;
pm_shape_angle = pshape_angle;
}
void dBgS_Acch::Set(fopAc_ac_c* i_actor, int i_tbl_size, dBgS_AcchCir* i_acchcir) {
m_tbl_size = i_tbl_size;
pm_acch_cir = i_acchcir;
m_my_ac = i_actor;
void dBgS_Acch::Set(fopAc_ac_c* pactor, int tbl_size, dBgS_AcchCir* pacchcir) {
m_tbl_size = tbl_size;
pm_acch_cir = pacchcir;
m_my_ac = pactor;
SetActorPid(fopAcM_GetID(i_actor));
pm_pos = fopAcM_GetPosition_p(i_actor);
pm_old_pos = fopAcM_GetOldPosition_p(i_actor);
pm_speed = fopAcM_GetSpeed_p(i_actor);
pm_angle = fopAcM_GetAngle_p(i_actor);
pm_shape_angle = fopAcM_GetShapeAngle_p(i_actor);
SetActorPid(fopAcM_GetID(pactor));
pm_pos = fopAcM_GetPosition_p(pactor);
pm_old_pos = fopAcM_GetOldPosition_p(pactor);
pm_speed = fopAcM_GetSpeed_p(pactor);
pm_angle = fopAcM_GetAngle_p(pactor);
pm_shape_angle = fopAcM_GetShapeAngle_p(pactor);
}
void dBgS_Acch::GroundCheckInit(dBgS& i_bgs) {
UNUSED(i_bgs);
if (!(m_flags & 2)) {
void dBgS_Acch::GroundCheckInit(dBgS& bgs) {
UNUSED(bgs);
if (!(m_flags & FLAG_GRND_NONE)) {
m_ground_h = -G_CM3D_F_INF;
m_gnd.SetExtChk(*this);
field_0xb4 = ChkGroundHit();
@@ -132,8 +139,8 @@ void dBgS_Acch::GroundCheckInit(dBgS& i_bgs) {
}
}
void dBgS_Acch::GroundCheck(dBgS& i_bgs) {
if (!(m_flags & GRND_NONE)) {
void dBgS_Acch::GroundCheck(dBgS& bgs) {
if (!(m_flags & FLAG_GRND_NONE)) {
cXyz grnd_pos;
grnd_pos = *pm_pos;
grnd_pos.y += field_0x94 + (m_gnd_chk_offset - field_0x90);
@@ -143,15 +150,15 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) {
tmpRoofChk.SetActorPid(m_gnd.GetActorPid());
tmpRoofChk.SetPos(*pm_pos);
f32 roof_chk = i_bgs.RoofChk(&tmpRoofChk);
if (grnd_pos.y > roof_chk) {
grnd_pos.y = roof_chk;
f32 roof_y = bgs.RoofChk(&tmpRoofChk);
if (grnd_pos.y > roof_y) {
grnd_pos.y = roof_y;
}
}
field_0x94 = 0.0f;
m_gnd.SetPos(&grnd_pos);
m_ground_h = i_bgs.GroundCross(&m_gnd);
m_ground_h = bgs.GroundCross(&m_gnd);
if (m_ground_h != -G_CM3D_F_INF) {
field_0xbc = m_ground_h + field_0x90;
@@ -162,13 +169,13 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) {
pm_speed->y = 0.0f;
}
i_bgs.GetTriPla(m_gnd, &field_0xa0);
bgs.GetTriPla(m_gnd, &field_0xa0);
SetGroundFind();
SetGroundHit();
if (field_0xc0 == 0) {
field_0xc0 = 1;
i_bgs.RideCallBack(m_gnd, m_my_ac);
bgs.RideCallBack(m_gnd, m_my_ac);
}
if (field_0xb4 == 0) {
@@ -183,28 +190,28 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) {
}
}
void dBgS_Acch::GroundRoofProc(dBgS& i_bgs) {
void dBgS_Acch::GroundRoofProc(dBgS& bgs) {
if (m_ground_h != -G_CM3D_F_INF) {
if (field_0xbc < field_0xcc && field_0xcc < pm_pos->y) {
pm_pos->y = field_0xcc;
}
if (!(m_flags & ROOF_NONE) && m_ground_h >= m_roof_height) {
if (!(m_flags & FLAG_ROOF_NONE) && m_ground_h >= m_roof_height) {
m_roof.SetExtChk(*this);
ClrRoofHit();
cXyz roof_pos(*pm_pos);
m_roof.SetPos(roof_pos);
m_roof_height = i_bgs.RoofChk(&m_roof);
m_roof_height = bgs.RoofChk(&m_roof);
}
}
}
void dBgS_Acch::LineCheck(dBgS& i_bgs) {
void dBgS_Acch::LineCheck(dBgS& bgs) {
dBgS_RoofChk roof_chk;
roof_chk.SetActorPid(m_gnd.GetActorPid());
roof_chk.SetPos(*GetOldPos());
f32 temp_f31 = dComIfG_Bgsp().RoofChk(&roof_chk);
f32 roof_y = dComIfG_Bgsp().RoofChk(&roof_chk);
f32 var_f30 = G_CM3D_F_INF;
bool var_r30 = false;
@@ -218,22 +225,22 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
old_pos = *GetOldPos();
pos = *GetPos();
f32 var_f2 = GetWallH(i);
if (temp_f31 < old_pos.y + var_f2) {
f32 wall_h = GetWallH(i);
if (roof_y < old_pos.y + wall_h) {
if (var_r29) {
continue;
} else {
var_f2 = (temp_f31 - old_pos.y) - 1.0f;
wall_h = (roof_y - old_pos.y) - 1.0f;
var_r29 = true;
}
}
if (var_f30 > var_f2) {
var_f30 = var_f2;
if (var_f30 > wall_h) {
var_f30 = wall_h;
}
old_pos.y += var_f2;
pos.y += var_f2;
old_pos.y += wall_h;
pos.y += wall_h;
if (GetSpeedY() < 0.0f) {
if (m_my_ac != NULL && fopAcM_GetName(m_my_ac) == fpcNm_ALINK_e &&
@@ -246,7 +253,7 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
lin_chk.Set2(&old_pos, &pos, GetActorPid());
lin_chk.SetExtChk(*this);
if (i_bgs.LineCross(&lin_chk)) {
if (bgs.LineCross(&lin_chk)) {
*GetPos() = lin_chk.GetCross();
OnLineCheckHit();
@@ -254,10 +261,10 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
*pm_out_poly_info = lin_chk;
cM3dGPla plane;
i_bgs.GetTriPla(lin_chk, &plane);
bgs.GetTriPla(lin_chk, &plane);
if (!cBgW_CheckBGround(plane.mNormal.y)) {
PSVECAdd(GetPos(), &plane.mNormal, GetPos());
f32 var_f28 = JMAFastSqrt(plane.mNormal.x * plane.mNormal.x + plane.mNormal.z * plane.mNormal.z);
f32 var_f28 = JMAFastSqrt(SQUARE(plane.mNormal.x) + SQUARE(plane.mNormal.z));
if (!cM3d_IsZero(var_f28)) {
pm_acch_cir[i].SetWallHDirect(GetPos()->y);
}
@@ -265,7 +272,7 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
GetPos()->y -= GetWallH(i);
} else {
GetPos()->y -= 1.0f;
GroundCheck(i_bgs);
GroundCheck(bgs);
var_r30 = true;
}
}
@@ -273,7 +280,6 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
if (ChkLineDown()) {
f32 temp_f1 = GetOldPos()->y - GetPos()->y;
if (var_f30 != G_CM3D_F_INF && !var_r30 && !cM3d_IsZero(temp_f1)) {
cBgS_LinChk lin_chk;
cXyz old_pos;
@@ -287,7 +293,7 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
lin_chk.Set2(&old_pos, &pos, GetActorPid());
lin_chk.SetExtChk(*this);
if (i_bgs.LineCross(&lin_chk)) {
if (bgs.LineCross(&lin_chk)) {
*GetPos() = lin_chk.GetCross();
OnLineCheckHit();
@@ -295,13 +301,13 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) {
*pm_out_poly_info = lin_chk;
GetPos()->y -= 1.0f;
GroundCheck(i_bgs);
GroundCheck(bgs);
}
}
}
}
void dBgS_Acch::CrrPos(dBgS& i_bgs) {
void dBgS_Acch::CrrPos(dBgS& bgs) {
bool bvar9;
if (!(m_flags & 1)) {
JUT_ASSERT(792, pm_pos != NULL);
@@ -316,7 +322,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
JUT_ASSERT(839, pm_pos->y < 1.0e32f);
JUT_ASSERT(840, -1.0e32f < pm_pos->z && pm_pos->z < 1.0e32f);
i_bgs.MoveBgCrrPos(m_gnd, ChkGroundHit(), pm_pos, pm_angle, pm_shape_angle, false, false);
bgs.MoveBgCrrPos(m_gnd, ChkGroundHit(), pm_pos, pm_angle, pm_shape_angle, false, false);
if (!ChkGroundHit()) {
bvar9 = false;
@@ -324,7 +330,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
if (ChkWallHit()) {
for (int i = 0; i < m_tbl_size; i++) {
if (pm_acch_cir[i].ChkWallHit()) {
i_bgs.MoveBgCrrPos(pm_acch_cir[i], true, pm_pos, pm_angle, pm_shape_angle,
bgs.MoveBgCrrPos(pm_acch_cir[i], true, pm_pos, pm_angle, pm_shape_angle,
true, false);
bvar9 = true;
break;
@@ -333,89 +339,86 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
}
if (!bvar9 && ChkRoofHit()) {
i_bgs.MoveBgCrrPos(m_roof, true, pm_pos, pm_angle, pm_shape_angle, false, true);
bgs.MoveBgCrrPos(m_roof, true, pm_pos, pm_angle, pm_shape_angle, false, true);
}
}
GroundCheckInit(i_bgs);
GroundCheckInit(bgs);
Init();
f32 tmp = GetWallAllLowH_R();
f32 dvar10 = GetOldPos()->abs2XZ(*GetPos());
f32 dvar11 = GetOldPos()->y - GetPos()->y;
f32 tmp2 = GetWallAllLowH();
f32 wall_all_low_h_r = GetWallAllLowH_R();
f32 old_pos_dist2XZ = GetOldPos()->abs2XZ(*GetPos());
f32 old_pos_dist_y = GetOldPos()->y - GetPos()->y;
f32 wall_all_low_h = GetWallAllLowH();
field_0xb8 = GetPos()->y;
field_0xc0 = 0;
f32 fvar12 = tmp2 + GetOldPos()->y;
f32 fvar12 = wall_all_low_h + GetOldPos()->y;
f32 fvar1 = m_gnd_chk_offset + GetPos()->y;
bool bvar2 = false;
OffLineCheckHit();
if (!ChkLineCheckNone() && !cM3d_IsZero(tmp) &&
(dvar10 > (tmp * tmp) || fvar12 > fvar1 || dvar11 > m_gnd_chk_offset || ChkLineCheck()))
if (!ChkLineCheckNone() && !cM3d_IsZero(wall_all_low_h_r) &&
(old_pos_dist2XZ > SQUARE(wall_all_low_h_r) || fvar12 > fvar1 || old_pos_dist_y > m_gnd_chk_offset || ChkLineCheck()))
{
bvar2 = true;
LineCheck(i_bgs);
LineCheck(bgs);
}
if (!(m_flags & WALL_NONE)) {
if (!(m_flags & FLAG_WALL_NONE)) {
if (ChkWallSort()) {
i_bgs.WallCorrectSort(this);
bgs.WallCorrectSort(this);
} else {
i_bgs.WallCorrect(this);
bgs.WallCorrect(this);
}
}
if (ChkWallHit() && bvar2) {
LineCheck(i_bgs);
LineCheck(bgs);
}
field_0xcc = G_CM3D_F_INF;
if (!(m_flags & ROOF_NONE)) {
if (!(m_flags & FLAG_ROOF_NONE)) {
m_roof.SetExtChk(*this);
ClrRoofHit();
cXyz roof_pos;
roof_pos.x = pm_pos->x;
roof_pos.y = pm_pos->y;
roof_pos.z = pm_pos->z;
cXyz roof_pos(*pm_pos);
m_roof.SetPos(roof_pos);
m_roof_height = i_bgs.RoofChk(&m_roof);
m_roof_height = bgs.RoofChk(&m_roof);
if (m_roof_height != G_CM3D_F_INF) {
f32 y = pm_pos->y;
if (y + m_roof_crr_height > m_roof_height) {
if (pm_pos->y + m_roof_crr_height > m_roof_height) {
field_0xcc = m_roof_height - m_roof_crr_height;
SetRoofHit();
}
}
}
if (!(m_flags & GRND_NONE)) {
if (!(m_flags & FLAG_GRND_NONE)) {
ClrGroundFind();
GroundCheck(i_bgs);
GroundRoofProc(i_bgs);
GroundCheck(bgs);
GroundRoofProc(bgs);
} else {
if (field_0xcc < pm_pos->y) {
pm_pos->y = field_0xcc;
}
}
if (!(m_flags & 0x400)) {
if (!(m_flags & FLAG_WATER_NONE)) {
ClrWaterHit();
ClrWaterIn();
m_wtr.SetHeight(-G_CM3D_F_INF);
bool spD = false;
f32 var_f29;
f32 top;
f32 temp_f1_5 = m_ground_h;
if (temp_f1_5 == -G_CM3D_F_INF) {
if (m_ground_h == -G_CM3D_F_INF) {
var_f29 = pm_pos->y - 50.0f;
spD = true;
} else {
var_f29 = temp_f1_5;
var_f29 = m_ground_h;
}
if (m_wtr_mode == 1) {
@@ -425,7 +428,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
roof_chk.SetUnderwaterRoof();
roof_chk.SetPos(*pm_pos);
top = i_bgs.RoofChk(&roof_chk);
top = bgs.RoofChk(&roof_chk);
if (top == G_CM3D_F_INF) {
top = pm_pos->y + 1000000.0f;
}
@@ -438,7 +441,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
m_wtr.Set(ground, top);
m_wtr.SetPassChkInfo(*this);
if (i_bgs.WaterChk(&m_wtr)) {
if (bgs.WaterChk(&m_wtr)) {
SetWaterHit();
if (m_wtr.GetHeight() > pm_pos->y) {
SetWaterIn();
@@ -460,15 +463,15 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
}
f32 dBgS_Acch::GetWallAllR() {
f32 ret = 0.0f;
f32 rt = 0.0f;
for (int i = 0; i < m_tbl_size; i++) {
f32 wall_r = pm_acch_cir[i].GetWallR();
if (ret < wall_r) {
ret = wall_r;
if (rt < pm_acch_cir[i].GetWallR()) {
rt = pm_acch_cir[i].GetWallR();
}
}
return ret;
return rt;
}
void dBgS_Acch::SetWallCir() {
@@ -481,31 +484,26 @@ void dBgS_Acch::CalcWallBmdCyl() {
if (m_tbl_size <= 0) {
m_wall_cyl.Set(*pm_pos, 0.0f, 0.0f);
} else {
f32 dvar8 = GetWallAllR();
f32 dvar9 = pm_acch_cir->GetWallH();
f32 dvar10 = pm_acch_cir->GetWallH();
f32 wall_all_r = GetWallAllR();
f32 wall_h_max = pm_acch_cir->GetWallH();
f32 wall_h_min = pm_acch_cir->GetWallH();
if (m_tbl_size >= 1) {
for (int i = 0; i < m_tbl_size; i++) {
f32 tmp = pm_acch_cir[i].GetWallH();
if (dvar9 > tmp) {
dvar9 = pm_acch_cir[i].GetWallH();
if (wall_h_max > pm_acch_cir[i].GetWallH()) {
wall_h_max = pm_acch_cir[i].GetWallH();
}
f32 tmp2 = pm_acch_cir[i].GetWallH();
if (dvar10 < tmp2) {
dvar10 = pm_acch_cir[i].GetWallH();
if (wall_h_min < pm_acch_cir[i].GetWallH()) {
wall_h_min = pm_acch_cir[i].GetWallH();
}
}
}
cXyz xyz;
xyz.x = pm_pos->x;
xyz.y = pm_pos->y;
xyz.z = pm_pos->z;
xyz.y += dvar9;
cXyz xyz(*pm_pos);
xyz.y += wall_h_max;
m_wall_cyl.Set(xyz, dvar8, dvar10 - dvar9);
m_wall_cyl.Set(xyz, wall_all_r, wall_h_min - wall_h_max);
}
}
@@ -519,15 +517,14 @@ f32 dBgS_Acch::GetWallAllLowH() {
return 0.0f;
}
f32 tmp = pm_acch_cir->GetWallH();
f32 wall_low_h = pm_acch_cir->GetWallH();
for (int i = 1; i < m_tbl_size; i++) {
f32 tmp2 = pm_acch_cir[i].GetWallH();
if (tmp > tmp2) {
tmp = pm_acch_cir[i].GetWallH();
if (wall_low_h > pm_acch_cir[i].GetWallH()) {
wall_low_h = pm_acch_cir[i].GetWallH();
}
}
return tmp;
return wall_low_h;
}
f32 dBgS_Acch::GetWallAllLowH_R() {
@@ -536,11 +533,10 @@ f32 dBgS_Acch::GetWallAllLowH_R() {
}
int index = 0;
f32 tmp = pm_acch_cir->GetWallH();
f32 wall_h = pm_acch_cir->GetWallH();
for (int i = 1; i < m_tbl_size; i++) {
f32 tmp2 = pm_acch_cir[i].GetWallH();
if (tmp > tmp2) {
tmp = pm_acch_cir[i].GetWallH();
if (wall_h > pm_acch_cir[i].GetWallH()) {
wall_h = pm_acch_cir[i].GetWallH();
index = i;
}
}
@@ -556,6 +552,49 @@ f32 dBgS_Acch::GetSpeedY() {
return 0.0f;
}
#if DEBUG
static GXColor blue = {0, 0, 0xFF, 0x80};
static GXColor red = {0xFF, 0, 0, 0x80};
void dBgS_Acch::DrawWall(dBgS& bgs) {
if (bgs.m_hio.ChkAcchDrawWall()) {
if (!(m_flags & FLAG_WALL_NONE)) {
for (int i = 0; i < m_tbl_size; i++) {
cM3dGCir cir;
cir = *pm_acch_cir[i].GetCirP();
cXyz pos;
pos.x = cir.GetCx();
pos.y = cir.GetHeight();
pos.z = cir.GetCy();
f32 radius = cir.GetR();
dDbVw_drawCylinderXlu(pos, radius, 3.0f, blue, TRUE);
if (pm_acch_cir[i].ChkWallHit()) {
bgs.DrawPoly(pm_acch_cir[i], blue);
}
}
} else {
SetWallCir();
for (int i = 0; i < m_tbl_size; i++) {
cM3dGCir cir;
cir = *pm_acch_cir[i].GetCirP();
cXyz pos;
pos.x = cir.GetCx();
pos.y = cir.GetHeight();
pos.z = cir.GetCy();
f32 radius = cir.GetR();
dDbVw_drawCylinderXlu(pos, radius, 3.0f, red, TRUE);
}
}
}
}
#endif
f32 dBgS_Acch::GetWallAddY(Vec& param_0) {
if (!ChkGroundFind() || field_0xa0.mNormal.y < 0.5f) {
return 0.0f;
@@ -572,15 +611,17 @@ f32 dBgS_Acch::GetWallAddY(Vec& param_0) {
return 0.0f;
}
void dBgS_Acch::SetNowActorInfo(int bg_index, void* param_1, fpc_ProcID param_2) {
void dBgS_Acch::SetNowActorInfo(int bg_index, void* param_1, fpc_ProcID proc_id) {
m_bg_index = bg_index;
field_0x7c = param_1;
field_0x80 = param_2;
field_0x80 = proc_id;
}
void dBgS_Acch::SetWallPolyIndex(int index, int poly_index) {
JUT_ASSERT(1534, index <= m_tbl_size);
pm_acch_cir[index].SetActorInfo(m_bg_index, field_0x7c, field_0x80);
pm_acch_cir[index].SetPolyIndex(poly_index);
pm_acch_cir[index].SetWallPolyIndex(poly_index);
}
void dBgS_Acch::CalcMovePosWork() {
@@ -596,35 +637,35 @@ void dBgS_Acch::CalcWallRR() {
}
void dBgS_Acch::SetMoveBGOnly() {
m_flags |= MOVE_BG_ONLY;
m_flags |= FLAG_MOVE_BG_ONLY;
m_wtr.OnMoveBGOnly();
}
void dBgS_Acch::ClrMoveBGOnly() {
m_flags &= ~MOVE_BG_ONLY;
m_flags &= ~FLAG_MOVE_BG_ONLY;
m_wtr.OffMoveBGOnly();
}
void dBgS_Acch::SetGndThinCellingOff() {
m_flags |= GND_THIN_CELLING_OFF;
m_flags |= FLAG_GND_THIN_CELLING_OFF;
}
void dBgS_Acch::ClrGndThinCellingOff() {
m_flags &= ~GND_THIN_CELLING_OFF;
m_flags &= ~FLAG_GND_THIN_CELLING_OFF;
}
bool dBgS_Acch::ChkGndThinCellingOff() {
return m_flags & GND_THIN_CELLING_OFF;
return m_flags & FLAG_GND_THIN_CELLING_OFF;
}
void dBgS_Acch::OnWallSort() {
m_flags |= WALL_SORT;
m_flags |= FLAG_WALL_SORT;
}
bool dBgS_Acch::ChkWallSort() {
return m_flags & WALL_SORT;
return m_flags & FLAG_WALL_SORT;
}
bool dBgS_Acch::ChkLineDown() {
return m_flags & LINE_DOWN;
return m_flags & FLAG_LINE_DOWN;
}
+2 -2
View File
@@ -7,11 +7,11 @@
dBgS_CaptPoly::dBgS_CaptPoly() {
SetPolyPassChk(GetPolyPassChkInfo());
SetGrpPassChk(GetGrpPassChkInfo());
field_0x48 = 0;
m_callback = NULL;
}
void dBgS_CaptPoly::Set(cXyz& min, cXyz& max) {
aab.Set(&min, &max);
m_bnd.Set(&min, &max);
JUT_ASSERT(36, !(fpclassify(min.x) == FP_QNAN));
JUT_ASSERT(37, !(fpclassify(min.y) == FP_QNAN));
+19 -5
View File
@@ -14,8 +14,9 @@ dBgS_MoveBgActor::dBgS_MoveBgActor() {
mpBgW = NULL;
}
static int CheckCreateHeap(fopAc_ac_c* p_actor) {
return static_cast<dBgS_MoveBgActor*>(p_actor)->MoveBGCreateHeap();
static int CheckCreateHeap(fopAc_ac_c* actor) {
dBgS_MoveBgActor* i_this = (dBgS_MoveBgActor*)actor;
return i_this->MoveBGCreateHeap();
}
int dBgS_MoveBgActor::CreateHeap() {
@@ -68,8 +69,7 @@ int dBgS_MoveBgActor::MoveBGCreateHeap() {
mpBgW = new dBgW();
if (mpBgW != NULL) {
cBgD_t* res = (cBgD_t*)dComIfG_getObjectRes(m_name, m_dzb_id);
if (!mpBgW->Set(res, cBgW::MOVE_BG_e, &mBgMtx)) {
if (!mpBgW->Set((cBgD_t*)dComIfG_getObjectRes(m_name, m_dzb_id), cBgW::MOVE_BG_e, &mBgMtx)) {
if (m_set_func != NULL) {
mpBgW->SetCrrFunc(m_set_func);
}
@@ -87,6 +87,8 @@ int dBgS_MoveBgActor::MoveBGCreateHeap() {
int dBgS_MoveBgActor::MoveBGCreate(char const* i_arcName, int i_dzb_id,
MoveBGActor_SetFunc i_setFunc, u32 i_heapSize, Mtx* i_bgMtx) {
bool var_r28 = true;
if (i_bgMtx == NULL) {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::YrotM(shape_angle.y);
@@ -104,6 +106,15 @@ int dBgS_MoveBgActor::MoveBGCreate(char const* i_arcName, int i_dzb_id,
return cPhs_ERROR_e;
}
#if DEBUG
if (mpBgW != NULL && mpBgW->ChkUsed()) {
BOOL isDebugPad = mDoCPd_c::isConnect(PAD_3);
if (isDebugPad) {
JUT_WARN(185, "%s", "dBgS_MoveBgActor::MoveBGCreate() Don't Regist CreateHeap\n");
}
}
#endif
if (mpBgW != NULL && dComIfG_Bgsp().Regist(mpBgW, this)) {
return cPhs_ERROR_e;
}
@@ -116,7 +127,10 @@ int dBgS_MoveBgActor::MoveBGDelete() {
int ret = Delete();
if (mpBgW != NULL && mpBgW->ChkUsed()) {
dComIfG_Bgsp().Release(mpBgW);
bool rt = dComIfG_Bgsp().Release(mpBgW);
if (rt != 0) {
OS_REPORT("Release Error\n");
}
}
return ret;
}
+4 -1
View File
@@ -84,7 +84,10 @@ bool dBgS_PolyPassChk::ChkNoHorse() {
return true;
}
return !ChkHorse();
if (!ChkHorse())
return true;
return false;
}
void dBgS_PolyPassChk::SetStatue() {
+11
View File
@@ -10,6 +10,17 @@
void dBgS_SplGrpChk::Set(cXyz& ground, f32 roof) {
m_ground = ground;
m_roof = roof;
JUT_ASSERT(23, !isnan(m_ground.x));
JUT_ASSERT(24, !isnan(m_ground.y));
JUT_ASSERT(25, !isnan(m_ground.z));
JUT_ASSERT(29, -INF < m_ground.x && m_ground.x < INF);
JUT_ASSERT(30, -INF < m_ground.y && m_ground.y < INF);
JUT_ASSERT(31, -INF < m_ground.z && m_ground.z < INF);
JUT_ASSERT(33, !isnan(m_roof));
JUT_ASSERT(34, -INF < m_roof && m_roof < INF);
}
dBgS_SplGrpChk::dBgS_SplGrpChk() {
+825 -490
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -3,7 +3,7 @@
#include "d/d_bg_w_kcol.h"
#include "d/d_com_inf_game.h"
#include "d/actor/d_a_horse.h"
#include "d/d_bg_s_cap_poly.h"
#include "d/d_bg_s_capt_poly.h"
#include <algorithm>
#include <cmath>
@@ -979,7 +979,7 @@ void dBgWKCol::CaptPoly(dBgS_CaptPoly& i_captpoly) {
cM3dGPla plane;
plane = GetTriPla(r28[0]);
i_captpoly.m_callback(i_captpoly, (cBgD_Vtx_t*)&vtx_tbl, 0, 1, 2, &plane);
i_captpoly.m_callback(&i_captpoly, (cBgD_Vtx_t*)&vtx_tbl, 0, 1, 2, &plane);
}
}
}
File diff suppressed because it is too large Load Diff