mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Fix more nonmatchings (#2850)
* Fix GetPolyIndex and GetBgIndex, fixing a couple regallocs * Match daNpcCd2_c::checkFearSituation and daNpcCd2_c::getAnmP * Match daAlink_c::jointControll * Clean up float class checks * Move float constants to global.h
This commit is contained in:
+2
-2
@@ -684,7 +684,7 @@ config.libs = [
|
||||
Object(MatchingFor(ALL_GCN), "d/actor/d_a_no_chg_room.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_npc.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "d/actor/d_a_npc_cd.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_npc_cd2.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_npc_cd2.cpp"), # stripped vtable order
|
||||
Object(MatchingFor(ALL_GCN), "d/actor/d_a_obj_item.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "d/d_insect.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "d/actor/d_a_obj_ss_base.cpp"),
|
||||
@@ -1836,7 +1836,7 @@ config.libs = [
|
||||
ActorRel(NonMatching, "d_a_horse"),
|
||||
ActorRel(NonMatching, "d_a_hozelda"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_izumi_gate"),
|
||||
ActorRel(NonMatching, "d_a_kago"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_kago"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag01"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag02"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag03"),
|
||||
|
||||
@@ -23,8 +23,8 @@ public:
|
||||
|
||||
virtual ~cBgS_PolyInfo();
|
||||
|
||||
u16 GetPolyIndex() const { return mPolyIndex; }
|
||||
u16 GetBgIndex() const { return mBgIndex; }
|
||||
int GetPolyIndex() const { return mPolyIndex; }
|
||||
int GetBgIndex() const { return mBgIndex; }
|
||||
}; // Size: 0x10
|
||||
|
||||
#endif /* C_BG_S_POLY_INFO_H */
|
||||
|
||||
@@ -228,35 +228,4 @@ private:
|
||||
|
||||
STATIC_ASSERT(sizeof(daKago_c) == 0xBA4);
|
||||
|
||||
class daKago_HIO_c : public JORReflexible {
|
||||
public:
|
||||
/* 808495AC */ daKago_HIO_c();
|
||||
/* 80854A4C */ virtual ~daKago_HIO_c() {}
|
||||
|
||||
void genMessage(JORMContext* ctx);
|
||||
|
||||
/* 0x04 */ s8 mChild;
|
||||
/* 0x08 */ f32 mRevoconUpDown;
|
||||
/* 0x0C */ f32 mRevoconUpDownMax;
|
||||
/* 0x10 */ f32 mRevoconLeftRight;
|
||||
/* 0x14 */ f32 mRevoconLeftRightMax;
|
||||
/* 0x18 */ f32 mBasicSize;
|
||||
/* 0x1C */ f32 mFlightSpeed;
|
||||
/* 0x20 */ f32 mFlightGroundAltitude;
|
||||
/* 0x24 */ f32 mFlightCeilingAltitude;
|
||||
/* 0x28 */ f32 mShadowDensity;
|
||||
/* 0x2C */ f32 mDescentRateIncrement;
|
||||
/* 0x30 */ f32 mAscentRateDecel;
|
||||
/* 0x34 */ f32 mDashTime;
|
||||
/* 0x38 */ f32 mDashTimeMultiplier;
|
||||
/* 0x3C */ f32 mWallHitInvulnTime;
|
||||
/* 0x40 */ f32 mDashCooldownTime;
|
||||
/* 0x44 */ f32 mZOffset;
|
||||
/* 0x48 */ f32 mZOffsetHori;
|
||||
/* 0x4C */ u8 mAngleTrackingMode;
|
||||
/* 0x50 */ f32 mYOffsetFromWaterSurface;
|
||||
/* 0x54 */ f32 mWaterSplashTime;
|
||||
/* 0x58 */ f32 mSplashGenTimeDuringDash;
|
||||
};
|
||||
|
||||
#endif /* D_A_KAGO_H */
|
||||
|
||||
+2
-2
@@ -30,13 +30,13 @@ public:
|
||||
u32 getHSStick() const { return BGPC_CHECK_BIT(m_code.code0, 18); }
|
||||
u32 getBoomerangThrough() const { return BGPC_CHECK_BIT(m_code.code0, 19); }
|
||||
u32 getRopeThrough() const { return BGPC_CHECK_BIT(m_code.code0, 20); }
|
||||
u32 getHorseNoEntry() const { return BGPC_CHECK_BIT(m_code.code0, 21) != 0; }
|
||||
u32 getHorseNoEntry() const { return BGPC_CHECK_BIT(m_code.code0, 21); }
|
||||
u32 getShdwThrough() const { return BGPC_CHECK_BIT(m_code.code0, 22); }
|
||||
u32 getBombThrough() const { return BGPC_CHECK_BIT(m_code.code0, 23); }
|
||||
s32 getSpl() const { return BGPC_GET_BITS(m_code.code0, 24, 4); }
|
||||
u32 getMagnet() const { return BGPC_GET_BITS(m_code.code0, 28, 2); }
|
||||
u32 getUnderwaterRoof() const { return BGPC_CHECK_BIT(m_code.code0, 30); }
|
||||
u32 getMonkeyBars() const { return BGPC_CHECK_BIT(m_code.code0, 31) != 0; }
|
||||
u32 getMonkeyBars() const { return (m_code.code0 >> 31) & 1; }
|
||||
|
||||
s32 getLinkNo() const { return BGPC_GET_BITS(m_code.code1, 0, 8); }
|
||||
s32 getWallCode() const { return BGPC_GET_BITS(m_code.code1, 8, 4); }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define D_BG_D_BG_S_CAPT_POLY_H
|
||||
|
||||
#include "d/d_bg_s_chk.h"
|
||||
#include "SSystem/SComponent/c_m3d_g_aab.h"
|
||||
|
||||
struct dBgS_CaptPoly;
|
||||
|
||||
@@ -15,4 +16,4 @@ public:
|
||||
/* 0x48 */ CaptPolyCallback m_callback;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -72,15 +72,6 @@
|
||||
#define nofralloc
|
||||
#endif
|
||||
|
||||
// floating-point constants
|
||||
// TODO: move to different header
|
||||
#define _HUGE_ENUF 1e+300
|
||||
#define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF))
|
||||
#define HUGE_VAL ((double)INFINITY)
|
||||
#define HUGE_VALL ((long double)INFINITY)
|
||||
|
||||
#define DOUBLE_INF HUGE_VAL
|
||||
|
||||
#pragma section ".dead"
|
||||
#pragma section ".ctors$10"
|
||||
#pragma section ".ctors$15"
|
||||
|
||||
@@ -75,6 +75,14 @@ void* __memcpy(void*, const void*, int);
|
||||
|
||||
#define SQUARE(x) ((x) * (x))
|
||||
|
||||
// floating-point constants
|
||||
#define _HUGE_ENUF 1e+300
|
||||
#define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF))
|
||||
#define HUGE_VAL ((double)INFINITY)
|
||||
#define HUGE_VALL ((long double)INFINITY)
|
||||
#define DOUBLE_INF HUGE_VAL
|
||||
static const float INF = 2000000000.0f;
|
||||
|
||||
// hack to make strings with no references compile properly
|
||||
#define DEAD_STRING(s) OSReport(s)
|
||||
|
||||
|
||||
@@ -240,9 +240,9 @@ void JUTException::setFPException(u32 fpscr_enable_bits) {
|
||||
|
||||
/* 802E22C4-802E2454 2DCC04 0190+00 1/1 0/0 0/0 .text showFloatSub__12JUTExceptionFif */
|
||||
void JUTException::showFloatSub(int index, f32 value) {
|
||||
if (fpclassify(value) == FP_NAN) {
|
||||
if (isnan(value)) {
|
||||
sConsole->print_f("F%02d: Nan ", index);
|
||||
} else if (fpclassify(value) == FP_INFINITE) {
|
||||
} else if (isinf(value)) {
|
||||
if (__signbit(value)) {
|
||||
sConsole->print_f("F%02d:+Inf ", index);
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
(sizeof(x) == sizeof(double)) ? __fpclassifyd((double)(x)) : \
|
||||
__fpclassifyl((long double)(x)) )
|
||||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > 2))
|
||||
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
|
||||
#define isnan(x) (fpclassify(x) == FP_NAN)
|
||||
#define isinf(x) (fpclassify(x) == FP_INFINITE)
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ inline float sqrtf(float mag) {
|
||||
return mag * tmpd;
|
||||
} else if (mag < 0.0) {
|
||||
return NAN;
|
||||
} else if (fpclassify(mag) == 1) {
|
||||
} else if (isnan(mag)) {
|
||||
return NAN;
|
||||
} else {
|
||||
return mag;
|
||||
|
||||
@@ -522,7 +522,7 @@ void __num2dec_internal(decimal* d, double x) {
|
||||
d->sign = sign;
|
||||
d->exp = 0;
|
||||
d->sig.length = 1;
|
||||
d->sig.text[0] = fpclassify(x) == 1 ? 'N' : 'I';
|
||||
d->sig.text[0] = isnan(x)? 'N' : 'I';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -570,4 +570,4 @@ void __num2dec(const decform* form, double x, decimal* d) {
|
||||
for (i = 0; i < d->sig.length; i++) {
|
||||
d->sig.text[i] += '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1923,19 +1923,17 @@ void daAlink_c::setMatrixWorldAxisRot(MtxP param_0, s16 param_1, s16 param_2, s1
|
||||
}
|
||||
|
||||
/* 8009DD90-8009E7B8 0986D0 0A28+00 2/2 0/0 0/0 .text jointControll__9daAlink_cFi */
|
||||
// NONMATCHING - 0x20 bytes missing from stack at 0x58 (release)/0x60 (debug)
|
||||
int daAlink_c::jointControll(int param_0) {
|
||||
csXyz sp18(0, 0, 0);
|
||||
int var_r27 = 0;
|
||||
|
||||
mDoExt_MtxCalcOldFrame* temp = field_0x2060;
|
||||
J3DTransformInfo* temp_r3 = temp->getOldFrameTransInfo(param_0);
|
||||
J3DTransformInfo sp80 = *temp_r3;
|
||||
J3DTransformInfo sp80;
|
||||
J3DTransformInfo sp60 = *field_0x2060->getOldFrameTransInfo(param_0);
|
||||
|
||||
Quaternion sp50;
|
||||
Quaternion sp40;
|
||||
Quaternion sp30;
|
||||
Quaternion sp20 = *temp->getOldFrameQuaternion(param_0);
|
||||
Quaternion sp20 = *field_0x2060->getOldFrameQuaternion(param_0);
|
||||
|
||||
csXyz sp10(0, 1, 2);
|
||||
|
||||
@@ -2114,7 +2112,7 @@ int daAlink_c::jointControll(int param_0) {
|
||||
spC = field_0x2060->getOldFrameQuaternion(param_0);
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::transS(sp80.mTranslate.x, sp80.mTranslate.y, sp80.mTranslate.z);
|
||||
mDoMtx_stack_c::transS(sp60.mTranslate.x, sp60.mTranslate.y, sp60.mTranslate.z);
|
||||
mDoMtx_stack_c::quatM(&sp20);
|
||||
mDoMtx_stack_c::inverse();
|
||||
cMtx_concat(temp_r26, mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
|
||||
|
||||
@@ -1027,7 +1027,7 @@ void daAlink_c::setBaseBoarAnime() {
|
||||
void daAlink_c::setBaseRideAnime() {
|
||||
if (checkHorseRide()) {
|
||||
daHorse_c* horse_p = dComIfGp_getHorseActor();
|
||||
daAlink_ANM sp8[2];
|
||||
daAlink_ANM sp8[3];
|
||||
getBaseHorseAnime(sp8);
|
||||
setDoubleAnime(horse_p->getBlendRate(), 1.0f, 1.0f, sp8[0], sp8[1], 10,
|
||||
horse_p->getMorfFrame());
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
|
||||
namespace {
|
||||
/* 80854D4C-80854D8C 000000 0040+00 1/1 0/0 0/0 .data cc_sph_src__22@unnamed@d_a_kago_cpp@ */
|
||||
static dCcD_SrcSph cc_sph_src = {
|
||||
{
|
||||
@@ -34,6 +35,38 @@ static dCcD_SrcSph cc_sph_src = {
|
||||
{{0.0f, 0.0f, 0.0f}, 80.0f} // mSph
|
||||
} // mSphAttr
|
||||
};
|
||||
}; // namespace
|
||||
|
||||
class daKago_HIO_c : public JORReflexible {
|
||||
public:
|
||||
/* 808495AC */ daKago_HIO_c();
|
||||
/* 80854A4C */ virtual ~daKago_HIO_c() {}
|
||||
|
||||
void genMessage(JORMContext* ctx);
|
||||
|
||||
/* 0x04 */ s8 mChild;
|
||||
/* 0x08 */ f32 mRevoconUpDown;
|
||||
/* 0x0C */ f32 mRevoconUpDownMax;
|
||||
/* 0x10 */ f32 mRevoconLeftRight;
|
||||
/* 0x14 */ f32 mRevoconLeftRightMax;
|
||||
/* 0x18 */ f32 mBasicSize;
|
||||
/* 0x1C */ f32 mFlightSpeed;
|
||||
/* 0x20 */ f32 mFlightGroundAltitude;
|
||||
/* 0x24 */ f32 mFlightCeilingAltitude;
|
||||
/* 0x28 */ f32 mShadowDensity;
|
||||
/* 0x2C */ f32 mDescentRateIncrement;
|
||||
/* 0x30 */ f32 mAscentRateDecel;
|
||||
/* 0x34 */ f32 mDashTime;
|
||||
/* 0x38 */ f32 mDashTimeMultiplier;
|
||||
/* 0x3C */ f32 mWallHitInvulnTime;
|
||||
/* 0x40 */ f32 mDashCooldownTime;
|
||||
/* 0x44 */ f32 mZOffset;
|
||||
/* 0x48 */ f32 mZOffsetHori;
|
||||
/* 0x4C */ u8 mAngleTrackingMode;
|
||||
/* 0x50 */ f32 mYOffsetFromWaterSurface;
|
||||
/* 0x54 */ f32 mWaterSplashTime;
|
||||
/* 0x58 */ f32 mSplashGenTimeDuringDash;
|
||||
};
|
||||
|
||||
/* 808495AC-80849660 0000EC 00B4+00 1/1 0/0 0/0 .text __ct__12daKago_HIO_cFv */
|
||||
daKago_HIO_c::daKago_HIO_c() {
|
||||
@@ -249,7 +282,6 @@ static u8 l_HIOInit;
|
||||
static daKago_HIO_c l_HIO;
|
||||
|
||||
/* 80849BA8-8084A070 0006E8 04C8+00 4/4 0/0 0/0 .text checkGroundHeight__8daKago_cF4cXyzPf */
|
||||
// NONMATCHING - fpr regalloc
|
||||
f32 daKago_c::checkGroundHeight(cXyz i_pos, f32* o_step) {
|
||||
f32 retVal;
|
||||
|
||||
@@ -366,7 +398,6 @@ f32 daKago_c::checkGroundHeight(cXyz i_pos, f32* o_step) {
|
||||
}
|
||||
|
||||
/* 8084A070-8084A210 000BB0 01A0+00 4/4 0/0 0/0 .text checkRoofHeight__8daKago_cF4cXyz */
|
||||
// NONMATCHING - regalloc
|
||||
f32 daKago_c::checkRoofHeight(cXyz param_0) {
|
||||
f32 roofChkYVal = mRoofHeight;
|
||||
BOOL unkFlag1 = FALSE;
|
||||
|
||||
+28
-23
@@ -388,6 +388,8 @@ static anmTblPrm const l_btpTWTbl[30] = {
|
||||
l_resMATa2[1], -1, l_resWCNa2[1], 7, l_resWONa2[1], 7, l_resWGNa2[1], 7, l_resWANb2[1], 7,
|
||||
};
|
||||
|
||||
// TODO: these four tables should be converted into proper structs instead of byte arrays
|
||||
|
||||
/* 803B6604-803B7DC4 013724 17C0+00 0/1 0/0 0/0 .data a_jntTbl_M$3910 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
@@ -1391,8 +1393,10 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 0x17:
|
||||
case 0x1b:
|
||||
case 0x1f:
|
||||
switch (param_2) {
|
||||
case 1:
|
||||
case 8:
|
||||
@@ -1416,11 +1420,11 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 0x17:
|
||||
case 0x1b:
|
||||
case 0x1f:
|
||||
switch (param_2) {
|
||||
case 7:
|
||||
case 0x18:
|
||||
case 0x1c:
|
||||
case 0x20:
|
||||
switch (param_2) {
|
||||
case 1:
|
||||
case 8:
|
||||
a_anmNum = 0x20;
|
||||
@@ -1443,10 +1447,8 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 0x18:
|
||||
case 0x1c:
|
||||
case 0x20:
|
||||
case 4:
|
||||
case 5:
|
||||
switch(param_2) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -1489,6 +1491,17 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
switch(param_2) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
a_anmNum = 0x22;
|
||||
@@ -1883,21 +1896,13 @@ daTagEscape_c* daNpcCd2_c::getEscapeTag() {
|
||||
|
||||
/* 80159818-801598E8 154158 00D0+00 0/0 0/0 5/5 .text checkFearSituation__10daNpcCd2_cFv
|
||||
*/
|
||||
// NONMATCHING - r30 needs to be assigned to r4 and r5
|
||||
bool daNpcCd2_c::checkFearSituation() {
|
||||
f32 dVar10 =
|
||||
fopAcM_GetPosition_p(this)->y - fopAcM_GetPosition_p(daPy_getPlayerActorClass())->y;
|
||||
bool rv;
|
||||
bool bVar5;
|
||||
rv = false;
|
||||
bVar5 = ((!mIsDarkWorld && daPy_py_c::checkNowWolf()) && dVar10 < 200.0f);
|
||||
if (bVar5) {
|
||||
f32 maxDist = pow(500.0f, 2.0f);
|
||||
if (fopAcM_searchPlayerDistanceXZ2(this) < maxDist) {
|
||||
rv = true;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
return !mIsDarkWorld &&
|
||||
daPy_py_c::checkNowWolf() &&
|
||||
dVar10 < 200.0f &&
|
||||
fopAcM_searchPlayerDistanceXZ2(this) < std::pow(500.0f, 2.0f);
|
||||
}
|
||||
|
||||
/* 801598E8-8015994C 154228 0064+00 1/1 0/0 0/0 .text getNpcMdlDataP__10daNpcCd2_cFi */
|
||||
|
||||
@@ -3693,7 +3693,6 @@ bool daObjCarry_c::cc_damage_proc_kibako() {
|
||||
}
|
||||
|
||||
/* 80476CE4-80476E04 007D64 0120+00 1/0 0/0 0/0 .text cc_damage_proc_ironball__12daObjCarry_cFv */
|
||||
// NONMATCHING - regalloc, equivalent
|
||||
bool daObjCarry_c::cc_damage_proc_ironball() {
|
||||
bool var_r26 = false;
|
||||
bool var_r27 = true;
|
||||
|
||||
@@ -341,10 +341,6 @@ int daObjRIVERROCK_c::Delete() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// /* 80CBD9C4-80CBDA0C 0013E4 0048+00 2/1 0/0 0/0 .text __dt__20daObjRIVERROCK_HIO_cFv */
|
||||
// daObjRIVERROCK_HIO_c::~daObjRIVERROCK_HIO_c() {
|
||||
// }
|
||||
|
||||
/* 80CBDB44-80CBDB64 -00001 0020+00 1/0 0/0 0/0 .data l_daObjRIVERROCK_Method */
|
||||
static actor_method_class l_daObjRIVERROCK_Method = {
|
||||
(process_method_func)daObjRIVERROCK_Create,
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_s_play.h"
|
||||
|
||||
// NONMATCHING - dEvLib_callback_c issues
|
||||
|
||||
/* 80CFD1DC-80CFD1F0 000000 0014+00 4/4 0/0 0/0 .rodata l_bmdIdx */
|
||||
static u32 const l_bmdIdx[5] = {
|
||||
4, 4, 4, 4, 4,
|
||||
|
||||
+21
-18
@@ -537,11 +537,12 @@ s32 dBgS::GetRoomPathPntNo(cBgS_PolyInfo const& poly) {
|
||||
/* 80075080-800750D0 06F9C0 0050+00 0/0 2/2 0/0 .text GetGrpSoundId__4dBgSFRC13cBgS_PolyInfo */
|
||||
int dBgS::GetGrpSoundId(cBgS_PolyInfo const& poly) {
|
||||
int bg_index = poly.GetBgIndex();
|
||||
if (m_chk_element[bg_index].ChkUsed()) {
|
||||
return m_chk_element[bg_index].m_bgw_base_ptr->GetGrpSoundId(poly);
|
||||
JUT_ASSERT(1761, 0 <= bg_index && bg_index < 256);
|
||||
if (!m_chk_element[bg_index].ChkUsed()) {
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
return 0xFF;
|
||||
dBgW_Base* r30 = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
return r30->GetGrpSoundId(poly);
|
||||
}
|
||||
|
||||
/* 800750D0-80075100 06FA10 0030+00 0/0 1/1 0/0 .text ChkGrpInf__4dBgSFRC13cBgS_PolyInfoUl */
|
||||
@@ -576,21 +577,23 @@ s32 dBgS::GetRoomId(cBgS_PolyInfo const& poly) {
|
||||
* GetPolyAttackThrough__4dBgSFRC13cBgS_PolyInfo */
|
||||
bool dBgS::GetPolyAttackThrough(cBgS_PolyInfo const& poly) {
|
||||
int bg_index = poly.GetBgIndex();
|
||||
if (m_chk_element[bg_index].ChkUsed()) {
|
||||
return m_chk_element[bg_index].m_bgw_base_ptr->GetAttackThrough(poly.GetPolyIndex()) != 0;
|
||||
JUT_ASSERT(1894, 0 <= bg_index && bg_index < 256);
|
||||
if (!m_chk_element[bg_index].ChkUsed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
dBgW_Base* r30 = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
return r30->GetAttackThrough(poly.GetPolyIndex()) != 0;
|
||||
}
|
||||
|
||||
/* 800751F8-8007524C 06FB38 0054+00 0/0 1/1 0/0 .text ChkPolyHSStick__4dBgSFRC13cBgS_PolyInfo */
|
||||
u32 dBgS::ChkPolyHSStick(cBgS_PolyInfo const& poly) {
|
||||
int bg_index = poly.GetBgIndex();
|
||||
if (m_chk_element[bg_index].ChkUsed()) {
|
||||
return m_chk_element[bg_index].m_bgw_base_ptr->GetPolyHSStick(poly.GetPolyIndex());
|
||||
JUT_ASSERT(1912, 0 <= bg_index && bg_index < 256);
|
||||
if (!m_chk_element[bg_index].ChkUsed()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
dBgW_Base* r30 = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
return r30->GetPolyHSStick(poly.GetPolyIndex());
|
||||
}
|
||||
|
||||
/* 8007524C-80075374 06FB8C 0128+00 0/0 1/1 0/0 .text WallCorrect__4dBgSFP9dBgS_Acch */
|
||||
@@ -831,7 +834,7 @@ void dBgS_MoveBGProc_Trans(dBgW* i_bgw, void* i_actor_ptr, cBgS_PolyInfo const&
|
||||
/* 80075B84-80075BF4 0704C4 0070+00 0/0 1/1 2/2 .text
|
||||
* RideCallBack__4dBgSFRC13cBgS_PolyInfoP10fopAc_ac_c */
|
||||
void dBgS::RideCallBack(cBgS_PolyInfo const& poly, fopAc_ac_c* param_1) {
|
||||
u16 bg_index = poly.GetBgIndex();
|
||||
int bg_index = poly.GetBgIndex();
|
||||
dBgW_Base* base = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
if (base->ChkUsed()) {
|
||||
base->CallRideCallBack(m_chk_element[bg_index].m_actor_ptr, param_1);
|
||||
@@ -841,7 +844,7 @@ void dBgS::RideCallBack(cBgS_PolyInfo const& poly, fopAc_ac_c* param_1) {
|
||||
/* 80075BF4-80075C6C 070534 0078+00 0/0 0/0 2/2 .text
|
||||
* ArrowStickCallBack__4dBgSFRC13cBgS_PolyInfoP10fopAc_ac_cR4cXyz */
|
||||
void dBgS::ArrowStickCallBack(cBgS_PolyInfo const& poly, fopAc_ac_c* param_1, cXyz& param_2) {
|
||||
u16 bg_index = poly.GetBgIndex();
|
||||
int bg_index = poly.GetBgIndex();
|
||||
dBgW_Base* base = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
if (base->ChkUsed()) {
|
||||
base->CallArrowStickCallBack(m_chk_element[bg_index].m_actor_ptr, param_1, param_2);
|
||||
@@ -852,18 +855,18 @@ void dBgS::ArrowStickCallBack(cBgS_PolyInfo const& poly, fopAc_ac_c* param_1, cX
|
||||
* PushPullCallBack__4dBgSFRC13cBgS_PolyInfoP10fopAc_ac_csQ29dBgW_Base13PushPullLabel */
|
||||
fopAc_ac_c* dBgS::PushPullCallBack(cBgS_PolyInfo const& param_0, fopAc_ac_c* i_pushActor, s16 i_angle,
|
||||
dBgW_Base::PushPullLabel i_label) {
|
||||
u16 bg_index = param_0.GetBgIndex();
|
||||
int bg_index = param_0.GetBgIndex();
|
||||
dBgW_Base* base = m_chk_element[bg_index].m_bgw_base_ptr;
|
||||
if (!base->ChkUsed()) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (m_chk_element[bg_index].m_actor_ptr == NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (base->GetPushPullCallback() == NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return base->GetPushPullCallback()(m_chk_element[bg_index].m_actor_ptr, i_pushActor, i_angle,
|
||||
|
||||
+28
-17
@@ -328,9 +328,9 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
|
||||
JUT_ASSERT(792, pm_pos != NULL);
|
||||
JUT_ASSERT(793, pm_old_pos != NULL);
|
||||
|
||||
JUT_ASSERT(833, fpclassify(pm_pos->x) == 1);
|
||||
JUT_ASSERT(834, fpclassify(pm_pos->y) == 1);
|
||||
JUT_ASSERT(835, fpclassify(pm_pos->z) == 1);
|
||||
JUT_ASSERT(833, !isnan(pm_pos->x));
|
||||
JUT_ASSERT(834, !isnan(pm_pos->y));
|
||||
JUT_ASSERT(835, !isnan(pm_pos->z));
|
||||
|
||||
JUT_ASSERT(837, -1.0e32f < pm_pos->x && pm_pos->x < 1.0e32f);
|
||||
JUT_ASSERT(838, -1.0e32f < pm_pos->y);
|
||||
@@ -405,7 +405,7 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
|
||||
m_roof_height = i_bgs.RoofChk(&m_roof);
|
||||
|
||||
if (m_roof_height != G_CM3D_F_INF) {
|
||||
f32 y = GetPos()->y;
|
||||
f32 y = pm_pos->y;
|
||||
|
||||
if (y + m_roof_crr_height > m_roof_height) {
|
||||
field_0xcc = m_roof_height - m_roof_crr_height;
|
||||
@@ -419,8 +419,8 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
|
||||
GroundCheck(i_bgs);
|
||||
GroundRoofProc(i_bgs);
|
||||
} else {
|
||||
if (field_0xcc < GetPos()->y) {
|
||||
GetPos()->y = field_0xcc;
|
||||
if (field_0xcc < pm_pos->y) {
|
||||
pm_pos->y = field_0xcc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,42 +430,53 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) {
|
||||
m_wtr.SetHeight(-G_CM3D_F_INF);
|
||||
|
||||
f32 var_f29;
|
||||
f32 var_f30;
|
||||
f32 top;
|
||||
|
||||
f32 temp_f1_5 = m_ground_h;
|
||||
if (temp_f1_5 == -G_CM3D_F_INF) {
|
||||
var_f29 = GetPos()->y - 50.0f;
|
||||
var_f29 = pm_pos->y - 50.0f;
|
||||
} else {
|
||||
var_f29 = temp_f1_5;
|
||||
}
|
||||
|
||||
if (m_wtr_mode == 1) {
|
||||
var_f30 = var_f29 + m_wtr_chk_offset;
|
||||
top = var_f29 + m_wtr_chk_offset;
|
||||
} else {
|
||||
dBgS_RoofChk roof_chk;
|
||||
roof_chk.SetUnderwaterRoof();
|
||||
roof_chk.SetPos(*pm_pos);
|
||||
|
||||
var_f30 = i_bgs.RoofChk(&roof_chk);
|
||||
if (var_f30 == G_CM3D_F_INF) {
|
||||
var_f30 = GetPos()->y + 1000000.0f;
|
||||
top = i_bgs.RoofChk(&roof_chk);
|
||||
if (top == G_CM3D_F_INF) {
|
||||
top = pm_pos->y + 1000000.0f;
|
||||
}
|
||||
}
|
||||
|
||||
cXyz wtr_pos;
|
||||
wtr_pos = *pm_pos;
|
||||
wtr_pos.y = var_f29;
|
||||
cXyz ground;
|
||||
ground = *pm_pos;
|
||||
ground.y = var_f29;
|
||||
|
||||
m_wtr.Set(wtr_pos, var_f30);
|
||||
m_wtr.Set(ground, top);
|
||||
m_wtr.SetPassChkInfo(*this);
|
||||
|
||||
if (i_bgs.WaterChk(&m_wtr)) {
|
||||
SetWaterHit();
|
||||
if (m_wtr.GetHeight() > GetPos()->y) {
|
||||
if (m_wtr.GetHeight() > pm_pos->y) {
|
||||
SetWaterIn();
|
||||
}
|
||||
|
||||
JUT_ASSERT(1095, m_wtr.GetHeight() >= ground.y);
|
||||
JUT_ASSERT(1096, m_wtr.GetHeight() <= top);
|
||||
}
|
||||
}
|
||||
|
||||
JUT_ASSERT(1124, !isnan(pm_pos->x));
|
||||
JUT_ASSERT(1125, !isnan(pm_pos->y));
|
||||
JUT_ASSERT(1126, !isnan(pm_pos->z));
|
||||
|
||||
JUT_ASSERT(1128, -1.0e32f < pm_pos->x && pm_pos->x < 1.0e32f);
|
||||
JUT_ASSERT(1129, -1.0e32f < pm_pos->y && pm_pos->y < 1.0e32f);
|
||||
JUT_ASSERT(1130, -1.0e32f < pm_pos->z && pm_pos->z < 1.0e32f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user