2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

Update hecl, more CVar imps

This commit is contained in:
2019-09-29 08:17:47 -07:00
parent 56b198838f
commit 79ac5d76df
7 changed files with 61 additions and 16 deletions

View File

@@ -6,6 +6,10 @@
#include "World/CScriptCameraPitchVolume.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
namespace DataSpec::DNAMP1 {
extern hecl::CVar* tw_fov;
}
namespace urde {
CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf, TUniqueId watchedObj,
@@ -15,6 +19,7 @@ CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf
, x188_orbitCameraSpeed(orbitCameraSpeed)
, x190_gunFollowXf(xf) {
x1c6_24_deferBallTransitionProcessing = false;
DataSpec::DNAMP1::tw_fov->addListener([this](hecl::CVar* cv) { _fovListener(cv); });
}
void CFirstPersonCamera::Accept(IVisitor& visitor) { visitor.Visit(this); }
@@ -325,4 +330,10 @@ void CFirstPersonCamera::UpdateElevation(CStateManager& mgr) {
}
}
}
void CFirstPersonCamera::_fovListener(hecl::CVar* cv) {
x15c_currentFov = x180_perspInterpStartFov = x184_perspInterpEndFov = cv->toReal();
x170_24_perspDirty = true;
}
} // namespace urde

View File

@@ -17,7 +17,7 @@ class CFirstPersonCamera : public CGameCamera {
bool x1c6_24_deferBallTransitionProcessing : 1;
zeus::CVector3f x1c8_closeInVec;
float x1d4_closeInTimer = 0.f;
void _fovListener(hecl::CVar* cv);
public:
CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float orbitCameraSpeed, float fov,
float nearplane, float farplane, float aspect);