d_bg_s OK

This commit is contained in:
LagoLunatic
2023-12-16 20:41:57 -05:00
parent af28c5dfa1
commit 725113992d
8 changed files with 178 additions and 85 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ bool cBgS::LineCross(cBgS_LinChk* chk) {
/* 802468E4-80246A14 .text GroundCross__4cBgSFP11cBgS_GndChk */
f32 cBgS::GroundCross(cBgS_GndChk* chk) {
chk->SetNowY(-1e+09);
chk->SetNowY(-1e+09f);
chk->ClearPi();
chk->mWallPrecheck = (chk->mFlag & 0x02);
chk->mGndPrecheck = (chk->mFlag & 0x01);
+13 -19
View File
@@ -51,7 +51,7 @@ daAgb_HIO_c::daAgb_HIO_c() {
field_0x04[1].mColor.b = 0;
field_0x04[1].mColor.a = 0;
field_0x14 = 24.0f;
field_0x14 = 25.0f;
field_0x18 = 50.0f;
field_0x1c = 781.25f;
field_0x20 = 170.0f;
@@ -895,7 +895,7 @@ void daAgb_c::modeProcCall() {
/* 800D30D4-800D36F4 .text daAgb_Execute__FP7daAgb_c */
// NONMATCHING - regswap
static int daAgb_Execute(daAgb_c* i_this) {
daPy_lk_c* temp_r29 = (daPy_lk_c*)dComIfGp_getPlayer(0);
daPy_py_c* player = daPy_getPlayerActorClass();
i_this->field_0x679 = 0;
if (mDoGaC_GbaLink() && mDoGaC_RecvStatusCheck(4)) {
@@ -954,12 +954,12 @@ static int daAgb_Execute(daAgb_c* i_this) {
}
} else {
daPy_lk_c* player_p2 = daPy_getPlayerLinkActorClass();
if ((dComIfGp_getPlayer(0) == player_p2 && !temp_r29->checkPlayerFly()) ||
((fopAcM_GetName(temp_r29) == PROC_NPC_MD && !daNpc_Md_c::isFlying()) ||
(fopAcM_GetName(temp_r29) == PROC_NPC_CB1 && !daNpc_Cb1_c::m_flying) ||
fopAcM_GetName(temp_r29) == PROC_NPC_OS))
if ((dComIfGp_getPlayer(0) == player_p2 && !player->checkPlayerFly()) ||
((fopAcM_GetName(player) == PROC_NPC_MD && !daNpc_Md_c::isFlying()) ||
(fopAcM_GetName(player) == PROC_NPC_CB1 && !daNpc_Cb1_c::m_flying) ||
fopAcM_GetName(player) == PROC_NPC_OS))
{
f32 speedF = fabs(temp_r29->speedF);
f32 speedF = fabs(player->speedF);
if (speedF <= 0.0f) {
daAgb_c::mFlags.field_0x5_3 = 0;
@@ -1045,9 +1045,9 @@ static int daAgb_Draw(daAgb_c* i_this) {
mDoExt_modelUpdateDL(i_this->mpModel);
if (i_this->field_0x679 != 0 &&
i_this->current.pos.y - i_this->mCrrPos.field_0x5c > 2.5f)
i_this->current.pos.y - i_this->mCrrPos.GetGroundH() > 2.5f)
{
dComIfGd_setSimpleShadow2(&i_this->current.pos, i_this->mCrrPos.field_0x5c, 50.0f,
dComIfGd_setSimpleShadow2(&i_this->current.pos, i_this->mCrrPos.GetGroundH(), 50.0f,
i_this->mCrrPos.mGndChk, 0, 1.0f, &i_this->mTexObj);
}
@@ -1116,20 +1116,14 @@ static int daAgb_Create(fopAc_ac_c* i_this) {
return cPhs_ERROR_e;
}
// a_this->mCrrPos.Set(&a_this->current.pos, &a_this->next.pos, NULL, );
a_this->mCrrPos.mpLine0 = &a_this->current.pos;
a_this->mCrrPos.pm_pos = &a_this->next.pos;
a_this->mCrrPos.field_0x58 = NULL;
a_this->mCrrPos.SetActorPid(fpcM_ERROR_PROCESS_ID_e);
a_this->mCrrPos.field_0x3c = 171.0f;
a_this->mCrrPos.field_0x40 = 50.0f;
a_this->mCrrPos.Set(&fopAcM_GetPosition_p(a_this), &fopAcM_GetOldPosition_p(a_this), (void*)NULL, NULL);
a_this->mCrrPos.SetWall(171.0f, 50.0f);
a_this->mCrrPos.SetGndUpY(170.0f);
a_this->mCrrPos.ClrNoRoof();
a_this->mAcch.Set(&a_this->current.pos, &a_this->next.pos, a_this, 1, &a_this->mAcchCir);
a_this->mAcch.Set(&fopAcM_GetPosition_p(a_this), &fopAcM_GetOldPosition_p(a_this), a_this, 1, &a_this->mAcchCir);
a_this->mAcch.OnLineCheck();
a_this->mAcch.SetGrndNone();
a_this->mAcchCir.SetWall(171.01f, 40.0f);
a_this->mAcchCir.SetWall(171.0f, 40.0f);
TestDataManager[4].field_0x0 = (u32)&daAgb_c::mGbaFlg;
TestDataManager[8].field_0x0 = (u32)&daAgb_c::mSwitch;
+1 -1
View File
@@ -262,7 +262,7 @@ namespace daObjMovebox {
M_wall_work[i].Set(&temp_44, &temp_38, (fopAc_ac_c*)movebox);
M_wall_work[i].SetActorPid(movebox->mBase.mBsPcId);
if (dComIfG_Bgsp()->LineCross(&M_wall_work[i])) {
mWallPos[i] = M_wall_work[i].i_GetCross();
mWallPos[i] = M_wall_work[i].GetCross();
f32 dist = temp_44.abs2(mWallPos[i]);
if (dist < mNearestWallDist) {
mNearestWallDist = dist;
+75 -3
View File
@@ -9,6 +9,11 @@
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor_mng.h"
#define CHECK_FLOAT_CLASS(line, x) JUT_ASSERT(line, !(((sizeof(x) == sizeof(float)) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)) ) == 1));
#define CHECK_FLOAT_RANGE(line, x) JUT_ASSERT(line, -1.0e32f < x && x < 1.0e32f);
#define CHECK_VEC3_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)
#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)
/* 800A0270-800A0290 .text Ct__4dBgSFv */
void dBgS::Ct() {
cBgS::Ct();
@@ -349,7 +354,7 @@ void dBgS::WallCorrect(dBgS_Acch* acch) {
/* 800A13E0-800A14FC .text RoofChk__4dBgSFP12dBgS_RoofChk */
f32 dBgS::RoofChk(dBgS_RoofChk* chk) {
chk->SetNowY(1e+09);
chk->SetNowY(1e+09f);
chk->ClearPi();
cBgS_ChkElm* elm;
for (s32 bg_index = 0; bg_index < (s32)ARRAY_SIZE(m_chk_element); bg_index++) {
@@ -540,8 +545,75 @@ fopAc_ac_c* dBgS::PushPullCallBack(cBgS_PolyInfo& polyInfo, fopAc_ac_c* ac, s16
}
/* 800A1FD8-800A2550 .text CrrPos__11dBgS_CrrPosFR4dBgS */
void dBgS_CrrPos::CrrPos(dBgS&) {
/* Nonmatching */
void dBgS_CrrPos::CrrPos(dBgS& i_bgs) {
if (mFlag & 1)
return;
ClrWallHit();
ClrXCrr();
ClrZCrr();
CHECK_PVEC3_RANGE(2280, pm_pos);
if (!(mFlag & 4)) {
f32 dist2 = GetOldPos()->abs2(*pm_pos);
bool inWall = false;
if (dist2 > (0.65f*0.65f * GetWallR()*GetWallR())) {
inWall = true;
cBgS_LinChk linChk;
cXyz startPos(*pm_old_pos);
cXyz endPos(*pm_pos);
startPos.y += GetWallH();
endPos.y += GetWallH();
linChk.Set2(&startPos, &endPos, GetActorPid());
linChk.SetExtChk(*this);
linChk.SetSttsGroundOff();
if (i_bgs.LineCross(&linChk)) {
*pm_pos = linChk.GetCross();
cM3dGPla* plane = i_bgs.GetTriPla(linChk.GetBgIndex(), linChk.GetPolyIndex());
pm_pos->x += plane->GetNP()->x;
pm_pos->y += plane->GetNP()->y - mWallHeight;
pm_pos->z += plane->GetNP()->z;
}
}
if (i_bgs.WallCrrPos(this) && inWall) {
cBgS_LinChk linChk;
cXyz startPos(*pm_old_pos);
cXyz endPos(*pm_pos);
startPos.y += mWallHeight;
endPos.y += mWallHeight;
linChk.Set2(&startPos, &endPos, GetActorPid());
linChk.SetExtChk(*this);
linChk.SetSttsGroundOff();
if (i_bgs.LineCross(&linChk)) {
*pm_pos = linChk.GetCross();
cM3dGPla* plane = i_bgs.GetTriPla(linChk.GetBgIndex(), linChk.GetPolyIndex());
pm_pos->x += plane->GetNP()->x;
pm_pos->y += plane->GetNP()->y - mWallHeight;
pm_pos->z += plane->GetNP()->z;
}
}
}
if (!(mFlag & 2)) {
field_0x60 = 0;
mGndChk.SetExtChk(*this);
cXyz pos = *pm_pos;
pos.y += mGndUpY;
mGndChk.SetPos(&pos);
f32 f31 = pm_pos->y;
mGroundH = i_bgs.GroundCross(&mGndChk);
if (mGroundH != -1e+09f && mGroundH > f31) {
pm_pos->y = mGroundH;
if (field_0x58) {
field_0x58->y = 0.0f;
}
field_0x60 = 1;
}
}
}
/* 800A2550-800A257C .text MatrixCrrPos__4dBgWFR13cBgS_PolyInfoPvbP4cXyzP5csXyzP5csXyz */