Skip to content

Commit

Permalink
VideoCommon: Fix crash that occurs on loading a fifo log due to unini…
Browse files Browse the repository at this point in the history
…tialized Free Look control type
  • Loading branch information
iwubcode committed Dec 26, 2020
1 parent 6ddf69d commit 16dc2fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Core/VideoCommon/FreeLookCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class OrbitalController : public CameraController
};
} // namespace

FreeLookCamera::FreeLookCamera()
{
SetControlType(FreeLook::ControlType::SixAxis);
}

void FreeLookCamera::SetControlType(FreeLook::ControlType type)
{
if (m_current_type && *m_current_type == type)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/FreeLookCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class CameraController
class FreeLookCamera
{
public:
FreeLookCamera();
void SetControlType(FreeLook::ControlType type);
Common::Matrix44 GetView();
Common::Vec2 GetFieldOfView() const;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/RenderBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 16dc2fa

Please sign in to comment.