From 4a4e040adf9891cffbbb4ce60b96c75e3bf16dc8 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 7 Dec 2022 01:06:09 -0500 Subject: [PATCH] Link CTweakPlayer Former-commit-id: 84e8d8a9fa9c2f97211b5440616bf36624854b0a --- configure.py | 2 +- include/MetroidPrime/Tweaks/ITweakObject.hpp | 4 +++- src/MetroidPrime/Tweaks/CTweakPlayer.cpp | 17 +++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.py b/configure.py index 7c5956bc..0435801a 100755 --- a/configure.py +++ b/configure.py @@ -35,7 +35,7 @@ LIBS = [ ["MetroidPrime/CAnimData", False], "MetroidPrime/Factories/CCharacterFactory", "MetroidPrime/Factories/CAssetFactory", - ["MetroidPrime/Tweaks/CTweakPlayer", False], + ["MetroidPrime/Tweaks/CTweakPlayer", True], "MetroidPrime/Tweaks/CTweaks", ["MetroidPrime/Tweaks/CTweakGame", True], "MetroidPrime/CGameProjectile", diff --git a/include/MetroidPrime/Tweaks/ITweakObject.hpp b/include/MetroidPrime/Tweaks/ITweakObject.hpp index 39630ba7..1d85c3ba 100644 --- a/include/MetroidPrime/Tweaks/ITweakObject.hpp +++ b/include/MetroidPrime/Tweaks/ITweakObject.hpp @@ -5,7 +5,9 @@ class ITweakObject { public: - virtual ~ITweakObject() {}; + virtual ~ITweakObject() = 0; }; +inline ITweakObject::~ITweakObject() {} + #endif // _ITWEAKOBJECT diff --git a/src/MetroidPrime/Tweaks/CTweakPlayer.cpp b/src/MetroidPrime/Tweaks/CTweakPlayer.cpp index 31fd915a..ee57cbe1 100644 --- a/src/MetroidPrime/Tweaks/CTweakPlayer.cpp +++ b/src/MetroidPrime/Tweaks/CTweakPlayer.cpp @@ -10,22 +10,23 @@ CTweakPlayer::CTweakPlayer(CInputStream& in) , x2dc_grappleBeamXWaveAmplitude(0.0) , x2e0_grappleBeamZWaveAmplitude(0.0) , x2e4_grappleBeamAnglePhaseDelta(0.0) { - for (int i = 0; i < 8; ++i) { + int i; + for (i = 0; i < ARRAY_SIZE(x4_maxTranslationalAcceleration); ++i) { x4_maxTranslationalAcceleration[i] = in.ReadFloat(); } - for (int i = 0; i < 8; ++i) { + for (i = 0; i < ARRAY_SIZE(x24_maxRotationalAcceleration); ++i) { x24_maxRotationalAcceleration[i] = in.ReadFloat(); } - for (int i = 0; i < 8; ++i) { + for (i = 0; i < ARRAY_SIZE(x44_translationFriction); ++i) { x44_translationFriction[i] = in.ReadFloat(); } - for (int i = 0; i < 8; ++i) { + for (i = 0; i < ARRAY_SIZE(x64_rotationFriction); ++i) { x64_rotationFriction[i] = in.ReadFloat(); } - for (int i = 0; i < 8; ++i) { + for (i = 0; i < ARRAY_SIZE(x84_rotationMaxSpeed); ++i) { x84_rotationMaxSpeed[i] = in.ReadFloat(); } - for (int i = 0; i < 8; ++i) { + for (i = 0; i < ARRAY_SIZE(xa4_translationMaxSpeed); ++i) { xa4_translationMaxSpeed[i] = in.ReadFloat(); } @@ -109,7 +110,7 @@ CTweakPlayer::CTweakPlayer(CInputStream& in) x264_aimAssistHorizontalAngle = in.ReadFloat() * (M_PIF / 180.f); x268_aimAssistVerticalAngle = in.ReadFloat() * (M_PIF / 180.f); - for (int i = 0; i < 3; ++i) { + for (i = 0; i < 3; ++i) { x158_orbitMinDistance[i] = in.ReadFloat(); x164_orbitNormalDistance[i] = in.ReadFloat(); x170_orbitMaxDistance[i] = in.ReadFloat(); @@ -127,7 +128,7 @@ CTweakPlayer::CTweakPlayer(CInputStream& in) x1a0_orbitMaxLockDistance = in.ReadFloat(); x1a4_orbitDistanceThreshold = in.ReadFloat(); - for (int i = 0; i < 2; ++i) { + for (i = 0; i < 2; ++i) { x1a8_orbitScreenBoxHalfExtentX[i] = in.ReadLong(); x1b0_orbitScreenBoxHalfExtentY[i] = in.ReadLong(); x1b8_orbitScreenBoxCenterX[i] = in.ReadLong();