mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 05:02:12 -04: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:
+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 */
|
||||
|
||||
Reference in New Issue
Block a user