From 234482d8de9bf699131cfa42bc44a68b4b704709 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Fri, 25 Nov 2022 23:02:17 +0200 Subject: [PATCH] Fix compilation of all files Former-commit-id: a34a6393262a403e4f3dc8c626aed9c39779d99a --- include/Kyoto/TToken.hpp | 2 +- include/MetaRender/IRenderer.hpp | 5 +++++ include/MetroidPrime/BodyState/CBodyController.hpp | 2 ++ include/MetroidPrime/Weapons/GunController/CGSFidget.hpp | 3 ++- include/MetroidPrime/Weapons/GunController/CGunMotion.hpp | 2 +- src/Kyoto/Streams/CInputStream.cpp | 2 +- src/MetroidPrime/CErrorOutputWindow.cpp | 2 +- src/MetroidPrime/Player/CPlayerGun.cpp | 2 +- src/MetroidPrime/Weapons/GunController/CGunMotion.cpp | 4 ++-- 9 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/Kyoto/TToken.hpp b/include/Kyoto/TToken.hpp index 2b8f34d1..c2078260 100644 --- a/include/Kyoto/TToken.hpp +++ b/include/Kyoto/TToken.hpp @@ -40,7 +40,7 @@ public: return true; } if (HasLock() && CToken::IsLoaded()) { - x8_item = GetT(); + x8_item = TToken::GetT(); return true; } else { return false; diff --git a/include/MetaRender/IRenderer.hpp b/include/MetaRender/IRenderer.hpp index 04b3689e..183c6594 100644 --- a/include/MetaRender/IRenderer.hpp +++ b/include/MetaRender/IRenderer.hpp @@ -4,6 +4,8 @@ #include "types.h" #include "rstl/pair.hpp" +#include "Kyoto/TToken.hpp" + class CTransform4f; class CParticleGen; class IObjectStore; @@ -13,6 +15,9 @@ class CResFactory; class CAABox; class CVector2f; class CVector3f; +class CModel; +class CSkinnedModel; +class CColor; class IRenderer { public: diff --git a/include/MetroidPrime/BodyState/CBodyController.hpp b/include/MetroidPrime/BodyState/CBodyController.hpp index 405680e9..88db9c1f 100644 --- a/include/MetroidPrime/BodyState/CBodyController.hpp +++ b/include/MetroidPrime/BodyState/CBodyController.hpp @@ -15,6 +15,8 @@ class CRandom16; class CBodyController { public: + CBodyController(); + CActor& GetOwner() const { return x0_actor; } CBodyStateCmdMgr& CommandMgr() { return x4_cmdMgr; } const CBodyStateCmdMgr& GetCommandMgr() const { return x4_cmdMgr; } diff --git a/include/MetroidPrime/Weapons/GunController/CGSFidget.hpp b/include/MetroidPrime/Weapons/GunController/CGSFidget.hpp index de739dcd..9bfdf4bd 100644 --- a/include/MetroidPrime/Weapons/GunController/CGSFidget.hpp +++ b/include/MetroidPrime/Weapons/GunController/CGSFidget.hpp @@ -3,9 +3,10 @@ #include "rstl/vector.hpp" +#include "Kyoto/TToken.hpp" + class CAnimData; class CStateManager; -class CToken; class CGSFidget { public: diff --git a/include/MetroidPrime/Weapons/GunController/CGunMotion.hpp b/include/MetroidPrime/Weapons/GunController/CGunMotion.hpp index a6f91bb2..fe853c9a 100644 --- a/include/MetroidPrime/Weapons/GunController/CGunMotion.hpp +++ b/include/MetroidPrime/Weapons/GunController/CGunMotion.hpp @@ -40,7 +40,7 @@ public: bool bigStrike); void Update(float, CStateManager&); void Draw(const CStateManager&, const CTransform4f&) const; - void ReturnToDefault(CStateManager& mgr); + void ReturnToDefault(CStateManager& mgr, bool); int GetFreeLookSetId() const; void BasePosition(bool bigStrikeReset); void EnterFidget(CStateManager&, SamusGun::EFidgetType, int); diff --git a/src/Kyoto/Streams/CInputStream.cpp b/src/Kyoto/Streams/CInputStream.cpp index 373f6b74..9773d2d7 100644 --- a/src/Kyoto/Streams/CInputStream.cpp +++ b/src/Kyoto/Streams/CInputStream.cpp @@ -27,7 +27,7 @@ CInputStream::CInputStream(const void* ptr, int len, bool owned) CInputStream::~CInputStream() { if (x14_owned) { - delete x10_ptr; + delete[] x10_ptr; } } diff --git a/src/MetroidPrime/CErrorOutputWindow.cpp b/src/MetroidPrime/CErrorOutputWindow.cpp index 6efcbd03..673c5060 100644 --- a/src/MetroidPrime/CErrorOutputWindow.cpp +++ b/src/MetroidPrime/CErrorOutputWindow.cpp @@ -35,7 +35,7 @@ CIOWin::EMessageReturn CErrorOutputWindow::OnMessage(const CArchitectureMessage& case kAM_FrameEnd: { int result = x14_state ^ 1; - result = (result >> 1) - (result & x14_state) >> 0x1f; + result = (result >> 1) - ((result & x14_state) >> 0x1f); return CIOWin::EMessageReturn(result); } break; diff --git a/src/MetroidPrime/Player/CPlayerGun.cpp b/src/MetroidPrime/Player/CPlayerGun.cpp index f34b942a..1aa1d7be 100644 --- a/src/MetroidPrime/Player/CPlayerGun.cpp +++ b/src/MetroidPrime/Player/CPlayerGun.cpp @@ -843,7 +843,7 @@ void CPlayerGun::UpdateGunIdle(bool inStrikeCooldown, float camBobT, float dt, C } else { if (x833_31_inFreeLook) { if ((x2f8_stateFlags & 0x10) != 0x10) { - x73c_gunMotion->ReturnToDefault(mgr); + x73c_gunMotion->ReturnToDefault(mgr, x834_30_inBigStrike); x740_grappleArm->ReturnToDefault(mgr, 0.f, false); } x833_31_inFreeLook = false; diff --git a/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp b/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp index b16a5392..c17cf5c1 100644 --- a/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp +++ b/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp @@ -76,8 +76,8 @@ void CGunMotion::Draw(const CStateManager& mgr, const CTransform4f& xf) const { x0_modelData.Render(mgr, xf, nullptr, CModelFlags::Normal()); } -void CGunMotion::ReturnToDefault(CStateManager& mgr) { - x4c_gunController.ReturnToDefault(mgr, 0.f); +void CGunMotion::ReturnToDefault(CStateManager& mgr, bool b) { + x4c_gunController.ReturnToDefault(mgr, 0.f, b); } int CGunMotion::GetFreeLookSetId() const { return x4c_gunController.GetFreeLookSetId(); }