2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 01:07:43 +00:00

CCameraManager: Collapse private static variables into functions

Four of the five variables aren't modified, so they can be specified
directly within the functions and just be reused in place of the
variable names. This allows the constants to be elided or put into
read-only memory if necessary. It also makes the mutable value explicit.
This commit is contained in:
Lioncash
2019-09-27 22:46:56 -04:00
parent 8591787409
commit 359f505787
2 changed files with 7 additions and 15 deletions

View File

@@ -15,11 +15,7 @@
#include "World/CExplosion.hpp"
namespace urde {
float CCameraManager::sAspect = 1.42f;
float CCameraManager::sFarPlane = 750.f;
float CCameraManager::sNearPlane = 0.2f;
float CCameraManager::sFirstPersonFOV = 55.f;
float CCameraManager::sThirdPersonFOV = 60.f;
CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) {
CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f,
@@ -135,13 +131,13 @@ void CCameraManager::CreateStandardCameras(CStateManager& stateMgr) {
TUniqueId fpId = stateMgr.AllocateUniqueId();
x7c_fpCamera =
new CFirstPersonCamera(fpId, zeus::CTransform(), stateMgr.Player()->GetUniqueId(),
g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, sNearPlane, sFarPlane, sAspect);
g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, NearPlane(), FarPlane(), Aspect());
stateMgr.AddObject(x7c_fpCamera);
stateMgr.Player()->SetCameraState(CPlayer::EPlayerCameraState::FirstPerson, stateMgr);
SetCurrentCameraId(fpId, stateMgr);
x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(),
zeus::CTransform(), sThirdPersonFOV, sNearPlane, sFarPlane, sAspect);
x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(), zeus::CTransform(),
ThirdPersonFOV(), NearPlane(), FarPlane(), Aspect());
stateMgr.AddObject(x80_ballCamera);
x88_interpCamera = new CInterpolationCamera(stateMgr.AllocateUniqueId(), zeus::CTransform());