diff --git a/configure.py b/configure.py index 67a0e63a5..954cfad85 100755 --- a/configure.py +++ b/configure.py @@ -495,14 +495,14 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_att_dist.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_acch.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_func.cpp"), + Object(Matching, "d/d_bg_s_func.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_lin_chk.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_movebg_actor.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_spl_grp_chk.cpp"), + Object(Matching, "d/d_bg_s_spl_grp_chk.cpp"), Object(Matching, "d/d_bg_s_wtr_chk.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_w.cpp"), Object(Matching, "d/d_bg_w_deform.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_w_hf.cpp"), + Object(Matching, "d/d_bg_w_hf.cpp"), Object(Matching, "d/d_bg_w_sv.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_cc_d.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_cc_mass_s.cpp"), @@ -643,7 +643,7 @@ config.libs = [ Object(Matching, "SSystem/SComponent/c_xyz.cpp"), Object(Matching, "SSystem/SComponent/c_sxyz.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "SSystem/SComponent/c_math.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "SSystem/SComponent/c_bg_s.cpp"), + Object(Matching, "SSystem/SComponent/c_bg_s.cpp"), Object(Matching, "SSystem/SComponent/c_bg_s_chk.cpp"), Object(Matching, "SSystem/SComponent/c_bg_s_gnd_chk.cpp"), Object(Matching, "SSystem/SComponent/c_bg_s_lin_chk.cpp"), diff --git a/include/SSystem/SComponent/c_bg_s.h b/include/SSystem/SComponent/c_bg_s.h index 340820277..c71b33184 100644 --- a/include/SSystem/SComponent/c_bg_s.h +++ b/include/SSystem/SComponent/c_bg_s.h @@ -2,11 +2,9 @@ #define C_BG_S_H #include "SSystem/SComponent/c_bg_s_poly_info.h" +#include "SSystem/SComponent/c_m3d.h" #include "dolphin/types.h" -#define C_BG_MIN_HEIGHT (-1e+9f) -#define C_BG_MAX_HEIGHT (1e+9f) - class fopAc_ac_c; class cBgS_ShdwDraw; class cBgS_LinChk; diff --git a/include/SSystem/SComponent/c_m3d.h b/include/SSystem/SComponent/c_m3d.h index 79d1de4fd..808036fc3 100644 --- a/include/SSystem/SComponent/c_m3d.h +++ b/include/SSystem/SComponent/c_m3d.h @@ -19,6 +19,11 @@ class cXyz; struct Vec; extern const f32 G_CM3D_F_ABS_MIN; +#if VERSION == VERSION_DEMO +extern const f32 G_CM3D_F_INF; +#else +#define G_CM3D_F_INF 1e+9f +#endif extern const u32 BPCP_OUTCODE0; extern const u32 BPCP_OUTCODE1; diff --git a/include/SSystem/SComponent/c_m3d_g_aab.h b/include/SSystem/SComponent/c_m3d_g_aab.h index 8d0b0b1eb..f1e89556b 100644 --- a/include/SSystem/SComponent/c_m3d_g_aab.h +++ b/include/SSystem/SComponent/c_m3d_g_aab.h @@ -1,10 +1,9 @@ #ifndef C_M3D_G_AAB_H #define C_M3D_G_AAB_H -#include "SSystem/SComponent/c_bg_s.h" -#include "SSystem/SComponent/c_xyz.h" #include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_m3d_g_lin.h" +#include "SSystem/SComponent/c_xyz.h" #include "global.h" // Axis aligned bounding box @@ -62,8 +61,8 @@ public: mMax.x = -1000000000.0f; } void ClearForMinMaxY() { - mMin.y = C_BG_MAX_HEIGHT; - mMax.y = C_BG_MIN_HEIGHT; + mMin.y = G_CM3D_F_INF; + mMax.y = -G_CM3D_F_INF; } void SetMinMaxY(f32 y) { if (mMin.y > y) { diff --git a/include/d/d_bg_s.h b/include/d/d_bg_s.h index 3c84d252f..42680cf25 100644 --- a/include/d/d_bg_s.h +++ b/include/d/d_bg_s.h @@ -121,7 +121,7 @@ public: mWallRadius = 0.0f; pm_pos = NULL; pm_old_pos = NULL; - mGroundH = C_BG_MIN_HEIGHT; + mGroundH = -G_CM3D_F_INF; field_0x60 = 0; field_0x68 = 20.0f; field_0x58 = NULL; diff --git a/src/SSystem/SComponent/c_bg_s.cpp b/src/SSystem/SComponent/c_bg_s.cpp index 83836432a..1f3c899e3 100644 --- a/src/SSystem/SComponent/c_bg_s.cpp +++ b/src/SSystem/SComponent/c_bg_s.cpp @@ -128,7 +128,7 @@ bool cBgS::LineCross(cBgS_LinChk* chk) { /* 802468E4-80246A14 .text GroundCross__4cBgSFP11cBgS_GndChk */ f32 cBgS::GroundCross(cBgS_GndChk* chk) { - chk->SetNowY(C_BG_MIN_HEIGHT); + chk->SetNowY(-G_CM3D_F_INF); chk->ClearPi(); chk->mWallPrecheck = (chk->mFlag & 0x02); chk->mGndPrecheck = (chk->mFlag & 0x01); diff --git a/src/SSystem/SComponent/c_m3d.cpp b/src/SSystem/SComponent/c_m3d.cpp index b9736eb9b..994537c71 100644 --- a/src/SSystem/SComponent/c_m3d.cpp +++ b/src/SSystem/SComponent/c_m3d.cpp @@ -21,6 +21,9 @@ #define CHECK_PVEC3_RANGE(line, v) JUT_ASSERT(line, -1.0e32f < v->x && v->x < 1.0e32f && -1.0e32f < v->y && v->y < 1.0e32f && -1.0e32f < v->z && v->z < 1.0e32f) const f32 G_CM3D_F_ABS_MIN = 3.8146973e-06f; +#if VERSION == VERSION_DEMO +const f32 G_CM3D_F_INF = 1.0e38f; +#endif static void dummy(f32 dummy) { // to fix float literal order diff --git a/src/c/c_damagereaction.cpp b/src/c/c_damagereaction.cpp index a36f22ec4..ccf0bf55f 100644 --- a/src/c/c_damagereaction.cpp +++ b/src/c/c_damagereaction.cpp @@ -653,7 +653,7 @@ void dr_body_bg_check(damagereaction* dr) { temp.z = z; gndChk.SetPos(&temp); f32 floor_y = dComIfG_Bgsp()->GroundCross(&gndChk); - if (floor_y != C_BG_MIN_HEIGHT && dr->mpEnemy->current.pos.y <= floor_y) { + if (floor_y != -G_CM3D_F_INF && dr->mpEnemy->current.pos.y <= floor_y) { dr->mpEnemy->current.pos.y = floor_y + REG0_F(13); dr->mMode = 0; dr->m47C = 0; diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index d6b3d74e5..88e8dccf1 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -1311,7 +1311,7 @@ void daAgb_c::CursorMove(fopAc_ac_c* actor, u32 stage_type) { cXyz r1_14; dBgS_GndChk r1_5C; - f32 f30 = C_BG_MIN_HEIGHT; + f32 f30 = -G_CM3D_F_INF; r1_5C.OffWall(); r1_14.y = actor->current.pos.y + 150.0f; static cXy l_ckOffset[] = { diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index 0275a84ff..84ee4e76c 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -388,7 +388,7 @@ static BOOL Line_check(am2_class* i_this, cXyz destPos) { /* 0000177C-00001A24 .text naraku_check__FP9am2_class */ static BOOL naraku_check(am2_class* i_this) { // Checks if the Armos has fallen into an abyss. - if (i_this->mAcch.GetGroundH() != C_BG_MIN_HEIGHT && + if (i_this->mAcch.GetGroundH() != -G_CM3D_F_INF && dComIfG_Bgsp()->ChkPolySafe(i_this->mAcch.m_gnd) && dComIfG_Bgsp()->GetGroundCode(i_this->mAcch.m_gnd) == 4) // Abyss ground code { diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index bfd8dd988..40b4e1ce6 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -515,7 +515,7 @@ void daArrow_c::setRoomInfo() { mGndChk.SetPos(¤t.pos); f32 groundY = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { roomNo = dComIfG_Bgsp()->GetRoomId(mGndChk); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mGndChk); } else { diff --git a/src/d/actor/d_a_bk.cpp b/src/d/actor/d_a_bk.cpp index 8deea0e4b..bf9f2d5c8 100644 --- a/src/d/actor/d_a_bk.cpp +++ b/src/d/actor/d_a_bk.cpp @@ -627,8 +627,8 @@ static u8 ground_4_check(bk_class* i_this, int r18, s16 r20, f32 f29) { sp8 += i_this->current.pos; gndChk.SetPos(&sp8); sp8.y = dComIfG_Bgsp()->GroundCross(&gndChk); - if (sp8.y == C_BG_MIN_HEIGHT) { - sp8.y = C_BG_MAX_HEIGHT; + if (sp8.y == -G_CM3D_F_INF) { + sp8.y = G_CM3D_F_INF; } if (i_this->dr.mAcch.GetGroundH() - sp8.y > 200.0f) { r19 |= check_bit[i]; @@ -4451,14 +4451,14 @@ static BOOL daBk_Execute(bk_class* i_this) { sp28.y += 50.0f - i_this->dr.m44C.y; gndChk.SetPos(&sp28); sp28.y = dComIfG_Bgsp()->GroundCross(&gndChk); - if (sp28.y != C_BG_MIN_HEIGHT) { + if (sp28.y != -G_CM3D_F_INF) { Vec temp; temp.x = sp28.x; temp.y = 50.0f + sp28.y; temp.z = sp28.z + f31; gndChk.SetPos(&temp); f32 f1 = dComIfG_Bgsp()->GroundCross(&gndChk); - if (f1 != C_BG_MIN_HEIGHT) { + if (f1 != -G_CM3D_F_INF) { r21 = (s16)-cM_atan2s(f1 - sp28.y, temp.z - sp28.z); if (r21 > 0x2000 || r21 < -0x2000) { r21 = 0; @@ -4469,7 +4469,7 @@ static BOOL daBk_Execute(bk_class* i_this) { temp.z = sp28.z; gndChk.SetPos(&temp); f1 = dComIfG_Bgsp()->GroundCross(&gndChk); - if (f1 != C_BG_MIN_HEIGHT) { + if (f1 != -G_CM3D_F_INF) { r23 = (s16)cM_atan2s(f1 - sp28.y, temp.x - sp28.x); if (r23 > 0x2000 || r23 < -0x2000) { r23 = 0; diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index fc78b4f71..3d2cfa8de 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -70,7 +70,7 @@ void daBoko_c::setFlameEffect() { /* 00001340-000013CC .text setRoomInfo__8daBoko_cFv */ void daBoko_c::setRoomInfo() { int roomNo; - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF) { roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); } else { @@ -195,7 +195,7 @@ BOOL daBoko_c::procCarry() { int i; for (i = 0; i < 3; i++) { m_ground_check.SetPos(¤t.pos); - if (dComIfG_Bgsp()->GroundCross(&m_ground_check) != C_BG_MIN_HEIGHT) { + if (dComIfG_Bgsp()->GroundCross(&m_ground_check) != -G_CM3D_F_INF) { break; } current.pos.x -= 50.0f * cM_ssin(shape_angle.y); diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index 1f697e9b5..30c1912e4 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -292,12 +292,12 @@ namespace daBomb2 { mAcch.ClrRoofNone(); mAcch.m_roof_crr_height = 50.0f; mAcch.OnLineCheck(); - field_0x51C = C_BG_MIN_HEIGHT; - field_0x520 = C_BG_MIN_HEIGHT; + field_0x51C = -G_CM3D_F_INF; + field_0x520 = -G_CM3D_F_INF; field_0x524 = 0; mbWaterIn = 0; field_0x526 = 0; - field_0x528 = C_BG_MIN_HEIGHT; + field_0x528 = -G_CM3D_F_INF; } dCcD_SrcSph Act_c::M_sph_src = { @@ -553,7 +553,7 @@ namespace daBomb2 { r5 = true; field_0x526 = 1; } else { - field_0x520 = C_BG_MIN_HEIGHT; + field_0x520 = -G_CM3D_F_INF; field_0x526 = 0; } mbWaterIn = r5; @@ -564,7 +564,7 @@ namespace daBomb2 { } bool Act_c::chk_lava_in() const { - if(field_0x51C == C_BG_MIN_HEIGHT) { + if(field_0x51C == -G_CM3D_F_INF) { return false; } @@ -573,7 +573,7 @@ namespace daBomb2 { void Act_c::setRoomInfo() { s32 roomNo; - if(mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(mAcch.GetGroundH() != -G_CM3D_F_INF) { roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); } @@ -1092,7 +1092,7 @@ namespace daBomb2 { void Act_c::mode_sink() { f32 temp; bool temp2 = fopAcM_getWaterY(¤t.pos, &temp); - if(temp2 && field_0x528 != C_BG_MIN_HEIGHT && --field_0x698 > 0) { + if(temp2 && field_0x528 != -G_CM3D_F_INF && --field_0x698 > 0) { current.pos.y += temp - field_0x528; field_0x528 = temp; posMoveF(); diff --git a/src/d/actor/d_a_bomb3.inc b/src/d/actor/d_a_bomb3.inc index 8afe12d80..9998aef54 100644 --- a/src/d/actor/d_a_bomb3.inc +++ b/src/d/actor/d_a_bomb3.inc @@ -197,7 +197,7 @@ BOOL daBomb_c::draw() { draw_norm(); } - if(fopAcM_GetModel(this) == 0 && mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(fopAcM_GetModel(this) == 0 && mAcch.GetGroundH() != -G_CM3D_F_INF) { cM3dGPla* pNormal = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd); if(pNormal) { dComIfGd_setSimpleShadow(¤t.pos, mAcch.GetGroundH(), 25.0f, pNormal->GetNP()); @@ -438,7 +438,7 @@ bool daBomb_c::checkExplodeBg() { /* 800DA320-800DA3A0 .text water_tention__8daBomb_cFv */ void daBomb_c::water_tention() { if(chk_water_in()) { - if(field_0x558 != C_BG_MIN_HEIGHT && field_0x55C != C_BG_MIN_HEIGHT) { + if(field_0x558 != -G_CM3D_F_INF && field_0x55C != -G_CM3D_F_INF) { f32 temp = field_0x558 - field_0x55C; current.pos.y += temp < 0.0f ? 0.8f * temp : 0.2f * temp; } @@ -533,7 +533,7 @@ void daBomb_c::bgCrrPos_water() { r5 = true; field_0x562 = 1; } else { - field_0x558 = C_BG_MIN_HEIGHT; + field_0x558 = -G_CM3D_F_INF; field_0x562 = 0; } field_0x560 = r5 && !mbWaterIn; @@ -559,7 +559,7 @@ bool daBomb_c::chk_water_sink() { /* 800DA768-800DA794 .text chk_lava_hit__8daBomb_cFv */ bool daBomb_c::chk_lava_hit() { - if(field_0x554 == C_BG_MIN_HEIGHT) { + if(field_0x554 == -G_CM3D_F_INF) { return false; } @@ -568,7 +568,7 @@ bool daBomb_c::chk_lava_hit() { /* 800DA794-800DA7CC .text chk_dead_zone__8daBomb_cFv */ bool daBomb_c::chk_dead_zone() { - return mAcch.GetGroundH() == C_BG_MIN_HEIGHT && field_0x558 == C_BG_MIN_HEIGHT && field_0x554 == C_BG_MIN_HEIGHT; + return mAcch.GetGroundH() == -G_CM3D_F_INF && field_0x558 == -G_CM3D_F_INF && field_0x554 == -G_CM3D_F_INF; } /* 800DA7CC-800DA8C8 .text bound__8daBomb_cFf */ @@ -629,7 +629,7 @@ void daBomb_c::set_real_shadow_flag() { /* 800DA9DC-800DAA60 .text setRoomInfo__8daBomb_cFv */ void daBomb_c::setRoomInfo() { s32 roomNo; - if(mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(mAcch.GetGroundH() != -G_CM3D_F_INF) { roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); } @@ -1398,9 +1398,9 @@ void daBomb_c::create_init() { mAcch.m_roof_crr_height = 50.0f; mAcch.OnLineCheck(); - field_0x554 = C_BG_MIN_HEIGHT; - field_0x558 = C_BG_MIN_HEIGHT; - field_0x55C = C_BG_MIN_HEIGHT; + field_0x554 = -G_CM3D_F_INF; + field_0x558 = -G_CM3D_F_INF; + field_0x55C = -G_CM3D_F_INF; field_0x560 = 0; mbWaterIn = 0; field_0x562 = 0; diff --git a/src/d/actor/d_a_esa.cpp b/src/d/actor/d_a_esa.cpp index dda1fdeeb..d592ac232 100644 --- a/src/d/actor/d_a_esa.cpp +++ b/src/d/actor/d_a_esa.cpp @@ -52,7 +52,7 @@ void bg_check(esa_class* i_this) { cXyz sp54 = i_this->current.pos; sp54.y += 100.0f; f32 waterHeight = dBgS_GetWaterHeight(sp54); - if(waterHeight != C_BG_MIN_HEIGHT && i_this->mGroundHeight <= waterHeight) { + if(waterHeight != -G_CM3D_F_INF && i_this->mGroundHeight <= waterHeight) { i_this->mGroundHeight = waterHeight; state = 2; } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 0468d3c23..199953781 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -808,7 +808,7 @@ void down(fganon_class* i_this) { sp2C.y += 300.0f; gndChk.SetPos(&sp2C); f32 height = dComIfG_Bgsp()->GroundCross(&gndChk); - if (height != C_BG_MIN_HEIGHT && i_this->current.pos.y <= height) { + if (height != -G_CM3D_F_INF && i_this->current.pos.y <= height) { bVar3 = TRUE; } if ((i_this->m3A4[0] == 0) || bVar3) { diff --git a/src/d/actor/d_a_ib.cpp b/src/d/actor/d_a_ib.cpp index ed6a547fa..a2778dbcd 100644 --- a/src/d/actor/d_a_ib.cpp +++ b/src/d/actor/d_a_ib.cpp @@ -207,7 +207,7 @@ void daIball_c::checkGeo() { lavaChk.SetPos(&pos); f32 lavaY = dComIfG_Bgsp()->GroundCross(&lavaChk); f32 groundH = mAcch.GetGroundH(); - if (lavaY != C_BG_MIN_HEIGHT) { + if (lavaY != -G_CM3D_F_INF) { f32 lava_depth = lavaY - groundH; if ((lava_depth < 20.0f && lavaY > current.pos.y) || (lava_depth >= 20.0f && lavaY > current.pos.y + 20.0f)) { fopAcM_seStartCurrent(this, JA_SE_OBJ_FALL_MAGMA_S, 0); @@ -239,7 +239,7 @@ void daIball_c::mode_wait() { } f32 seaHeight = mAcch.GetSeaHeight(); - if (seaHeight > current.pos.y && seaHeight != C_BG_MIN_HEIGHT) { + if (seaHeight > current.pos.y && seaHeight != -G_CM3D_F_INF) { mode_water_init(); current.pos.y = seaHeight; } @@ -255,10 +255,10 @@ void daIball_c::mode_water_init() { /* 800F3FE8-800F4054 .text mode_water__9daIball_cFv */ void daIball_c::mode_water() { f32 seaHeight = mAcch.GetSeaHeight(); - if (seaHeight == C_BG_MIN_HEIGHT || seaHeight < current.pos.y) { + if (seaHeight == -G_CM3D_F_INF || seaHeight < current.pos.y) { mode_wait_init(); } - if (seaHeight != C_BG_MIN_HEIGHT) { + if (seaHeight != -G_CM3D_F_INF) { current.pos.y = seaHeight; } } diff --git a/src/d/actor/d_a_item.cpp b/src/d/actor/d_a_item.cpp index 5d284dbd5..70defcad5 100644 --- a/src/d/actor/d_a_item.cpp +++ b/src/d/actor/d_a_item.cpp @@ -1299,7 +1299,7 @@ void daItem_c::mode_wait() { temp.set(old.pos.x, old.pos.y, old.pos.z); lavaChk.SetPos(&temp); f32 lavaY = dComIfG_Bgsp()->GroundCross(&lavaChk); - if (lavaY != C_BG_MIN_HEIGHT && lavaY > current.pos.y) { + if (lavaY != -G_CM3D_F_INF && lavaY > current.pos.y) { fopAcM_delete(this); } } diff --git a/src/d/actor/d_a_kita.cpp b/src/d/actor/d_a_kita.cpp index 0ab82b541..14ec2771c 100644 --- a/src/d/actor/d_a_kita.cpp +++ b/src/d/actor/d_a_kita.cpp @@ -118,7 +118,7 @@ void kita_move(kita_class* i_this) { lgc_pos.x = lgc_x; lgc_pos.y = lgc_y; lgc_pos.z = lgc_z; liquid_ground_check.SetPos(&lgc_pos); float liquid_gnd_cross = dComIfG_Bgsp()->GroundCross(&liquid_ground_check); - if(liquid_gnd_cross != C_BG_MIN_HEIGHT && liquid_gnd_cross > i_this->field_35C){ + if(liquid_gnd_cross != -G_CM3D_F_INF && liquid_gnd_cross > i_this->field_35C){ i_this->field_35C = liquid_gnd_cross + 40.0f + REG0_F(17); i_this->field_360 = 1; } diff --git a/src/d/actor/d_a_ks.cpp b/src/d/actor/d_a_ks.cpp index c925977f4..7ad475d8d 100644 --- a/src/d/actor/d_a_ks.cpp +++ b/src/d/actor/d_a_ks.cpp @@ -130,7 +130,7 @@ void naraku_check(ks_class* i_this) { cXyz local_24; cXyz local_18; - if (i_this->mAcch.GetGroundH() != C_BG_MIN_HEIGHT && dComIfG_Bgsp()->ChkPolySafe(i_this->mAcch.m_gnd) && dComIfG_Bgsp()->GetGroundCode(i_this->mAcch.m_gnd) == 4) { + if (i_this->mAcch.GetGroundH() != -G_CM3D_F_INF && dComIfG_Bgsp()->ChkPolySafe(i_this->mAcch.m_gnd) && dComIfG_Bgsp()->GetGroundCode(i_this->mAcch.m_gnd) == 4) { i_this->m2D3++; if (i_this->current.pos.y < -500.0f || i_this->m2D3 > 0x32) { diff --git a/src/d/actor/d_a_kt.cpp b/src/d/actor/d_a_kt.cpp index 3bdf6c013..7f12d8655 100644 --- a/src/d/actor/d_a_kt.cpp +++ b/src/d/actor/d_a_kt.cpp @@ -101,7 +101,7 @@ void kotori_move(kt_class* i_this) { gndChk.SetPos(&i_this->mTargetPosHome); i_this->mTargetPosHome.y = dComIfG_Bgsp()->GroundCross(&gndChk); - if (i_this->mTargetPosHome.y == C_BG_MIN_HEIGHT) + if (i_this->mTargetPosHome.y == -G_CM3D_F_INF) i_this->mTargetPosHome = player->current.pos; i_this->mTargetPos = i_this->mTargetPosHome; i_this->mSpeedLerp = 0.0f; diff --git a/src/d/actor/d_a_leaflift.cpp b/src/d/actor/d_a_leaflift.cpp index d7b431936..d9d30b368 100644 --- a/src/d/actor/d_a_leaflift.cpp +++ b/src/d/actor/d_a_leaflift.cpp @@ -113,7 +113,7 @@ void daLlift_c::CreateInit() { cXyz waterCheckPos = current.pos; waterCheckPos.y += 200.0f; mWaterY = dBgS_ObjGndChk_Wtr_Func(waterCheckPos); - if (mWaterY != C_BG_MIN_HEIGHT) { + if (mWaterY != -G_CM3D_F_INF) { cXyz particlePos = current.pos; particlePos.y = mWaterY + 1.0f; mEmitter3 = dComIfGp_particle_set(dPa_name::ID_SCENE_82AA, &particlePos, ¤t.angle); diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp index 8c2b37edd..f758dc1b0 100644 --- a/src/d/actor/d_a_nh.cpp +++ b/src/d/actor/d_a_nh.cpp @@ -274,7 +274,7 @@ void daNh_c::BGCheck() { dBgS_ObjGndChk_All gndChk; gndChk.SetPos(¤t.pos); f32 groundY = dComIfG_Bgsp()->GroundCross(&gndChk); - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { mGroundY = groundY; tevStr.mRoomNo = current.roomNo = dComIfG_Bgsp()->GetRoomId(gndChk); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(gndChk); diff --git a/src/d/actor/d_a_npc_kamome.cpp b/src/d/actor/d_a_npc_kamome.cpp index a3ae1b533..a72e1a2d0 100644 --- a/src/d/actor/d_a_npc_kamome.cpp +++ b/src/d/actor/d_a_npc_kamome.cpp @@ -1286,7 +1286,7 @@ BOOL daNpc_kam_c::execute() { if (!isNoBgCheck()) { mAcch.CrrPos(*dComIfG_Bgsp()); - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF) { s8 roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); fopAcM_SetRoomNo(this, roomNo); tevStr.mRoomNo = roomNo; diff --git a/src/d/actor/d_a_npc_os.cpp b/src/d/actor/d_a_npc_os.cpp index 1bc5aeb42..72177f3ea 100644 --- a/src/d/actor/d_a_npc_os.cpp +++ b/src/d/actor/d_a_npc_os.cpp @@ -2131,7 +2131,7 @@ BOOL daNpc_Os_c::execute() { mAcch.CrrPos(*dComIfG_Bgsp()); field_0x784 |= 0x10; - if(mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(mAcch.GetGroundH() != -G_CM3D_F_INF) { tevStr.mRoomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); @@ -2208,7 +2208,7 @@ BOOL daNpc_Os_c::execute() { } } - if(mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(mAcch.GetGroundH() != -G_CM3D_F_INF) { cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd.GetBgIndex(), mAcch.m_gnd.GetPolyIndex()); if(plane) { field_0x7F0 = *plane->GetNP(); @@ -2228,7 +2228,7 @@ BOOL daNpc_Os_c::execute() { field_0x7A8 = mAcch.ChkGroundHit(); if(!fopAcM_checkCarryNow(this)) { - if(mAcch.GetGroundH() == C_BG_MIN_HEIGHT || dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd) == 4) { + if(mAcch.GetGroundH() == -G_CM3D_F_INF || dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd) == 4) { if(m4E8 < 30) { m4E8 += 1; } @@ -2270,7 +2270,7 @@ BOOL daNpc_Os_c::execute() { mAcch.CrrPos(*dComIfG_Bgsp()); field_0x784 |= 0x10; - if(mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if(mAcch.GetGroundH() != -G_CM3D_F_INF) { tevStr.mRoomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); } diff --git a/src/d/actor/d_a_npc_people.cpp b/src/d/actor/d_a_npc_people.cpp index e2cbeea50..14e3b0ba0 100644 --- a/src/d/actor/d_a_npc_people.cpp +++ b/src/d/actor/d_a_npc_people.cpp @@ -4547,7 +4547,7 @@ cPhs_State daNpcPeople_c::createInit() { if(mNpcType != 0xB) { mObjAcch.CrrPos(*dComIfG_Bgsp()); - if(C_BG_MIN_HEIGHT != mObjAcch.GetGroundH()) { + if(-G_CM3D_F_INF != mObjAcch.GetGroundH()) { current.pos.y = home.pos.y = mObjAcch.GetGroundH(); } } diff --git a/src/d/actor/d_a_npc_roten.cpp b/src/d/actor/d_a_npc_roten.cpp index 3fab4b7fd..45404ef81 100644 --- a/src/d/actor/d_a_npc_roten.cpp +++ b/src/d/actor/d_a_npc_roten.cpp @@ -1760,7 +1760,7 @@ cPhs_State daNpcRoten_c::createInit() { fopAcM_setCullSizeBox(this, -200.0f, 0.0f, -200.0f, 200.0f, 300.0f, 200.0f); mObjAcch.CrrPos(*dComIfG_Bgsp()); - if(C_BG_MIN_HEIGHT != mObjAcch.GetGroundH()) { + if(-G_CM3D_F_INF != mObjAcch.GetGroundH()) { current.pos.y = home.pos.y = mObjAcch.GetGroundH(); } diff --git a/src/d/actor/d_a_obj_barrel.cpp b/src/d/actor/d_a_obj_barrel.cpp index dd46e8072..783c9df2b 100644 --- a/src/d/actor/d_a_obj_barrel.cpp +++ b/src/d/actor/d_a_obj_barrel.cpp @@ -727,7 +727,7 @@ bool daObjBarrel::Act_c::_draw() { float gndH = mAcch.GetGroundH(); cM3dGPla* gndPlane = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd); cXyz *norm = gndPlane->GetNP(); - if (gndPlane && gndH != C_BG_MIN_HEIGHT) { + if (gndPlane && gndH != -G_CM3D_F_INF) { dComIfGd_setSimpleShadow(¤t.pos, gndH, attr().m02, norm); } } diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 11ba8f9ea..de96ffe47 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -114,7 +114,7 @@ namespace daObjMovebox { /* 000001F0-000003A4 .text gnd_pos__Q212daObjMovebox5Bgc_cFPCQ212daObjMovebox5Act_cPCQ212daObjMovebox8BgcSrc_cif */ void Bgc_c::gnd_pos(const Act_c* movebox, const BgcSrc_c* bgcSrc, int bgcSrcCount, f32 param_4) { - f32 maxGroundY = C_BG_MIN_HEIGHT; + f32 maxGroundY = -G_CM3D_F_INF; mDoMtx_stack_c::transS(movebox->current.pos); mDoMtx_stack_c::YrotM(movebox->home.angle.y); @@ -1870,7 +1870,7 @@ namespace daObjMovebox { int temp = mBgc.mMaxGroundIdx; f32 groundH = mBgc.mGroundY[temp]; cM3dGPla* triPla = dComIfG_Bgsp()->GetTriPla(Bgc_c::M_gnd_work[temp]); - if (triPla && groundH != C_BG_MIN_HEIGHT) { + if (triPla && groundH != -G_CM3D_F_INF) { dComIfGd_setSimpleShadow(¤t.pos, groundH, i_attr()->m10, triPla->GetNP(), shape_angle.y, 1.0f, NULL); } } diff --git a/src/d/actor/d_a_player_climb.inc b/src/d/actor/d_a_player_climb.inc index bc302e7d3..b4e99e186 100644 --- a/src/d/actor/d_a_player_climb.inc +++ b/src/d/actor/d_a_player_climb.inc @@ -190,7 +190,7 @@ void daPy_lk_c::checkBgClimbMove() { local_5c.set(current.pos.x + (25.0f * dVar7), local_68.y + 30.0f, current.pos.z + (25.0f * dVar6)); mGndChk.SetPos(&local_5c); dVar3 = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != dVar3 && cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mGndChk)->GetNP()->y) && + if (-G_CM3D_F_INF != dVar3 && cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mGndChk)->GetNP()->y) && dVar3 >= local_68.y - 30.0f) { dVar4 = 3.0f; diff --git a/src/d/actor/d_a_player_hammer.inc b/src/d/actor/d_a_player_hammer.inc index 5241f420a..0b2ff775f 100644 --- a/src/d/actor/d_a_player_hammer.inc +++ b/src/d/actor/d_a_player_hammer.inc @@ -51,7 +51,7 @@ void daPy_lk_c::setHammerQuake(cBgS_PolyInfo* param_1, const cXyz* param_2, int local_2c.set(mSwordTopPos.x, mSwordTopPos.y + 100.0f, mSwordTopPos.z); mGndChk.SetPos(&local_2c); dVar9 = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != dVar9) { + if (-G_CM3D_F_INF != dVar9) { iVar6 = dComIfG_Bgsp()->GetMtrlSndId(mGndChk); } else { iVar6 = mMtrlSndId; @@ -334,7 +334,7 @@ BOOL daPy_lk_c::procHammerFrontSwing() { int r26; r26 = -1; f32 f30 = 300.0f; - f32 f31 = C_BG_MIN_HEIGHT; + f32 f31 = -G_CM3D_F_INF; for (r27 = 0; r27 < mSwBlur.field_0x014; r27++) { sp08.set(mSwBlur.field_0x034[r27].x, f30 + mSwBlur.field_0x034[r27].y, mSwBlur.field_0x034[r27].z); mGndChk.SetPos(&sp08); diff --git a/src/d/actor/d_a_player_hang.inc b/src/d/actor/d_a_player_hang.inc index 03bb0a907..d3abf490b 100644 --- a/src/d/actor/d_a_player_hang.inc +++ b/src/d/actor/d_a_player_hang.inc @@ -114,7 +114,7 @@ int daPy_lk_c::changeHangEndProc(int param_0) { mGndChk.SetPos(&pos); m35DC = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != m35DC) { + if (-G_CM3D_F_INF != m35DC) { m3588 = dComIfG_Bgsp()->GetAttributeCode(mGndChk); } else { m3588 = dBgS_Attr_UNK1B_e; @@ -281,7 +281,7 @@ BOOL daPy_lk_c::procHangFallStart_init(cM3dGPla* param_0) { mGndChk.SetPos(&local_34); f32 cross = dComIfG_Bgsp()->GroundCross(&mGndChk); local_34.y = cross; - if (local_34.y != C_BG_MIN_HEIGHT) { + if (local_34.y != -G_CM3D_F_INF) { if (local_34.y < -30.1f + current.pos.y) { return false; } diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 8ae11fcc2..90e3fd79b 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -1553,7 +1553,7 @@ void daPy_lk_c::drawShadow() { local_30.y = pMVar3[1][3]; local_30.z = pMVar3[2][3]; if (checkGrabWear()) { - if ((C_BG_MIN_HEIGHT != mAcch.GetGroundH()) && (dComIfG_Bgsp()->ChkPolySafe(mAcch.m_gnd))) { + if ((-G_CM3D_F_INF != mAcch.GetGroundH()) && (dComIfG_Bgsp()->ChkPolySafe(mAcch.m_gnd))) { dComIfGd_setSimpleShadow2(&local_30, mAcch.GetGroundH(), 30.0f, mAcch.m_gnd, 0, 1.0f, &dDlst_shadowControl_c::mSimpleTexObj); } @@ -3540,7 +3540,7 @@ void daPy_lk_c::deleteEquipItem(BOOL param_1) { void daPy_lk_c::setFallVoice() { if ((!checkNoResetFlg0(daPyFlg0_NO_FALL_VOICE) && ((((!checkNoResetFlg0(daPyFlg0_UNK80) || m35D0 < mAcch.GetGroundH()) || m3580 == 4) || - C_BG_MIN_HEIGHT == mAcch.GetGroundH()))) && + -G_CM3D_F_INF == mAcch.GetGroundH()))) && (m35F0 - current.pos.y > 500.0f)) { if (current.pos.y - mAcch.GetGroundH() >= 100.0f * daPy_HIO_fall_c0::m.field_0x14) { @@ -4662,7 +4662,7 @@ void daPy_lk_c::setFrontWallType() { if (!checkModeFlg(ModeFlg_SWIM) && dVar16 < current.pos.y) { return; } - if (dVar16 == C_BG_MIN_HEIGHT || !cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mGndChk)->GetNP()->y)) { + if (dVar16 == -G_CM3D_F_INF || !cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mGndChk)->GetNP()->y)) { return; } cXyz sp3C; @@ -8710,7 +8710,7 @@ void daPy_lk_c::footBgCheck() { } else { sp10[i] = 0; } - if (f1 != C_BG_MIN_HEIGHT && sp5C.y - f1 < 60.2f) { + if (f1 != -G_CM3D_F_INF && sp5C.y - f1 < 60.2f) { *r26 = f1; r25_r26->field_0x000 = 1; } else { @@ -10696,7 +10696,7 @@ BOOL daPy_lk_c::checkLavaFace(cXyz* oldPos, int attributeCode) { mLavaGndChk.SetPos(&pos); m35D4 = dComIfG_Bgsp()->GroundCross(&mLavaGndChk); if (mAcch.GetGroundH() > m35D4) { - m35D4 = C_BG_MIN_HEIGHT; + m35D4 = -G_CM3D_F_INF; } if (m35D4 > current.pos.y) { attributeCode = dComIfG_Bgsp()->GetAttributeCode(mLavaGndChk); @@ -10731,7 +10731,7 @@ void daPy_lk_c::checkFallCode() { f32 dVar6; cXyz local_44; - if (m3580 == 4 || C_BG_MIN_HEIGHT == mAcch.GetGroundH()) { + if (m3580 == 4 || -G_CM3D_F_INF == mAcch.GetGroundH()) { bVar4 = m35D0 > mAcch.GetGroundH() ? TRUE : FALSE; if (((((!bVar4) && checkModeFlg(ModeFlg_MIDAIR)) && (!checkModeFlg(ModeFlg_HOOKSHOT) && (m35F4 - current.pos.y > 100.0f * daPy_HIO_fall_c0::m.field_0x14))) || @@ -10955,7 +10955,7 @@ void daPy_lk_c::setShapeAngleOnGround() { mDoMtx_stack_c::multVec(&l_crawl_back_up_offset, &local_50); mGndChk.SetPos(&local_44); local_44.y = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != local_44.y) { + if (-G_CM3D_F_INF != local_44.y) { triPla = dComIfG_Bgsp()->GetTriPla(mGndChk); } else { triPla = NULL; @@ -10967,7 +10967,7 @@ void daPy_lk_c::setShapeAngleOnGround() { } mGndChk.SetPos(&local_50); local_50.y = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != local_50.y) { + if (-G_CM3D_F_INF != local_50.y) { triPla = dComIfG_Bgsp()->GetTriPla(mGndChk); } else { triPla = NULL; @@ -11245,7 +11245,7 @@ BOOL daPy_lk_c::execute() { !dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) && !checkModeFlg(ModeFlg_ROPE | ModeFlg_CLIMB | ModeFlg_LADDER) && mCurProc != daPyProc_DEMO_TOOL_e && - mAcch.GetGroundH() != C_BG_MIN_HEIGHT && + mAcch.GetGroundH() != -G_CM3D_F_INF && !checkNoResetFlg0((daPy_FLG0)(daPyFlg0_UNK20000000 | daPyFlg0_UNK80000000)) && dComIfG_Bgsp()->ChkPolySafe(mAcch.m_gnd) && dComIfG_Bgsp()->ChkMoveBG(mAcch.m_gnd) @@ -11403,7 +11403,7 @@ BOOL daPy_lk_c::execute() { } } else if (mCurProc == daPyProc_DEMO_TOOL_e) { current.pos = sp14; - if (m3574 != 0 && mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if (m3574 != 0 && mAcch.GetGroundH() != -G_CM3D_F_INF) { current.pos.y = mAcch.GetGroundH(); } } else if (mCurProc == daPyProc_HOOKSHOT_FLY_e || @@ -11423,7 +11423,7 @@ BOOL daPy_lk_c::execute() { } int roomNo; - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF) { roomNo = setRoomInfo(); m357C = m3580; m3580 = dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd); @@ -12398,7 +12398,7 @@ cPhs_State daPy_lk_c::makeBgWait() { m352E--; } mAcch.CrrPos(*dComIfG_Bgsp()); - if ((C_BG_MIN_HEIGHT == mAcch.GetGroundH()) || + if ((-G_CM3D_F_INF == mAcch.GetGroundH()) || (((m352E != 0 && (dComIfG_Bgsp()->ChkMoveBG(mAcch.m_gnd))) && (fopAcM_GetName(dComIfG_Bgsp()->GetActorPointer(mAcch.m_gnd.GetBgIndex())) == PROC_TBOX)))) diff --git a/src/d/actor/d_a_player_npc.cpp b/src/d/actor/d_a_player_npc.cpp index b6d819005..7f87d478d 100644 --- a/src/d/actor/d_a_player_npc.cpp +++ b/src/d/actor/d_a_player_npc.cpp @@ -13,7 +13,7 @@ int daPy_npc_c::check_initialRoom() { if (home.roomNo < 0) { mAcch.CrrPos(*dComIfG_Bgsp()); - if (mAcch.GetGroundH() == C_BG_MIN_HEIGHT || dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd) == 4) { + if (mAcch.GetGroundH() == -G_CM3D_F_INF || dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd) == 4) { return 0; } int roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc index 614651685..0bc9202ee 100644 --- a/src/d/actor/d_a_player_particle.inc +++ b/src/d/actor/d_a_player_particle.inc @@ -37,7 +37,7 @@ void daPy_swimTailEcallBack_c::getMaxWaterY(JGeometry::TVec3* pos) { if (field_0x10 > pos->y) { pos->y = field_0x10 + 2.0f; } - } else if (field_0x10 != C_BG_MIN_HEIGHT) { + } else if (field_0x10 != -G_CM3D_F_INF) { pos->y = field_0x10 + 2.0f; } else { pos->y = field_0x0C; @@ -893,7 +893,7 @@ void daPy_lk_c::setFootMark(cXyz* i_pos) { mGndChk.SetPos(&pos); pos.y = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (pos.y != C_BG_MIN_HEIGHT && dComIfG_Bgsp()->GetAttributeCode(mGndChk) == dBgS_Attr_SAND_e) { + if (pos.y != -G_CM3D_F_INF && dComIfG_Bgsp()->GetAttributeCode(mGndChk) == dBgS_Attr_SAND_e) { fopKyM_create(PROC_WATER_MARK, (shape_angle.y << 16) | 2, &pos, &scale, NULL); } @@ -1042,7 +1042,7 @@ void daPy_lk_c::setFootEffect() { mGndChk.SetPos(&pos); f32 groundY = dComIfG_Bgsp()->GroundCross(&mGndChk); - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { pos.y = groundY; } @@ -1133,7 +1133,7 @@ void daPy_lk_c::setWaterDrop() { return; } - if (dKyr_player_overhead_bg_chk() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_MISC_e && mCurProc != daPyProc_DEMO_LAST_COMBO_e && mAcch.m_roof_y == C_BG_MAX_HEIGHT) { + if (dKyr_player_overhead_bg_chk() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_MISC_e && mCurProc != daPyProc_DEMO_LAST_COMBO_e && mAcch.m_roof_y == G_CM3D_F_INF) { if (m3460[0].getEmitter() == NULL) { m3460[0].makeEmitter(dPa_name::ID_COMMON_0432, mpCLModel->getAnmMtx(0x0E), ¤t.pos, NULL); } diff --git a/src/d/actor/d_a_player_swim.inc b/src/d/actor/d_a_player_swim.inc index ea4d0e7ba..693bc7554 100644 --- a/src/d/actor/d_a_player_swim.inc +++ b/src/d/actor/d_a_player_swim.inc @@ -214,7 +214,7 @@ BOOL daPy_lk_c::checkSwimFallCheck() { BOOL daPy_lk_c::changeSwimOutProc() { cM3dGPla* pcVar1; - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT && dComIfG_Bgsp()->ChkPolySafe(mAcch.m_gnd)) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF && dComIfG_Bgsp()->ChkPolySafe(mAcch.m_gnd)) { pcVar1 = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd); } else { diff --git a/src/d/actor/d_a_player_whide.inc b/src/d/actor/d_a_player_whide.inc index 16762518a..73ef344ca 100644 --- a/src/d/actor/d_a_player_whide.inc +++ b/src/d/actor/d_a_player_whide.inc @@ -99,7 +99,7 @@ cM3dGPla* daPy_lk_c::getWHideModePolygon(cXyz* param_0, cXyz* param_1, cXyz* par local_3c.z = param_2->z + cM_ssin(uVar3) * daPy_HIO_wall_c0::m.field_0x50; mGndChk.SetPos(&local_3c); float f31 = bgs->GroundCross(&mGndChk); - if (C_BG_MIN_HEIGHT != f31 && (!cBgW_CheckBGround(bgs->GetTriPla(mGndChk)->GetNP()->y))) { + if (-G_CM3D_F_INF != f31 && (!cBgW_CheckBGround(bgs->GetTriPla(mGndChk)->GetNP()->y))) { return NULL; } @@ -383,7 +383,7 @@ BOOL daPy_lk_c::procWHideWait() { mAcchCir[2].SetWallH(125.0f); } - if (mStickDistance > 0.05f && C_BG_MIN_HEIGHT != mAcch.GetGroundH() && + if (mStickDistance > 0.05f && -G_CM3D_F_INF != mAcch.GetGroundH() && cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd)->GetNP()->y)) { int direction = getDirectionFromCurrentAngle(); @@ -451,7 +451,7 @@ BOOL daPy_lk_c::procWHideMove() { f32 fVar2; if (checkWHideModeChange(&acStack_24) != 0) { fVar2 = 0.0f; - } else if (mStickDistance > 0.05f && C_BG_MIN_HEIGHT != mAcch.GetGroundH() && + } else if (mStickDistance > 0.05f && -G_CM3D_F_INF != mAcch.GetGroundH() && cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd)->GetNP()->y)) { int direction = getDirectionFromCurrentAngle(); @@ -491,7 +491,7 @@ BOOL daPy_lk_c::procWHideMove() { if (std::fabsf(mVelocity) <= 0.001f) { return procWHideWait_init(); } - if (mAcch.GetGroundH() == C_BG_MIN_HEIGHT || !cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd)->GetNP()->y) || + if (mAcch.GetGroundH() == -G_CM3D_F_INF || !cBgW_CheckBGround(dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd)->GetNP()->y) || !checkWHideBackWall(&cStack_30)) { mVelocity = 0.0f; diff --git a/src/d/actor/d_a_shand.cpp b/src/d/actor/d_a_shand.cpp index b02a93a00..c703ebaa6 100644 --- a/src/d/actor/d_a_shand.cpp +++ b/src/d/actor/d_a_shand.cpp @@ -260,12 +260,12 @@ void hand_move(shand_class* i_this) { chk_pos_y += 200.0f; local_100.GetPointP()->set(chk_pos_x, chk_pos_y, chk_pos_z); float spl_ground_y = dComIfG_Bgsp()->GroundCross(&local_100) + 10.0f; - if(spl_ground_y != C_BG_MIN_HEIGHT){ + if(spl_ground_y != -G_CM3D_F_INF){ i_this->ground_y = spl_ground_y; } } else { - i_this->ground_y = C_BG_MIN_HEIGHT; + i_this->ground_y = -G_CM3D_F_INF; } i_this->mState = 2; diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index fc52ed1f1..6ade5838f 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -770,7 +770,7 @@ void daShip_c::getMaxWaterY(cXyz* shipPos) { } } else { - if (m03F8 != C_BG_MIN_HEIGHT) { + if (m03F8 != -G_CM3D_F_INF) { shipPos->y = m03F8; } else { @@ -831,7 +831,7 @@ f32 daShip_c::getWaterY() { m03F8 = mAcch.m_wtr.GetHeight(); } else { - m03F8 = C_BG_MIN_HEIGHT; + m03F8 = -G_CM3D_F_INF; } if (daSea_ChkArea(current.pos.x, current.pos.z)) { waterY = daSea_calcWave(current.pos.x, current.pos.z); @@ -3024,7 +3024,7 @@ void daShip_c::setEffectData(float param_1, short param_2) { /* 000085D8-00008688 .text setRoomInfo__8daShip_cFv */ void daShip_c::setRoomInfo() { int roomId; - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF) { roomId = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd); tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd); m03C4 = dComIfG_Bgsp()->GetGroundCode(mAcch.m_gnd); @@ -3820,7 +3820,7 @@ BOOL daShip_c::execute() { else { cXyz sp108; int sp18; - if (mAcch.GetGroundH() != C_BG_MIN_HEIGHT && dPath_GetPolyRoomPathVec(mAcch.m_gnd, &sp108, &sp18)) { + if (mAcch.GetGroundH() != -G_CM3D_F_INF && dPath_GetPolyRoomPathVec(mAcch.m_gnd, &sp108, &sp18)) { sp108.normalizeZP(); sp108 *= sp18 >> 1; cLib_addCalcPosXZ(&m1044, sp108, 0.5f, 5.0f, 1.0f); diff --git a/src/d/d_bg_s.cpp b/src/d/d_bg_s.cpp index b396e9268..1eca3ff9a 100644 --- a/src/d/d_bg_s.cpp +++ b/src/d/d_bg_s.cpp @@ -354,7 +354,7 @@ void dBgS::WallCorrect(dBgS_Acch* acch) { /* 800A13E0-800A14FC .text RoofChk__4dBgSFP12dBgS_RoofChk */ f32 dBgS::RoofChk(dBgS_RoofChk* chk) { - chk->SetNowY(C_BG_MAX_HEIGHT); + chk->SetNowY(G_CM3D_F_INF); chk->ClearPi(); cBgS_ChkElm* elm; for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) { @@ -606,7 +606,7 @@ void dBgS_CrrPos::CrrPos(dBgS& i_bgs) { mGndChk.SetPos(&pos); f32 f31 = pm_pos->y; mGroundH = i_bgs.GroundCross(&mGndChk); - if (mGroundH != C_BG_MIN_HEIGHT && mGroundH > f31) { + if (mGroundH != -G_CM3D_F_INF && mGroundH > f31) { pm_pos->y = mGroundH; if (field_0x58) { field_0x58->y = 0.0f; diff --git a/src/d/d_bg_s_acch.cpp b/src/d/d_bg_s_acch.cpp index 65102d746..c28f50a04 100644 --- a/src/d/d_bg_s_acch.cpp +++ b/src/d/d_bg_s_acch.cpp @@ -56,7 +56,7 @@ dBgS_Acch::dBgS_Acch() { pm_pos = NULL; pm_old_pos = NULL; pm_speed = NULL; - m_ground_h = C_BG_MIN_HEIGHT; + m_ground_h = -G_CM3D_F_INF; m_ground_up_h = 0.0f; m_ground_check_offset = 60.0f; m_ground_up_h_diff = 0.0f; @@ -73,7 +73,7 @@ dBgS_Acch::dBgS_Acch() { pm_shape_angle = NULL; m_my_ac = NULL; pm_out_poly_info = NULL; - m_sea_height = C_BG_MIN_HEIGHT; + m_sea_height = -G_CM3D_F_INF; } static void dummy1() { @@ -108,7 +108,7 @@ void dBgS_Acch::Set(cXyz* pos, cXyz* old_pos, fopAc_ac_c* actor, int tbl_size, d /* 800A2E80-800A2EE8 .text GroundCheckInit__9dBgS_AcchFR4dBgS */ void dBgS_Acch::GroundCheckInit(dBgS&) { - m_ground_h = C_BG_MIN_HEIGHT; + m_ground_h = -G_CM3D_F_INF; if (m_flags & GRND_NONE) { return; } @@ -131,7 +131,7 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) { m_gnd.m_pos = pos; m_ground_h = i_bgs.GroundCross(&m_gnd); - if (m_ground_h != C_BG_MIN_HEIGHT) { + if (m_ground_h != -G_CM3D_F_INF) { field_0xb8 = m_ground_h + m_ground_up_h; if (field_0xb8 > field_0xb4) { pm_pos->y = field_0xb8; @@ -155,8 +155,8 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) { /* 800A305C-800A313C .text GroundRoofProc__9dBgS_AcchFR4dBgS */ f32 dBgS_Acch::GroundRoofProc(dBgS& i_bgs) { - f32 y = C_BG_MIN_HEIGHT; - if (m_ground_h != C_BG_MIN_HEIGHT) { + f32 y = -G_CM3D_F_INF; + if (m_ground_h != -G_CM3D_F_INF) { // y = m_roof_height; // fakematch to fix load order if (field_0xb8 < (y = m_roof_height) && y < pm_pos->y) { @@ -257,14 +257,14 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { LineCheck(i_bgs); } - m_roof_height = C_BG_MAX_HEIGHT; + m_roof_height = G_CM3D_F_INF; if (!(m_flags & ROOF_NONE)) { m_roof.SetExtChk(*(cBgS_Chk*)this); ClrRoofHit(); cXyz roofPos = *pm_pos; m_roof.SetPos(roofPos); m_roof_y = i_bgs.RoofChk(&m_roof); - if (m_roof_y != C_BG_MAX_HEIGHT && pm_pos->y + m_roof_crr_height > m_roof_y) { + if (m_roof_y != G_CM3D_F_INF && pm_pos->y + m_roof_crr_height > m_roof_y) { m_roof_height = m_roof_y - m_roof_crr_height; SetRoofHit(); } @@ -281,10 +281,10 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { if (!(m_flags & WATER_NONE)) { ClrWaterHit(); ClrWaterIn(); - m_wtr.SetHeight(C_BG_MIN_HEIGHT); + m_wtr.SetHeight(-G_CM3D_F_INF); int room_no = i_bgs.GetRoomId(m_gnd); - if (m_ground_h != C_BG_MIN_HEIGHT && 0 <= room_no && room_no < 64) { + if (m_ground_h != -G_CM3D_F_INF && 0 <= room_no && room_no < 64) { JUT_ASSERT(693, 0 <= room_no && room_no < 64); dBgW* bgw = dComIfGp_roomControl_getBgW(room_no); @@ -312,7 +312,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { if (ChkSeaCheckOn()) { m_flags &= ~SEA_IN; - m_sea_height = C_BG_MIN_HEIGHT; + m_sea_height = -G_CM3D_F_INF; if (daSea_ChkArea(pm_pos->x, pm_pos->z)) { m_sea_height = daSea_calcWave(pm_pos->x, pm_pos->z); diff --git a/src/d/d_bg_s_func.cpp b/src/d/d_bg_s_func.cpp index 2bbafb2c8..4c3078ba9 100644 --- a/src/d/d_bg_s_func.cpp +++ b/src/d/d_bg_s_func.cpp @@ -34,7 +34,7 @@ bool dBgS_SplGrpChk_In_ObjGnd(cXyz& r30, dBgS_SplGrpChk* r31, f32 f31) { gndChk.SetPos(&sp1c); f32 height = dComIfG_Bgsp()->GroundCross(&gndChk); r31->SetHeight(height); - if (height == C_BG_MIN_HEIGHT) { + if (height == -G_CM3D_F_INF) { return FALSE; } @@ -79,7 +79,7 @@ u32 dBgS_GetGndMtrlSndId_Func(cXyz r21, f32 f1) { r21.y += f1; dBgS_ObjGndChk gndChk; gndChk.SetPos(&r21); - if (dComIfG_Bgsp()->GroundCross(&gndChk) == C_BG_MIN_HEIGHT) { + if (dComIfG_Bgsp()->GroundCross(&gndChk) == -G_CM3D_F_INF) { return 0; } return dComIfG_Bgsp()->GetMtrlSndId(gndChk); diff --git a/src/d/d_bg_s_spl_grp_chk.cpp b/src/d/d_bg_s_spl_grp_chk.cpp index 59e703795..b86142927 100644 --- a/src/d/d_bg_s_spl_grp_chk.cpp +++ b/src/d/d_bg_s_spl_grp_chk.cpp @@ -14,7 +14,7 @@ dBgS_SplGrpChk::dBgS_SplGrpChk() { m_ground.x = 0.0f; m_ground.y = 0.0f; m_ground.z = 0.0f; - m_roof = C_BG_MAX_HEIGHT; + m_roof = G_CM3D_F_INF; m_height = 0.0f; } diff --git a/src/d/d_bg_w_hf.cpp b/src/d/d_bg_w_hf.cpp index 70b8c7bfc..4029a493f 100644 --- a/src/d/d_bg_w_hf.cpp +++ b/src/d/d_bg_w_hf.cpp @@ -153,8 +153,8 @@ void dBgWHf::MakeBlckBndHf(int blck_id, f32* r28, f32* r29) { r31 = pm_bgd->m_t_num - 1; } - *r28 = C_BG_MAX_HEIGHT; - *r29 = C_BG_MIN_HEIGHT; + *r28 = G_CM3D_F_INF; + *r29 = -G_CM3D_F_INF; for (int t = r7; t <= r31; t++) { #if VERSION > VERSION_JPN diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 85a5ac242..8e2e3d816 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -269,9 +269,9 @@ void dCamera_c::initialize(camera_class* camera, fopAc_ac_c* playerActor, u32 ca mEventData.mStaffIdx = -1; mEventData.field_0x0c = -1; mRoomNo = -1; - m318 = C_BG_MIN_HEIGHT; - mBG.m5C.m58 = C_BG_MIN_HEIGHT; - mBG.m00.m58 = C_BG_MIN_HEIGHT; + m318 = -G_CM3D_F_INF; + mBG.m5C.m58 = -G_CM3D_F_INF; + mBG.m00.m58 = -G_CM3D_F_INF; mBG.m00.m04.OffNormalGrp(); mBG.m00.m04.OnWaterGrp(); m31D = 0; @@ -284,7 +284,7 @@ void dCamera_c::initialize(camera_class* camera, fopAc_ac_c* playerActor, u32 ca m350 = 0; m364 = 0; m368 = 0.0f; - m354 = C_BG_MIN_HEIGHT; + m354 = -G_CM3D_F_INF; mRoomMapToolCameraIdx = 0xFF; m608 = mCamSetup.mBGChk.WallUpDistance(); @@ -1814,7 +1814,7 @@ f32 dCamera_c::groundHeight(cXyz* param_0) { wtr_y = gnd_y; } - if (wtr_y == C_BG_MIN_HEIGHT) { + if (wtr_y == -G_CM3D_F_INF) { gnd_y = param_0->y; } else { @@ -2501,13 +2501,13 @@ void dCamera_c::checkGroundInfo() { mBG.m5C.m04 = gnd_chk; } - mBG.m5C.m00 = mBG.m5C.m58 != C_BG_MIN_HEIGHT; + mBG.m5C.m00 = mBG.m5C.m58 != -G_CM3D_F_INF; mBG.m00.m04.SetPos(&gnd_chk_pos); mBG.m00.m58 = dComIfG_Bgsp()->GroundCross(&mBG.m00.m04); - mBG.m00.m00 = mBG.m00.m58 != C_BG_MIN_HEIGHT; + mBG.m00.m00 = mBG.m00.m58 != -G_CM3D_F_INF; m354 = mBG.m00.m58; if (mpPlayerActor->current.pos.y - mBG.m5C.m58 > mCamSetup.mBGChk.FloorMargin()) { @@ -2588,7 +2588,7 @@ void dCamera_c::checkGroundInfo() { m314 = 1; } else { - m318 = C_BG_MIN_HEIGHT; + m318 = -G_CM3D_F_INF; m314 = 0; } @@ -4749,7 +4749,7 @@ bool camera_draw(camera_process_class* i_this) { gndchk.SetPos(&i_this->mLookat.mEye); f32 ground_y = dComIfG_Bgsp()->GroundCross(&gndchk); - if (ground_y != C_BG_MIN_HEIGHT) { + if (ground_y != -G_CM3D_F_INF) { mDoAud_getCameraMapInfo(dComIfG_Bgsp()->GetMtrlSndId(gndchk)); mDoAud_setCameraGroupInfo(dComIfG_Bgsp()->GetGrpSoundId(gndchk)); diff --git a/src/d/d_cc_mass_s.cpp b/src/d/d_cc_mass_s.cpp index 3b2005bf1..4ae8ac42c 100644 --- a/src/d/d_cc_mass_s.cpp +++ b/src/d/d_cc_mass_s.cpp @@ -20,10 +20,10 @@ void dCcMassS_Mng::Ct() { mFlag = 0; mResultCam = 0; mCamTopPos.x = 0.0f; - mCamTopPos.y = C_BG_MIN_HEIGHT; + mCamTopPos.y = -G_CM3D_F_INF; mCamTopPos.z = 0.0f; mCamBottomPos.x = 0.0f; - mCamBottomPos.y = C_BG_MIN_HEIGHT; + mCamBottomPos.y = -G_CM3D_F_INF; mCamBottomPos.z = 0.0f; Clear(); } @@ -71,13 +71,13 @@ void dCcMassS_Mng::Prepare() { mDivideArea.CalcDivideInfo(&mDivideInfo, mCpsAttr.GetWorkAab(), 0); } mCamTopPos.x = 0.0f; - mCamTopPos.y = C_BG_MIN_HEIGHT; + mCamTopPos.y = -G_CM3D_F_INF; mCamTopPos.z = 0.0f; - mCamTopDist = C_BG_MAX_HEIGHT; + mCamTopDist = G_CM3D_F_INF; mCamBottomPos.x = 0.0f; - mCamBottomPos.y = C_BG_MIN_HEIGHT; + mCamBottomPos.y = -G_CM3D_F_INF; mCamBottomPos.z = 0.0f; - mCamBottomDist = C_BG_MAX_HEIGHT; + mCamBottomDist = G_CM3D_F_INF; } /* 800ACCB8-800AD17C .text Chk__12dCcMassS_MngFP4cXyzPP10fopAc_ac_cP15dCcMassS_HitInf */ diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 737dda2af..6a748aa18 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -562,7 +562,7 @@ s8 dComIfGp_getReverb(int param_0) { /* 800534C4-800535B8 .text dComIfGd_setSimpleShadow2__FP4cXyzffR13cBgS_PolyInfosfP9_GXTexObj */ int dComIfGd_setSimpleShadow2(cXyz* i_pos, f32 groundY, f32 param_2, cBgS_PolyInfo& i_floorPoly, s16 i_angle, f32 param_5, GXTexObj* i_tex) { - if (i_floorPoly.ChkSetInfo() && C_BG_MIN_HEIGHT != groundY) { + if (i_floorPoly.ChkSetInfo() && -G_CM3D_F_INF != groundY) { cM3dGPla* plane_p = dComIfG_Bgsp()->GetTriPla(i_floorPoly); @@ -1041,7 +1041,7 @@ u8 dComIfGs_checkGetItemNum(u8 i_itemNo) { int dComIfGd_setShadow(u32 id, s8 param_2, J3DModel* pModel, cXyz* pPos, f32 param_5, f32 param_6, f32 y, f32 groundY, cBgS_PolyInfo& pFloorPoly, dKy_tevstr_c* param_10, s16 rotY, f32 param_12, GXTexObj* pTexObj) { - if (groundY <= C_BG_MIN_HEIGHT) { + if (groundY <= -G_CM3D_F_INF) { return 0; } diff --git a/src/d/d_grass.cpp b/src/d/d_grass.cpp index ea321a38f..e70904deb 100644 --- a/src/d/d_grass.cpp +++ b/src/d/d_grass.cpp @@ -444,7 +444,7 @@ static f32 checkGroundY(cXyz& pos) { chk.SetPos(&pos); f32 y = dComIfG_Bgsp()->GroundCross(&chk); pos.y -= 50.0f; - if (y <= C_BG_MIN_HEIGHT) + if (y <= -G_CM3D_F_INF) return pos.y; else return y; diff --git a/src/d/d_kankyo_rain.cpp b/src/d/d_kankyo_rain.cpp index 56fb25e20..84f52469a 100644 --- a/src/d/d_kankyo_rain.cpp +++ b/src/d/d_kankyo_rain.cpp @@ -726,7 +726,7 @@ bool overhead_bg_chk() { pos.y += 50.0f; roofChk.SetPos(pos); - if (dComIfG_Bgsp()->RoofChk(&roofChk) != C_BG_MAX_HEIGHT) + if (dComIfG_Bgsp()->RoofChk(&roofChk) != G_CM3D_F_INF) ret = true; pos.y += 10000.0f; gndChk.SetPos(&pos); @@ -755,7 +755,7 @@ bool forward_overhead_bg_chk(cXyz* pPos, f32 dist) { *pPos = pos; roofChk.SetPos(pos); - if (dComIfG_Bgsp()->RoofChk(&roofChk) != C_BG_MAX_HEIGHT) + if (dComIfG_Bgsp()->RoofChk(&roofChk) != G_CM3D_F_INF) ret = true; pos.y += 10000.0f; gndChk.SetPos(&pos); diff --git a/src/d/d_lib.cpp b/src/d/d_lib.cpp index c34e5c5b6..da322377c 100644 --- a/src/d/d_lib.cpp +++ b/src/d/d_lib.cpp @@ -27,7 +27,7 @@ void dLib_setCirclePath(dLib_circle_path_c* path) { /* 800570CC-8005716C .text dLib_getWaterY__FR4cXyzR12dBgS_ObjAcch */ f32 dLib_getWaterY(cXyz& pos, dBgS_ObjAcch& acch) { BOOL waterHit = acch.ChkWaterHit(); - f32 waterHeight = waterHit ? acch.m_wtr.GetHeight() : C_BG_MIN_HEIGHT; + f32 waterHeight = waterHit ? acch.m_wtr.GetHeight() : -G_CM3D_F_INF; if (daSea_ChkArea(pos.x, pos.z)) { f32 seaHeight = daSea_calcWave(pos.x, pos.z); if (!waterHit || seaHeight > waterHeight) { diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 853bbcc06..e48d067a9 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -766,7 +766,7 @@ JPABaseEmitter* dPa_control_c::setSimpleLand(int code, const cXyz* pos, const cs dBgS_ObjGndChk chk; cXyz chkPos(pos->x, pos->y + 10.0f, pos->z); chk.SetPos(&chkPos); - if (dComIfG_Bgsp()->GroundCross(&chk) != C_BG_MIN_HEIGHT) { + if (dComIfG_Bgsp()->GroundCross(&chk) != -G_CM3D_F_INF) { code = dComIfG_Bgsp()->GetAttributeCode(chk); } } diff --git a/src/d/d_wood.cpp b/src/d/d_wood.cpp index b9e771687..f80b62c92 100644 --- a/src/d/d_wood.cpp +++ b/src/d/d_wood.cpp @@ -603,7 +603,7 @@ bool dWood::Unit_c::set_ground() { gndChk.SetPos(&pos); f32 gndHeight = dComIfG_Bgsp()->GroundCross(&gndChk); - if (gndHeight > C_BG_MIN_HEIGHT) { + if (gndHeight > -G_CM3D_F_INF) { mPos.y = gndHeight; cM3dGPla *triPla = dComIfG_Bgsp()->GetTriPla(gndChk); diff --git a/src/d/d_wpot_water.cpp b/src/d/d_wpot_water.cpp index 76a90a998..2384fa713 100644 --- a/src/d/d_wpot_water.cpp +++ b/src/d/d_wpot_water.cpp @@ -90,7 +90,7 @@ static cPhs_State dWpotWater_Create(kankyo_class* i_k) { ); lavaChk.SetPos(&pos); f32 lavaY = dComIfG_Bgsp()->GroundCross(&lavaChk); - if (lavaY != C_BG_MIN_HEIGHT) { + if (lavaY != -G_CM3D_F_INF) { gndChk.SetPos(&pos); f32 groundY = dComIfG_Bgsp()->GroundCross(&gndChk); if (lavaChk.ChkSetInfo() && dComIfG_Bgsp()->GetAttributeCode(lavaChk) == dBgS_Attr_LAVA_e && lavaY > groundY) { @@ -109,7 +109,7 @@ static cPhs_State dWpotWater_Create(kankyo_class* i_k) { gndChk.SetPos(&pos); f32 groundY = dComIfG_Bgsp()->GroundCross(&gndChk); i_this->mPos.y = groundY; - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { cXyz sp18(i_this->mPos.x, i_this->mPos.y, i_this->mPos.z); fopAcM_create(PROC_HITOBJ, 0, &sp18, i_this->mParam); return i_this->create(); diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 1aea40fa4..c4ed54183 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -1293,13 +1293,13 @@ BOOL fopAcM_getGroundAngle(fopAc_ac_c* actor, csXyz* p_angle) { pos.y = dComIfG_Bgsp()->GroundCross(&gndChk); s16 targetAngleX; int targetAngleZ; - if (pos.y != C_BG_MIN_HEIGHT) { + if (pos.y != -G_CM3D_F_INF) { f32 origY = pos.y + 50.0f; gndChk.GetPointP()->set(pos.x, origY, pos.z + 10.0f); f32 origX = gndChk.GetPointP()->x; f32 origZ = gndChk.GetPointP()->z; f32 groundY = dComIfG_Bgsp()->GroundCross(&gndChk); - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { targetAngleX = -cM_atan2s(groundY - pos.y, origZ - pos.z); } else { pos.y = pos.y; // ?? fakematch? @@ -1311,7 +1311,7 @@ BOOL fopAcM_getGroundAngle(fopAc_ac_c* actor, csXyz* p_angle) { f32 tempZ = pos.z; gndChk.GetPointP()->set(origX, origY, tempZ); groundY = dComIfG_Bgsp()->GroundCross(&gndChk); - if (groundY != C_BG_MIN_HEIGHT) { + if (groundY != -G_CM3D_F_INF) { targetAngleZ = cM_atan2s(groundY - pos.y, origX - pos.x); } else { ret = FALSE; @@ -1412,7 +1412,7 @@ BOOL fopAcM_getWaterY(const cXyz* pPos, f32* pDstWaterY) { static dBgS_WtrChk water_check; BOOL ret = FALSE; - *pDstWaterY = C_BG_MIN_HEIGHT; + *pDstWaterY = -G_CM3D_F_INF; cXyz pos; pos.x = pPos->x;