From 94eb8324a8748a081238f4d7b5cbab9301330a79 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Thu, 6 Oct 2022 02:34:32 +0300 Subject: [PATCH] Compilation fix for many files Former-commit-id: 44e4110ffb4ed17347e6198c5fb25c155d5345d9 --- include/Kyoto/Audio/CSfxManager.hpp | 1 + include/MetaRender/CCubeRenderer.hpp | 1 + include/MetaRender/Renderer.hpp | 1 + include/MetroidPrime/Cameras/CCameraHint.hpp | 38 ++++++++++---------- src/Kyoto/Graphics/CCubeMaterial.cpp | 4 +-- src/MetroidPrime/CObjectList.cpp | 2 ++ src/MetroidPrime/Cameras/CCameraFilter.cpp | 15 ++++---- src/MetroidPrime/Cameras/CCameraHint.cpp | 13 ++++--- src/MetroidPrime/main.cpp | 4 +-- 9 files changed, 43 insertions(+), 36 deletions(-) diff --git a/include/Kyoto/Audio/CSfxManager.hpp b/include/Kyoto/Audio/CSfxManager.hpp index 0d26eee5..88cd4c93 100644 --- a/include/Kyoto/Audio/CSfxManager.hpp +++ b/include/Kyoto/Audio/CSfxManager.hpp @@ -5,6 +5,7 @@ #include "Kyoto/Audio/CSfxHandle.hpp" +class CVector3f; class CSfxManager { public: static void Update(f32 dt); diff --git a/include/MetaRender/CCubeRenderer.hpp b/include/MetaRender/CCubeRenderer.hpp index f5ec4af7..cfcf5aec 100644 --- a/include/MetaRender/CCubeRenderer.hpp +++ b/include/MetaRender/CCubeRenderer.hpp @@ -17,6 +17,7 @@ #include "rstl/pair.hpp" class CSkinnedModel; +class CModel; class CCubeRenderer { public: diff --git a/include/MetaRender/Renderer.hpp b/include/MetaRender/Renderer.hpp index 2951d192..f3f1c4ee 100644 --- a/include/MetaRender/Renderer.hpp +++ b/include/MetaRender/Renderer.hpp @@ -14,6 +14,7 @@ public: // TODO vtable }; +class IObjectStore; class COsContext; class CMemorySys; class CResFactory; diff --git a/include/MetroidPrime/Cameras/CCameraHint.hpp b/include/MetroidPrime/Cameras/CCameraHint.hpp index 68c0a8ca..bb567f7c 100644 --- a/include/MetroidPrime/Cameras/CCameraHint.hpp +++ b/include/MetroidPrime/Cameras/CCameraHint.hpp @@ -7,33 +7,33 @@ class CCameraHint { public: - CCameraHint(uint overrideFlags, CBallCamera::EBallCameraBehaviour behaviour, f32 minDist, - f32 maxDist, f32 backwardsDist, const CVector3f& lookAtOffset, - const CVector3f& chaseLookAtOffset, const CVector3f& ballToCam, f32 fov, - f32 attitudeRange, f32 azimuthRange, f32 anglePerSecond, f32 clampVelRange, - f32 clampRotRange, f32 elevation, f32 interpolateTime, f32 clampVelTime, - f32 controlInterpDur); + CCameraHint(uint overrideFlags, CBallCamera::EBallCameraBehaviour behaviour, float minDist, + float maxDist, float backwardsDist, const CVector3f& lookAtOffset, + const CVector3f& chaseLookAtOffset, const CVector3f& ballToCam, float fov, + float attitudeRange, float azimuthRange, float anglePerSecond, float clampVelRange, + float clampRotRange, float elevation, float interpolateTime, float clampVelTime, + float controlInterpDur); virtual ~CCameraHint(); private: uint mOverrideFlags; CBallCamera::EBallCameraBehaviour mBehaviour; - f32 mMinDist; - f32 mMaxDist; - f32 mBackwardsDist; + float mMinDist; + float mMaxDist; + float mBackwardsDist; CVector3f mLookAtOffset; CVector3f mChaseLookAtOffset; CVector3f mBallToCam; - f32 mFov; - f32 mAttitudeRange; - f32 mAzimuthRange; - f32 mAnglePerSecond; - f32 mClampVelRange; - f32 mClampRotRange; - f32 mElevation; - f32 mInterpolateTime; - f32 mClampVelTime; - f32 mControlInterpDur; + float mFov; + float mAttitudeRange; + float mAzimuthRange; + float mAnglePerSecond; + float mClampVelRange; + float mClampRotRange; + float mElevation; + float mInterpolateTime; + float mClampVelTime; + float mControlInterpDur; }; #endif // __CCAMERAHINT_HPP__ diff --git a/src/Kyoto/Graphics/CCubeMaterial.cpp b/src/Kyoto/Graphics/CCubeMaterial.cpp index 1665eb4e..9c0ea1ae 100644 --- a/src/Kyoto/Graphics/CCubeMaterial.cpp +++ b/src/Kyoto/Graphics/CCubeMaterial.cpp @@ -53,8 +53,8 @@ inline void CGX::SetTevKAlphaSel(GXTevStageID stageId, GXTevKAlphaSel sel) { #include "Kyoto/Math/CTransform4f.hpp" -CVector3f sPlayerPosition; -CVector3f CCubeMaterial::sViewingFrom; +CVector3f sPlayerPosition = CVector3f::Zero(); +CVector3f CCubeMaterial::sViewingFrom = CVector3f::Zero(); static CTransform4f sTextureProjectionTransform = CTransform4f::Identity(); void CCubeMaterial::SetupBlendMode(uint blendFactors, const CModelFlags& flags, bool alphaTest) { diff --git a/src/MetroidPrime/CObjectList.cpp b/src/MetroidPrime/CObjectList.cpp index e526d24c..308c558c 100644 --- a/src/MetroidPrime/CObjectList.cpp +++ b/src/MetroidPrime/CObjectList.cpp @@ -1,5 +1,7 @@ #include "MetroidPrime/CObjectList.hpp" +#include "MetroidPrime/CEntity.hpp" + CObjectList::SObjectListEntry::SObjectListEntry() : mEnt(nullptr), mNext(-1), mPrev(-1) {} CObjectList::CObjectList(EGameObjectList list) : mListType(list), mFirstId(-1), mCount(0) { diff --git a/src/MetroidPrime/Cameras/CCameraFilter.cpp b/src/MetroidPrime/Cameras/CCameraFilter.cpp index dead41a6..d13c74e9 100644 --- a/src/MetroidPrime/Cameras/CCameraFilter.cpp +++ b/src/MetroidPrime/Cameras/CCameraFilter.cpp @@ -1,17 +1,20 @@ #include "Kyoto/Graphics/CGraphics.hpp" +#include "Kyoto/Graphics/CTexture.hpp" #include "MetaRender/CCubeRenderer.hpp" #include "MetroidPrime/Cameras/CCameraFilterPass.hpp" +#include "stdlib.h" + // FIXME non-matching https://decomp.me/scratch/8N81d void CCameraFilterPass::DrawWideScreen(const CColor& color, const CTexture* tex, f32 lod) { const rstl::pair< CVector2f, CVector2f > vp = gpRender->SetViewportOrtho(true, -4096.f, 4096.f); - f32 left = vp.first.mX; - f32 dVar5 = -((vp.second.mX - vp.first.mX) * 0.0625f * 9.f - (vp.second.mY - vp.first.mY)) * 0.5f; - f32 bottom = vp.first.mY; - f32 right = vp.second.mX; - f32 top = vp.second.mY; + f32 left = vp.first.GetX(); + f32 dVar5 = -((vp.second.GetX() - vp.first.GetX()) * 0.0625f * 9.f - (vp.second.GetY() - vp.first.GetY())) * 0.5f; + f32 bottom = vp.first.GetY(); + f32 right = vp.second.GetX(); + f32 top = vp.second.GetY(); gpRender->SetDepthReadWrite(false, false); - gpRender->SetModelMatrix(CTransform4f::sIdentity); + gpRender->SetModelMatrix(CTransform4f::Identity()); if (tex != nullptr) { tex->Load(GX_TEXMAP0, CTexture::Repeat); } diff --git a/src/MetroidPrime/Cameras/CCameraHint.cpp b/src/MetroidPrime/Cameras/CCameraHint.cpp index f1c593c1..3eca7b97 100644 --- a/src/MetroidPrime/Cameras/CCameraHint.cpp +++ b/src/MetroidPrime/Cameras/CCameraHint.cpp @@ -1,12 +1,12 @@ #include "MetroidPrime/Cameras/CCameraHint.hpp" #include "Kyoto/Alloc/CMemory.hpp" -CCameraHint::CCameraHint(uint overrideFlags, CBallCamera::EBallCameraBehaviour behaviour, - float minDist, float maxDist, float backwardsDist, CVector3f* lookAtOffset, - CVector3f* chaseLookAtOffset, CVector3f* ballToCam, float fov, - float attitudeRange, float azimuthRange, float anglePerSecond, - float clampVelRange, float clampRotRange, float elevation, - float InterpolationTime, float clampVelTime, float controlInterpDur) +CCameraHint::CCameraHint(uint overrideFlags, CBallCamera::EBallCameraBehaviour behaviour, float minDist, + float maxDist, float backwardsDist, const CVector3f& lookAtOffset, + const CVector3f& chaseLookAtOffset, const CVector3f& ballToCam, float fov, + float attitudeRange, float azimuthRange, float anglePerSecond, float clampVelRange, + float clampRotRange, float elevation, float interpolateTime, float clampVelTime, + float controlInterpDur) : mOverrideFlags(overrideFlags) , mBehaviour(behaviour) , mMinDist(minDist) @@ -17,7 +17,6 @@ CCameraHint::CCameraHint(uint overrideFlags, CBallCamera::EBallCameraBehaviour b , mBallToCam(ballToCam) , mFov(fov) , mAttitudeRange(attitudeRange) -, mAzimuthRnage(azimuthRange) , mAnglePerSecond(anglePerSecond) , mClampVelRange(clampVelRange) , mClampRotRange(clampRotRange) diff --git a/src/MetroidPrime/main.cpp b/src/MetroidPrime/main.cpp index 9f70ef8a..4d9c4f8c 100644 --- a/src/MetroidPrime/main.cpp +++ b/src/MetroidPrime/main.cpp @@ -134,7 +134,7 @@ CMain::CMain() , x120_(0.f) , x124_(0.f) , x128_gameGlobalObjects(nullptr) -, x12c_flowState(kFS_Default) +, x12c_restartMode(kRM_Default) , x130_frameTimes(0xF4240) , x15c_frameTimeIdx(0) , x160_24_finished(false) @@ -688,7 +688,7 @@ int CMain::RsMain(int argc, const char* const* argv) { needsReset = true; } if (needsReset) { - x12c_flowState = kFS_Default; + x12c_restartMode = kRM_Default; CStreamAudioManager::StopAll(); PADRecalibrate(0xf0000000); CGraphics::SetIsBeginSceneClearFb(true);