diff --git a/Source/Core/VideoCommon/FreeLookCamera.cpp b/Source/Core/VideoCommon/FreeLookCamera.cpp index 7a15674da2..44907f7e70 100644 --- a/Source/Core/VideoCommon/FreeLookCamera.cpp +++ b/Source/Core/VideoCommon/FreeLookCamera.cpp @@ -258,10 +258,26 @@ void FreeLookCamera::Reset() m_dirty = true; } +void FreeLookCamera::ModifySpeed(float multiplier) +{ + m_speed *= multiplier; +} + +void FreeLookCamera::ResetSpeed() +{ + m_speed = 1.0f; +} + +float FreeLookCamera::GetSpeed() const +{ + return m_speed; +} + void FreeLookCamera::DoState(PointerWrap& p) { if (p.mode == PointerWrap::MODE_WRITE || p.mode == PointerWrap::MODE_MEASURE) { + p.Do(m_speed); p.Do(m_current_type); p.Do(m_fov_x); p.Do(m_fov_y); @@ -273,6 +289,7 @@ void FreeLookCamera::DoState(PointerWrap& p) else { const auto old_type = m_current_type; + p.Do(m_speed); p.Do(m_current_type); p.Do(m_fov_x); p.Do(m_fov_y); diff --git a/Source/Core/VideoCommon/FreeLookCamera.h b/Source/Core/VideoCommon/FreeLookCamera.h index 0a35e20972..a3e032e55d 100644 --- a/Source/Core/VideoCommon/FreeLookCamera.h +++ b/Source/Core/VideoCommon/FreeLookCamera.h @@ -63,6 +63,10 @@ public: bool IsDirty() const; void SetClean(); + void ModifySpeed(float multiplier); + void ResetSpeed(); + float GetSpeed() const; + private: bool m_dirty = false; float m_fov_x = 1.0f; @@ -71,6 +75,7 @@ private: std::unique_ptr m_camera_controller; float m_fov_step_size = 0.025f; + float m_speed = 1.0f; }; extern FreeLookCamera g_freelook_camera;