VideoCommon: Fix crash that occurs on loading a fifo log due to uninitialized Free Look control type

This commit is contained in:
iwubcode 2020-12-25 22:19:09 -06:00
parent 6ddf69d094
commit 16dc2fa379
3 changed files with 7 additions and 0 deletions

View File

@ -175,6 +175,11 @@ private:
};
} // namespace
FreeLookCamera::FreeLookCamera()
{
SetControlType(FreeLook::ControlType::SixAxis);
}
void FreeLookCamera::SetControlType(FreeLook::ControlType type)
{
if (m_current_type && *m_current_type == type)

View File

@ -41,6 +41,7 @@ public:
class FreeLookCamera
{
public:
FreeLookCamera();
void SetControlType(FreeLook::ControlType type);
Common::Matrix44 GetView();
Common::Vec2 GetFieldOfView() const;

View File

@ -111,6 +111,7 @@ Renderer::Renderer(int backbuffer_width, int backbuffer_height, float backbuffer
CalculateTargetSize();
m_is_game_widescreen = SConfig::GetInstance().bWii && Config::Get(Config::SYSCONF_WIDESCREEN);
g_freelook_camera.SetControlType(FreeLook::GetActiveConfig().camera_config.control_type);
}
Renderer::~Renderer() = default;