diff --git a/include/toBeSorted/d_path.h b/include/toBeSorted/d_path.h index 9f4e7fbb..1208c191 100644 --- a/include/toBeSorted/d_path.h +++ b/include/toBeSorted/d_path.h @@ -123,18 +123,6 @@ public: return mSegmentTime; } - bool CheckFlag(u32 flag) const { - return (mFlags & flag) != 0; - } - - void ClearFlag(u32 flag) { - mFlags &= ~flag; - } - - void SetFlag(u32 flag) { - mFlags |= flag; - } - const mVec3_c &getPosition() const { return mPosition; } @@ -159,11 +147,11 @@ public: return (mFlags & flags) != 0; } - void offFlag(u32 flags) { + void unsetFlag(u32 flags) { mFlags &= ~flags; } - void onFlag(u32 flags) { + void setFlag(u32 flags) { mFlags |= flags; } diff --git a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp index fdece84a..b82aef58 100644 --- a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp @@ -285,10 +285,10 @@ void dAcODungeonShip_c::executeState_Transparency() { if (isWithinDist1 && field_0x868 == 0 && field_0x862 == 0 && tmp2) { if (field_0x856 > 0) { field_0x856 = 0xFF; - mPath.SetFlag(0x40000000); + mPath.setFlag(0x40000000); } else { field_0x856 = 1; - mPath.ClearFlag(0x40000000); + mPath.unsetFlag(0x40000000); } u16 idx = fn_485_1900(); @@ -302,7 +302,7 @@ void dAcODungeonShip_c::executeState_Transparency() { field_0x858 = 50.0f; } - if (mPath.CheckFlag(0x40000000) && field_0x858 > 0.0f) { + if (mPath.checkFlag(0x40000000) && field_0x858 > 0.0f) { field_0x858 *= -1; } } @@ -433,26 +433,22 @@ void dAcODungeonShip_c::fn_485_1660() { } } -static u32 rot_7fff = 0x7FFF; -static u32 rot_4000 = 0x4000; - void dAcODungeonShip_c::fn_485_1720() { mPath.setSpeed(mSpeed); mPath.execute(); - // TODO mPosition = mPath.getPosition(); mVec3_c tmp; mPath.getDirection(tmp); mRotation.y = cM::atan2s(tmp.x, tmp.z); - if (mPath.CheckFlag(0x40000000)) { - mRotation.y += rot_7fff; + if (mPath.checkFlag(0x40000000)) { + mRotation.y += 0x7FFF; } - mRotation.y += rot_4000; + mRotation.y += 0x4000; mAngle.y = mRotation.y; int factor = 0x12C; - f32 tmp2 = nw4r::math::SinIdx((field_0x850 * 800)); + f32 tmp2 = nw4r::math::SinIdx(field_0x850 * 800); tmp2 *= factor; field_0x84C = tmp2; } @@ -460,7 +456,7 @@ void dAcODungeonShip_c::fn_485_1720() { bool dAcODungeonShip_c::fn_485_1830(s32 pathSegmentIndex, s32 direction, s32 *out) {} u16 dAcODungeonShip_c::fn_485_1900() { - s32 sign = mPath.CheckFlag(0x40000000) ? -1 : 1; + s32 sign = mPath.checkFlag(0x40000000) ? -1 : 1; s32 result; if (fn_485_1830(mPath.getSegmentIndex(), sign, &result)) { return result; diff --git a/src/toBeSorted/d_path.cpp b/src/toBeSorted/d_path.cpp index 0003a739..d68856b0 100644 --- a/src/toBeSorted/d_path.cpp +++ b/src/toBeSorted/d_path.cpp @@ -517,7 +517,7 @@ s32 ActorOnRail_Ext::execute() { mSegmentDistance = 0.0f; if (checkFlag(0x1)) { ret = 3; - offFlag(0x40000000); + unsetFlag(0x40000000); mSpeed *= -1.0f; } break; @@ -545,7 +545,7 @@ s32 ActorOnRail_Ext::execute() { mSegmentDistance = segmentLength; if (checkFlag(0x1)) { ret = 3; - onFlag(0x40000000); + setFlag(0x40000000); mSpeed *= -1.0f; } break;