d_a_bridge OK, cXyz inline cleanup

This commit is contained in:
LagoLunatic
2026-08-24 14:34:25 -04:00
parent afa5b9ca56
commit 0195ac864a
19 changed files with 126 additions and 130 deletions
+1 -1
View File
@@ -1429,7 +1429,7 @@ config.libs = [
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_bflower"),
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_bita"),
ActorRel(Matching, "d_a_branch"),
ActorRel(NonMatching, "d_a_bridge"),
ActorRel(Matching, "d_a_bridge"),
ActorRel(Matching, "d_a_coming2"),
ActorRel(Matching, "d_a_coming3"),
ActorRel(Matching, "d_a_demo_dk"),
+16 -5
View File
@@ -10,11 +10,22 @@
class J3DLightInfo {
public:
void operator=(J3DLightInfo const& other) {
mLightPosition = other.mLightPosition;
mLightDirection = other.mLightDirection;
mColor = other.mColor;
mCosAtten = other.mCosAtten;
mDistAtten = other.mDistAtten;
mLightPosition.x = other.mLightPosition.x;
mLightPosition.y = other.mLightPosition.y;
mLightPosition.z = other.mLightPosition.z;
mLightDirection.x = other.mLightDirection.x;
mLightDirection.y = other.mLightDirection.y;
mLightDirection.z = other.mLightDirection.z;
mColor.r = other.mColor.r;
mColor.g = other.mColor.g;
mColor.b = other.mColor.b;
mColor.a = other.mColor.a;
mCosAtten.x = other.mCosAtten.x;
mCosAtten.y = other.mCosAtten.y;
mCosAtten.z = other.mCosAtten.z;
mDistAtten.x = other.mDistAtten.x;
mDistAtten.y = other.mDistAtten.y;
mDistAtten.z = other.mDistAtten.z;
}
/* 0x00 */ Vec mLightPosition;
-1
View File
@@ -99,7 +99,6 @@ public:
// Type 1: Xlu Buffer
void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
J3D_ASSERT(114, type >= 0 && type < 2, "Error : range over.");
J3D_ASSERT(115, buffer, "Error : null pointer.");
mDrawBuffer[type] = buffer;
}
+20 -19
View File
@@ -46,33 +46,37 @@ struct cXyz : Vec {
y = vec.y;
z = vec.z;
}
// void operator=(const cXyz&);
cXyz operator+(const Vec&) const;
cXyz operator-(const Vec&) const;
cXyz operator*(f32) const;
cXyz operator*(const Vec&) const;
cXyz operator/(f32) const;
// void operator=(const cXyz&);
void operator+=(f32 f) {
x += f;
y += f;
z += f;
}
void operator-=(f32 f) {
x -= f;
y -= f;
z -= f;
}
void operator-=(const Vec& other) { VECSubtract(this, &other, this); }
cXyz* operator+=(const Vec& other) {
VECAdd(this, &other, this);
cXyz* operator*=(f32 scale) {
VECScale(this, this, scale);
return this;
}
void operator*=(f32 scale) { VECScale(this, this, scale); }
cXyz* operator/=(f32 scale) {
VECScale(this, this, 1.0f / std::sqrtf(scale));
return this;
}
cXyz* operator+=(const Vec& other) {
VECAdd(this, &other, this);
return this;
}
cXyz* operator-=(const Vec& other) {
VECSubtract(this, &other, this);
return this;
}
cXyz* operator*=(const Vec& other) {
x *= other.x;
y *= other.y;
z *= other.z;
return this;
}
cXyz getCrossProduct(const Vec&) const;
cXyz outprod(const Vec&) const;
cXyz norm() const;
@@ -126,10 +130,7 @@ struct cXyz : Vec {
f32 inprod(const Vec& other) const { return getDotProduct(other); }
f32 inprodXZ(const Vec& other) const { return x * other.x + z * other.z; }
// TODO
// void operator*=(const Vec&) {}
// void operator/=(f32) {}
// void operator=(const cXyz&) {}
// debug-only inline?
// void print(const char*) {}
};
+4 -5
View File
@@ -11,8 +11,7 @@ class JPABaseEmitter;
struct br_s {
/* 0x000 */ J3DModel* mpModel;
/* 0x004 */ J3DLightObj mLight;
/* 0x078 */ u8 m078[0xB4 - 0x78];
/* 0x004 */ dKy_tevstr_c mTevStr;
/* 0x0B4 */ J3DModel* mpModelRope1;
/* 0x0B8 */ J3DModel* mpModelRope0;
/* 0x0BC */ mDoExt_3DlineMat1_c mLineMat1;
@@ -75,9 +74,9 @@ struct bridge_class {
/* 0x02FC */ f32 m02FC;
/* 0x0300 */ s16 m0300;
/* 0x0302 */ s16 m0302;
/* 0x0304 */ s32 m0304;
/* 0x0308 */ s32 m0308;
/* 0x030C */ s32 m030C;
/* 0x0304 */ int m0304;
/* 0x0308 */ int m0308;
/* 0x030C */ int m030C;
/* 0x0310 */ u8 m0310[0x0312 - 0x0310];
/* 0x0312 */ s16 m0312;
/* 0x0314 */ cXyz mEndPos;
+7 -5
View File
@@ -45,18 +45,19 @@ public:
s16 getBackbone_x() { return mJntCtrl.getBackbone_x(); }
s16 getBackbone_y() { return mJntCtrl.getBackbone_y(); }
cXyz& getEyePos() { return field_0x748; }
f32 getGroundY() { return mAcch.GetGroundH(); }
virtual f32 getGroundY() { return mAcch.GetGroundH(); }
s16 getHead_x() { return mJntCtrl.getHead_x(); }
s16 getHead_y() { return mJntCtrl.getHead_y(); }
MtxP getLeftHandMatrix() { return cullMtx; }
MtxP getRightHandMatrix() { return cullMtx; }
f32 getBaseAnimeFrameRate() { return 1.0f; }
f32 getBaseAnimeFrame() { return 0.0f; }
virtual MtxP getLeftHandMatrix() { return cullMtx; }
virtual MtxP getRightHandMatrix() { return cullMtx; }
virtual f32 getBaseAnimeFrameRate() { return 1.0f; }
virtual f32 getBaseAnimeFrame() { return 0.0f; }
void incAttnSetCount() {
if(field_0x7A3 != 0xFF) {
field_0x7A3 += 1;
}
}
BOOL isFinish() { return cLib_checkBit(field_0x784, 0x1UL); }
void onFinish() { cLib_onBit(field_0x784, 0x1UL); }
BOOL isSetHomePos() { return cLib_checkBit(field_0x784, 0x2UL); }
@@ -67,6 +68,7 @@ public:
void onGravity() { cLib_onBit(field_0x784, 0x8UL); }
void offGravity() { cLib_offBit(field_0x784, 0x8UL); }
// Note: The 0x10 bit is used in the final release, but not in the demo debug maps, so its official name is unknown.
void offPlayerRoom(int idx) { m_playerRoom[idx] = false; }
void onPlayerRoom(int idx) { m_playerRoom[idx] = true; }
+61 -66
View File
@@ -30,7 +30,7 @@ static void ride_call_back(dBgW* bgw, fopAc_ac_c* i_ac, fopAc_ac_c* i_pt) {
bridge_class* i_this = (bridge_class*)i_ac;
cXyz pos = i_this->mBr[0].mPosition - i_pt->current.pos;
s32 brIdx = std::sqrtf(pos.x * pos.x + pos.z * pos.z) / 76.5f - -0.5f;
int brIdx = std::sqrtf(pos.x * pos.x + pos.z * pos.z) / 76.5f - -0.5f;
if (brIdx > i_this->mBrCount - 1) {
brIdx = i_this->mBrCount - 1;
} else if (brIdx < 0) {
@@ -52,20 +52,20 @@ static void ride_call_back(dBgW* bgw, fopAc_ac_c* i_ac, fopAc_ac_c* i_pt) {
i_pt->speed.y = -5.0f;
f32 fVar7;
if (fpcM_GetName(i_pt) == fpcNm_PLAYER_e) {
if (fopAcM_GetName(i_pt) == fpcNm_PLAYER_e) {
fVar7 = 100.0f;
pBr->m3F4 = -31.0f;
i_this->m033C = 5;
} else if (fpcM_GetName(i_pt) == fpcNm_MO2_e) {
} else if (fopAcM_GetName(i_pt) == fpcNm_MO2_e) {
fVar7 = 150.0f;
pBr->m3F4 = -40.0f;
i_pt->speed.y = -20.0f;
} else if (fpcM_GetName(i_pt) == fpcNm_BK_e) {
} else if (fopAcM_GetName(i_pt) == fpcNm_BK_e) {
bk_class* bk = (bk_class*)i_pt;
bk->speed.y = -20.0f;
fVar7 = 100.0f;
pBr->m3F4 = -25.0f;
bk->dr.m7B8 = fpcM_GetID(i_ac);
bk->dr.m7B8 = fopAcM_GetID(i_ac);
bk->dr.m7B2 = 8;
bk->dr.m7AC = pBr->mRotation;
@@ -82,7 +82,7 @@ static void ride_call_back(dBgW* bgw, fopAc_ac_c* i_ac, fopAc_ac_c* i_pt) {
} else {
fVar7 = 50.0f;
pBr->m3F4 = -10.0f;
if (fpcM_GetName(i_pt) == fpcNm_BOMB_e) {
if (fopAcM_GetName(i_pt) == fpcNm_BOMB_e) {
daBomb_c* bomb = (daBomb_c*)i_pt;
if (bomb->getBombRestTime() <= 1) {
@@ -124,7 +124,7 @@ static void ride_call_back(dBgW* bgw, fopAc_ac_c* i_ac, fopAc_ac_c* i_pt) {
}
/* 00000540-00000614 .text kikuzu_set__FP12bridge_classP4cXyz */
void kikuzu_set(bridge_class* i_this, cXyz* pPos) {
static void kikuzu_set(bridge_class* i_this, cXyz* pPos) {
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
csXyz shapeAngle = player->shape_angle;
shapeAngle.y -= -0x8000;
@@ -135,7 +135,10 @@ void kikuzu_set(bridge_class* i_this, cXyz* pPos) {
emitter->setMaxFrame(1);
emitter->setSpread(0.2f);
emitter->setVolumeSweep(0.15f);
JGeometry::TVec3<f32> scale(0.7f, 0.7f, 0.7f);
JGeometry::TVec3<f32> scale;
scale.x = 0.7f;
scale.y = 0.7f;
scale.z = 0.7f;
emitter->setGlobalParticleScale(scale);
}
}
@@ -143,7 +146,7 @@ void kikuzu_set(bridge_class* i_this, cXyz* pPos) {
/* 00000614-000011EC .text daBridge_Draw__FP12bridge_class */
static BOOL daBridge_Draw(bridge_class* i_this) {
s16 atan;
s32 atan2;
int atan2;
s16 sVar7;
s16 sVar8;
@@ -152,7 +155,7 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
}
br_s* pBr = &i_this->mBr[0];
for (s32 i = 0; i < i_this->mBrCount; i++, pBr++) {
for (int i = 0; i < i_this->mBrCount; i++, pBr++) {
g_env_light.setLightTevColorType(pBr->mpModel, &i_this->actor.tevStr);
dComIfGd_setListBG();
@@ -171,14 +174,14 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
cXyz sp60 = pBr->m0F8[0] - pBr->m0F8[1];
if ((i_this->mTypeBits & 1) == 0) {
s32 uVar16 = (i_this->mTypeBits & 8) ? 5 : 3;
int uVar16 = (i_this->mTypeBits & 8) ? 5 : 3;
cXyz* segment0;
cXyz* segment1;
u8* size0 = pBr->mLineMat1.getSize(0);
u8* size1 = pBr->mLineMat1.getSize(2);
if ((pBr->m408 & 1) == 0) {
for (s32 j = 0; j < 5; j++) {
for (int j = 0; j < 5; j++) {
*size0++ = *size1++ = uVar16;
}
} else {
@@ -191,7 +194,7 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
f32 fVar3 = pBr->m3A0[0] * cM_ssin(i_this->m0300 * 5);
for (s32 j = 0; j < 5; j++, segment0++, segment1++, size0++, size1++) {
for (int j = 0; j < 5; j++, segment0++, segment1++, size0++, size1++) {
*size0 = uVar16;
f32 fVar2;
@@ -222,7 +225,7 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
size0 = pBr->mLineMat1.getSize(1);
size1 = pBr->mLineMat1.getSize(3);
if ((pBr->m408 & 2) == 0) {
for (s32 j = 0; j < 5; j++) {
for (int j = 0; j < 5; j++) {
*size0++ = *size1++ = uVar16;
}
} else {
@@ -235,7 +238,7 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
f32 fVar3 = pBr->m3A0[1] * cM_ssin(i_this->m0300 * 5);
for (s32 j = 0; j < 5; j++, segment0++, segment1++, size0++, size1++) {
for (int j = 0; j < 5; j++, segment0++, segment1++, size0++, size1++) {
*size0 = uVar16;
f32 fVar2;
@@ -376,7 +379,7 @@ static BOOL daBridge_Draw(bridge_class* i_this) {
}
/* 000011EC-00001580 .text control1__FP12bridge_classP4br_s */
void control1(bridge_class* i_this, br_s* pBr) {
static void control1(bridge_class* i_this, br_s* pBr) {
cXyz sp3C;
cXyz sp30;
cXyz sp24;
@@ -409,7 +412,7 @@ void control1(bridge_class* i_this, br_s* pBr) {
sp3C.x = 0.0f;
sp3C.z = 75.0f;
for (s32 i = 1; i < i_this->mBrCount; i++, pBr++) {
for (int i = 1; i < i_this->mBrCount; i++, pBr++) {
f32 x;
f32 y;
f32 z;
@@ -437,7 +440,7 @@ void control1(bridge_class* i_this, br_s* pBr) {
}
/* 00001580-0000178C .text control2__FP12bridge_classP4br_s */
void control2(bridge_class* i_this, br_s* pBr) {
static void control2(bridge_class* i_this, br_s* pBr) {
cXyz sp18;
cXyz sp0C;
@@ -446,7 +449,7 @@ void control2(bridge_class* i_this, br_s* pBr) {
sp18.y = 0.0f;
sp18.z = 75.0f;
for (s32 i = 0; i < i_this->mBrCount - 1; i++, pBr--) {
for (int i = 0; i < i_this->mBrCount - 1; i++, pBr--) {
f32 tmp = pBr->m3F8 * 0.5f + (pBr->m3FC * pBr->m3F0 * 0.5f + pBr->m3CC.y);
f32 y = tmp - pBr[1].m3CC.y;
@@ -472,7 +475,7 @@ void control2(bridge_class* i_this, br_s* pBr) {
}
/* 0000178C-000018A8 .text control3__FP12bridge_classP4br_s */
void control3(bridge_class* i_this, br_s* pBr) {
static void control3(bridge_class* i_this, br_s* pBr) {
f32 x = pBr->m3CC.x - pBr[1].m3CC.x;
f32 y = pBr->m3CC.y - pBr[1].m3CC.y;
f32 z = pBr->m3CC.z - pBr[1].m3CC.z;
@@ -482,7 +485,7 @@ void control3(bridge_class* i_this, br_s* pBr) {
}
/* 000018A8-00001B08 .text cut_control1__FP12bridge_classP4br_s */
void cut_control1(bridge_class* i_this, br_s* pBr) {
static void cut_control1(bridge_class* i_this, br_s* pBr) {
cXyz sp24;
cXyz sp18;
cXyz spC;
@@ -495,7 +498,7 @@ void cut_control1(bridge_class* i_this, br_s* pBr) {
MtxPosition(&sp24, &spC);
sp24.z = 75.0f;
for (s32 i = 1; i < i_this->m0304; i++, pBr++) {
for (int i = 1; i < i_this->m0304; i++, pBr++) {
f32 fVar2 = pBr->m3CC.y + pBr->m3FC;
f32 fVar1 = pBr->m3EC + 30.0f;
if (fVar2 < fVar1) {
@@ -531,7 +534,7 @@ void cut_control1(bridge_class* i_this, br_s* pBr) {
}
/* 00001B08-00001D84 .text cut_control2__FP12bridge_classP4br_s */
void cut_control2(bridge_class* i_this, br_s* pBr) {
static void cut_control2(bridge_class* i_this, br_s* pBr) {
cXyz sp24;
cXyz sp18;
cXyz spC;
@@ -544,7 +547,7 @@ void cut_control2(bridge_class* i_this, br_s* pBr) {
MtxPosition(&sp24, &spC);
sp24.z = 75.0f;
for (s32 i = 0; i < (i_this->mBrCount - 1) - i_this->m0304; i++, pBr--) {
for (int i = 0; i < (i_this->mBrCount - 1) - i_this->m0304; i++, pBr--) {
f32 fVar2 = pBr->m3CC.y + pBr->m3FC;
f32 fVar1 = pBr->m3EC + 30.0f;
if (fVar2 < fVar1) {
@@ -555,7 +558,7 @@ void cut_control2(bridge_class* i_this, br_s* pBr) {
f32 x = spC.x + (pBr->m3CC.x - pBr[1].m3CC.x);
f32 z = spC.z + (pBr->m3CC.z - pBr[1].m3CC.z);
s16 atan2;
s32 atan;
int atan;
atan = cM_atan2s(x, z);
atan2 = -cM_atan2s(y, std::sqrtf(x * x + z * z));
pBr[1].mRotation.y = atan;
@@ -574,7 +577,7 @@ void cut_control2(bridge_class* i_this, br_s* pBr) {
}
/* 00001D84-00001FAC .text himo_cut_control1__FP4cXyz */
void himo_cut_control1(cXyz* pPos) {
static void himo_cut_control1(cXyz* pPos) {
cXyz pos;
cXyz sp18;
cXyz transformedPos;
@@ -589,12 +592,12 @@ void himo_cut_control1(cXyz* pPos) {
pos.z = 23.0f;
pPos++;
for (s32 i = 1; i < 5; i++, pPos++) {
for (int i = 1; i < 5; i++, pPos++) {
f32 x = transformedPos.x + (pPos[0].x - pPos[-1].x);
f32 y = (pPos[0].y - pPos[-1].y) - 10.0f;
f32 z = transformedPos.z + (pPos[0].z - pPos[-1].z);
s16 atan2;
s32 atan;
int atan;
atan = cM_atan2s(x, z);
atan2 = -cM_atan2s(y, std::sqrtf(x * x + z * z));
@@ -608,11 +611,10 @@ void himo_cut_control1(cXyz* pPos) {
}
/* 00001FAC-00002A1C .text bridge_move__FP12bridge_class */
void bridge_move(bridge_class* i_this) {
/* Nonmatching */
daPy_py_c* player = static_cast<daPy_py_c*>(dComIfGp_getPlayer(0));
s32 i;
s32 j;
static void bridge_move(bridge_class* i_this) {
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
int i;
int j;
br_s* pBr = &i_this->mBr[0];
cXyz sp38;
cXyz sp2C;
@@ -621,7 +623,6 @@ void bridge_move(bridge_class* i_this) {
f32 fVar14;
f32 fVar2;
f32 tmpf;
s32 iVar11;
switch (i_this->mMoveProcMode) {
case 1:
@@ -681,8 +682,7 @@ void bridge_move(bridge_class* i_this) {
if (pBr->m406 != 0) {
for (j = -5; j <= 5; j++) {
iVar11 = i + j;
if ((iVar11 < 0) || (iVar11 >= i_this->mBrCount)) {
if (((i + j) < 0) || ((i + j) >= i_this->mBrCount)) {
continue;
}
@@ -704,8 +704,7 @@ void bridge_move(bridge_class* i_this) {
}
for (j = -5; j <= 5; j++) {
iVar11 = i + j;
if ((iVar11 < 0) || (iVar11 >= i_this->mBrCount)) {
if (((i + j) < 0) || ((i + j) >= i_this->mBrCount)) {
continue;
}
@@ -722,7 +721,7 @@ void bridge_move(bridge_class* i_this) {
if (i_this->m0308 > 100) {
i_this->mMoveProcMode = 4;
i_this->m0304 = iVar11;
i_this->m0304 = (i + j);
if (i_this->m033C != 0) {
dComIfGp_getVibration().StartShock(REG0_S(2) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f));
}
@@ -732,7 +731,7 @@ void bridge_move(bridge_class* i_this) {
if (pBr[j].m3F4 < -200.0f) {
i_this->mMoveProcMode = 4;
i_this->m0304 = iVar11;
i_this->m0304 = (i + j);
break;
}
}
@@ -742,8 +741,7 @@ void bridge_move(bridge_class* i_this) {
f32 fVar141 = (pBr->m3A0[0] | pBr->m3A0[1]) * 150.0f;
fVar14 = fVar141 * cM_ssin(i_this->m0300 * 4);
for (j = -5; j <= 5; j++) {
iVar11 = i + j;
if (iVar11 < 0 || iVar11 >= i_this->mBrCount) {
if ((i + j) < 0 || (i + j) >= i_this->mBrCount) {
continue;
}
@@ -827,8 +825,8 @@ void bridge_move(bridge_class* i_this) {
}
/* 00002A1C-00002A8C .text s_a_b_sub__FPvPv */
void* s_a_b_sub(void* ac1, void* ac2) {
if (fopAc_IsActor(ac1) && fpcM_GetName(ac1) == fpcNm_BRIDGE_e && ac1 != ac2) {
static void* s_a_b_sub(void* ac1, void* ac2) {
if (fopAcM_IsActor(ac1) && fopAcM_GetName(ac1) == fpcNm_BRIDGE_e && ac1 != ac2) {
bridge_class* bridge = (bridge_class*)ac1;
if ((bridge->mTypeBits & 0x82) == 2) {
return ac1;
@@ -838,17 +836,15 @@ void* s_a_b_sub(void* ac1, void* ac2) {
}
/* 00002A8C-00002AB8 .text search_aite__FP12bridge_class */
bridge_class* search_aite(bridge_class* i_this) {
static bridge_class* search_aite(bridge_class* i_this) {
return (bridge_class*)fpcM_Search(s_a_b_sub, &i_this->actor);
}
/* 00002AB8-00003C68 .text daBridge_Execute__FP12bridge_class */
static BOOL daBridge_Execute(bridge_class* i_this) {
/* Nonmatching - regswap */
fopAc_ac_c* a_player = static_cast<fopAc_ac_c*>(dComIfGp_getPlayer(0));
daPy_py_c* player = static_cast<daPy_py_c*>(dComIfGp_getPlayer(0));
camera_process_class* pCam = dComIfGp_getCamera(0);
s32 i;
fopAc_ac_c* a_player = dComIfGp_getPlayer(0);
daPy_py_c* player = (daPy_py_c*)a_player;
camera_process_class* pCam = (camera_process_class*)dComIfGp_getCamera(0);
cXyz eyeDir = i_this->actor.current.pos - pCam->view.mLookat.mEye;
cXyz spCC;
@@ -889,7 +885,7 @@ static BOOL daBridge_Execute(bridge_class* i_this) {
bGotFlamePos = true;
}
for (i = 0; i < i_this->mBrCount; i++, pBr++) {
for (int i = 0; i < i_this->mBrCount; i++, pBr++) {
MtxTrans(pBr->mPosition.x, pBr->mPosition.y, pBr->mPosition.z, false);
cMtx_YrotM(*calc_mtx, pBr->mRotation.y);
cMtx_XrotM(*calc_mtx, pBr->mRotation.x);
@@ -1082,7 +1078,7 @@ static BOOL daBridge_Execute(bridge_class* i_this) {
dComIfG_Ccsp()->Set(&pBr->mCyl[1]);
}
for (s32 i = 0; i < 2; i++) {
for (int i = 0; i < 2; i++) {
if (pBr->m3A0[i] != 0) {
pBr->m3A0[i]--;
}
@@ -1161,16 +1157,15 @@ static BOOL daBridge_Execute(bridge_class* i_this) {
cBgD_Vtx_t* vtxTbl = i_this->mpBgW->GetVtxTbl();
int idx;
int sw;
int idx;
int other_i = 0;
for (i = 0; i < i_this->mpBgW->GetVtxNum(); i++, pBr++) {
for (int i = 0; i < i_this->mpBgW->GetVtxNum(); i++) {
sw = i & 3;
idx = i;
idx >>= 2;
idx = i >> 2;
if (idx < i_this->m02DD) {
br_s* pBr = &i_this->mBr[idx];
pBr = &i_this->mBr[idx];
switch (sw) {
case 0:
@@ -1238,7 +1233,7 @@ static BOOL daBridge_Execute(bridge_class* i_this) {
/* 00003C68-00003CD4 .text daBridge_IsDelete__FP12bridge_class */
static BOOL daBridge_IsDelete(bridge_class* i_this) {
br_s* pBr = &i_this->mBr[0];
for (s32 i = 0; i < i_this->mBrCount; i++, pBr++) {
for (int i = 0; i < i_this->mBrCount; i++, pBr++) {
mDoAud_seDeleteObject(&pBr->m3CC);
}
return TRUE;
@@ -1254,7 +1249,7 @@ static BOOL daBridge_Delete(bridge_class* i_this) {
}
/* 00003D2C-00003E00 .text CreateInit__FP10fopAc_ac_c */
void CreateInit(fopAc_ac_c* a_this) {
static void CreateInit(fopAc_ac_c* a_this) {
static dCcD_SrcCyl himo_cyl_src = {
// dCcD_SrcGObjInf
{
@@ -1290,8 +1285,8 @@ void CreateInit(fopAc_ac_c* a_this) {
i_this->mStts.Init(0xFF, 0xFF, a_this);
br_s* pBr = i_this->mBr;
for (s32 i = 0; i < i_this->mBrCount; i++, pBr++) {
for (s32 j = 0; j < 2; j++) {
for (int i = 0; i < i_this->mBrCount; i++, pBr++) {
for (int j = 0; j < 2; j++) {
pBr->mCyl[j].Set(himo_cyl_src);
pBr->mCyl[j].SetStts(&i_this->mStts);
if ((i_this->mTypeBits & 1) == 0) {
@@ -1304,11 +1299,11 @@ void CreateInit(fopAc_ac_c* a_this) {
/* 00003E00-00004310 .text CallbackCreateHeap__FP10fopAc_ac_c */
static BOOL CallbackCreateHeap(fopAc_ac_c* a_this) {
static const s32 bridge_bmd[] = { dRes_INDEX_BRIDGE_BDL_OBM_BRIDGE_e, dRes_INDEX_BRIDGE_BDL_OBM_BRIDGE2_e };
static const int bridge_bmd[] = { dRes_INDEX_BRIDGE_BDL_OBM_BRIDGE_e, dRes_INDEX_BRIDGE_BDL_OBM_BRIDGE2_e };
bridge_class* i_this = (bridge_class*)a_this;
s32 modelNum = i_this->mTypeBits & 1;
int modelNum = i_this->mTypeBits & 1;
if (i_this->mTypeBits & 4) {
modelNum = 1;
}
@@ -1324,12 +1319,12 @@ static BOOL CallbackCreateHeap(fopAc_ac_c* a_this) {
br_s* pBr = i_this->mBr;
s32 iVar8 = 2;
int iVar8 = 2;
if (i_this->mTypeBits & 1) {
iVar8 = 0;
}
for (s32 i = 0; i < i_this->mBrCount; i++, pBr++) {
for (int i = 0; i < i_this->mBrCount; i++, pBr++) {
pBr->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11020002);
if (pBr->mpModel == NULL) {
return FALSE;
@@ -1423,7 +1418,7 @@ static BOOL CallbackCreateHeap(fopAc_ac_c* a_this) {
i_this->mpBgW->SetRideCallback(ride_call_back);
i_this->mpBgW->CopyBackVtx();
cBgD_Vtx_t* vtxTbl = i_this->mpBgW->GetVtxTbl();
for (s32 i = 0; i < i_this->mpBgW->GetVtxNum(); i++) {
for (int i = 0; i < i_this->mpBgW->GetVtxNum(); i++) {
vtxTbl[i].x = i_this->actor.current.pos.x;
vtxTbl[i].y = i_this->actor.current.pos.y;
vtxTbl[i].z = i_this->actor.current.pos.z;
-1
View File
@@ -840,7 +840,6 @@ BOOL daNpc_Hi1_c::_draw() {
mBtpAnm.remove(modelData);
shadowDraw();
return TRUE;
/* Nonmatching */
}
/* 00001CB4-00001EDC .text _execute__11daNpc_Hi1_cFv */
+13 -13
View File
@@ -755,7 +755,7 @@ BOOL daNpc_Os_c::waitNpcAction(void*) {
}
else {
cLib_onBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
s16 angle = shape_angle.y + mJntCtrl.getHead_y() + mJntCtrl.getBackbone_y();
s16 angle = shape_angle.y + getHead_y() + getBackbone_y();
field_0x7A4 = chkAttention(current.pos, angle);
if(chkArea(&current.pos)) {
@@ -774,7 +774,7 @@ BOOL daNpc_Os_c::waitNpcAction(void*) {
f32 dist_sq = fopAcM_searchPlayerDistance2(this);
if(!checkNpcCallCommand()) {
if(dist_sq < SQUARE(l_HIO.field_0x64)) {
daPy_getPlayerLinkActorClass()->onNpcCallCommand();
daPy_getPlayerLinkActorClass()->onNpcCall();
}
}
else {
@@ -865,7 +865,7 @@ BOOL daNpc_Os_c::talkNpcAction(void*) {
field_0x7A9 += 1;
}
else if(field_0x7A9 != -1) {
s16 angle = shape_angle.y + mJntCtrl.getHead_y() + mJntCtrl.getBackbone_y();
s16 angle = shape_angle.y + getHead_y() + getBackbone_y();
field_0x7A4 = chkAttention(current.pos, angle);
if(field_0x7A9 == 1) {
@@ -899,7 +899,7 @@ BOOL daNpc_Os_c::carryNpcAction(void* param_1) {
cLib_offBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
offNpcCallCommand();
field_0x7AC = shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y;
field_0x7AC = fopAcM_toPlayerShapeAngleY(this);
field_0x788 = 120.0f;
field_0x7A9 += 1;
}
@@ -925,7 +925,7 @@ BOOL daNpc_Os_c::carryNpcAction(void* param_1) {
}
if(!fopAcM_checkCarryNow(this)) {
if(speedF > 0.0f) {
if(fopAcM_GetSpeedF(this) > 0.0f) {
setNpcAction(&daNpc_Os_c::throwNpcAction, 0);
return true;
@@ -1019,7 +1019,7 @@ void daNpc_Os_c::routeWallCheck(cXyz& param_1, cXyz& param_2, s16* param_3) {
dBgS_LinChk linChk;
linChk.Set(&param_1, &param_2, 0);
if(dComIfG_Bgsp()->LineCross(&linChk)) {
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(linChk.GetBgIndex(), linChk.GetPolyIndex());
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(linChk);
if(plane) {
routeAngCheck(*plane->GetNP(), param_3);
}
@@ -1030,7 +1030,7 @@ void daNpc_Os_c::routeWallCheck(cXyz& param_1, cXyz& param_2, s16* param_3) {
f32 daNpc_Os_c::checkForwardGroundY(s16 param_1) {
s32 wallHit = wallHitCheck();
if(wallHit >= 0) {
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(mAcchCir[wallHit].GetBgIndex(), mAcchCir[wallHit].GetPolyIndex());
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(mAcchCir[wallHit]);
if(plane) {
if(cLib_distanceAngleS(param_1, cM_atan2s(plane->GetNP()->x, plane->GetNP()->z)) > 0x4000) {
dBgS_GndChk gndChk;
@@ -2017,9 +2017,6 @@ BOOL daNpc_Os_c::init() {
field_0x794 = fopAcM_GetParam(this) >> 0x10 & 0xFF;
attention_info.distances[fopAc_Attn_TYPE_CARRY_e] = 0x27;
// Fakematch, the next two lines get optimized out, but they affect the regalloc when copying the tevstr.
speedF = speedF;
speedF = speedF;
m_smoke_tevstr = tevStr;
m_smoke.setTevStr(&m_smoke_tevstr);
m_playerRoom[argument] = false;
@@ -2090,6 +2087,9 @@ BOOL daNpc_Os_c::draw() {
);
}
// dDbVw_drawCylinderXlu
// dDbVw_drawSphereXlu
return true;
}
@@ -2255,8 +2255,8 @@ BOOL daNpc_Os_c::execute() {
}
}
speed.x = speedF * cM_ssin(current.angle.y);
speed.z = speedF * cM_scos(current.angle.y);
speed.x = fopAcM_GetSpeedF(this) * cM_ssin(current.angle.y);
speed.z = fopAcM_GetSpeedF(this) * cM_scos(current.angle.y);
fopAcM_posMove(this, mStts.GetCCMoveP());
}
@@ -2280,7 +2280,7 @@ BOOL daNpc_Os_c::execute() {
}
if(mAcch.GetGroundH() != -G_CM3D_F_INF) {
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd.GetBgIndex(), mAcch.m_gnd.GetPolyIndex());
cM3dGPla* plane = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd);
if(plane) {
field_0x7F0 = *plane->GetNP();
}
-1
View File
@@ -104,7 +104,6 @@ void daObjGtaki_c::set_effect() {
/* 00000484-00000604 .text CreateInit__12daObjGtaki_cFv */
bool daObjGtaki_c::CreateInit() {
/* Nonmatching */
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f,600.0f,10000.0f,600.0f);
fopAcM_setCullSizeFar(this, 1.0f);
-1
View File
@@ -405,7 +405,6 @@ void daObj_Ikada_c::createWave() {
/* 000012EC-00001528 .text setWave__13daObj_Ikada_cFv */
void daObj_Ikada_c::setWave() {
/* Nonmatching */
f32 fVar2 = l_HIO.mTrackVel;
f32 fVar1 = l_HIO.mWaveVelFade;
f32 target = l_HIO.mSplashScaleMax;
-1
View File
@@ -122,7 +122,6 @@ static BOOL daObjLpalmExecute(void* i_this) {
/* 0000054C-000008C4 .text _execute__12daObjLpalm_cFv */
bool daObjLpalm_c::_execute() {
/* Nonmatching */
if (attr().flag0)
return true;
+1 -3
View File
@@ -260,9 +260,7 @@ cPhs_State daObjMtest::Act_c::Mthd_Create() {
mbAppear = chk_appear();
cXyz& scl_mult = M_scl_mult[M_type];
scale.x *= scl_mult.x;
scale.y *= scl_mult.y;
scale.z *= scl_mult.z;
scale *= scl_mult;
phase_state = MoveBGCreate(M_arcname[M_type], dzb_data[dzb_idx][M_type], NULL, heap_size[dzb_idx][M_type]);
-3
View File
@@ -86,7 +86,6 @@ BOOL daObjVmc::Act_c::solidHeapCB(fopAc_ac_c* i_this) {
/* 0000009C-00000400 .text create_heap__Q28daObjVmc5Act_cFv */
bool daObjVmc::Act_c::create_heap() {
/* Nonmatching */
J3DModelData* mdl_bs_data = (J3DModelData*)dComIfG_getObjectRes(M_arcname, dRes_INDEX_VMC_BDL_VMCBS_e);
JUT_ASSERT(200, mdl_bs_data != NULL);
mModelBase = mDoExt_J3DModel__create(mdl_bs_data, 0, 0x11020203);
@@ -137,7 +136,6 @@ bool daObjVmc::Act_c::create_heap() {
/* 00000400-000005BC .text CreateInit__Q28daObjVmc5Act_cFv */
void daObjVmc::Act_c::CreateInit() {
/* Nonmatching */
fopAcM_SetMtx(this, mModelBase->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -300.0f, -0.0f, -300.0, 300.0f, 500.0f, 300.0f);
mStts.Init(255, 255, this);
@@ -292,7 +290,6 @@ void daObjVmc::Act_c::daObjVmc_tree_main() {
/* 00000EDC-000011D0 .text _execute__Q28daObjVmc5Act_cFv */
bool daObjVmc::Act_c::_execute() {
/* Nonmatching */
mCyl.SetC(current.pos);
#if VERSION > VERSION_DEMO
if (mState == STATE_BASE_MAIN)
+1 -1
View File
@@ -717,7 +717,7 @@ BOOL daSalvage_c::isEffectKind(int salvageId) {
/* 0000240C-00002410 .text debugDraw__11daSalvage_cFv */
void daSalvage_c::debugDraw() {
/* Nonmatching */
/* Debug Nonmatching */
}
/* 00002410-00002430 .text daSalvageCreate__FPv */
-1
View File
@@ -254,7 +254,6 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
/* 00000A6C-00000E30 .text daSk_Create__FP10fopAc_ac_c */
static cPhs_State daSk_Create(fopAc_ac_c* a_this) {
/* Nonmatching */
static dCcD_SrcSph body_co_sph_src = {
// dCcD_SrcGObjInf
{
-1
View File
@@ -330,7 +330,6 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
/* 00000EB8-00001244 .text daSsk_Create__FP10fopAc_ac_c */
static cPhs_State daSsk_Create(fopAc_ac_c* a_this) {
/* Nonmatching */
static dCcD_SrcCyl body_co_cyl = {
// dCcD_SrcGObjInf
{
+1 -1
View File
@@ -2829,7 +2829,7 @@ void Act_c::moment_proc_call() {
if (m678 == 3) {
cM3dGPla* pcVar1 = NULL;
if (mAcch.ChkGroundHit()) {
pcVar1 = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd.GetBgIndex(), mAcch.m_gnd.GetPolyIndex());
pcVar1 = dComIfG_Bgsp()->GetTriPla(mAcch.m_gnd);
}
if (pcVar1 != NULL) {
+1 -1
View File
@@ -32,7 +32,7 @@ BOOL dWaterMark_c::setMatrix() {
mPos.y = dComIfG_Bgsp()->GroundCross(&m_ground_check);
if (mPos.y != -G_CM3D_F_INF) {
cM3dGPla* tri = dComIfG_Bgsp()->GetTriPla(m_ground_check.GetBgIndex(), m_ground_check.GetPolyIndex());
cM3dGPla* tri = dComIfG_Bgsp()->GetTriPla(m_ground_check);
s16 tri_angle = cM_atan2s(tri->mNormal.x, tri->mNormal.z) - field_0x12e;
f32 norm_xz_mag = tri->mNormal.absXZ();