summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2020-01-24 00:06:39 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2020-01-24 09:20:41 -0600
commitb92f6480a0b7517666ad139fc81c89033f84830f (patch)
tree867c2725a11dba2265cb5c1ed5c7b2a4131a4dae /Source/Core/VideoCommon/RenderBase.cpp
parent42c03c4dadd9e507a91b07bb01ff597bbd1df728 (diff)
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 71281defdf..03e277d563 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -50,6 +50,8 @@
#include "Core/Host.h"
#include "Core/Movie.h"
+#include "InputCommon/ControllerInterface/ControllerInterface.h"
+
#include "VideoCommon/AbstractFramebuffer.h"
#include "VideoCommon/AbstractStagingTexture.h"
#include "VideoCommon/AbstractTexture.h"
@@ -119,6 +121,9 @@ bool Renderer::Initialize()
void Renderer::Shutdown()
{
+ // Disable ControllerInterface's aspect ratio adjustments so mapping dialog behaves normally.
+ g_controller_interface.SetAspectRatioAdjustment(1);
+
// First stop any framedumping, which might need to dump the last xfb frame. This process
// can require additional graphics sub-systems so it needs to be done first
ShutdownFrameDumping();
@@ -775,10 +780,15 @@ void Renderer::UpdateDrawRectangle()
g_Config.fAspectRatioHackH = 1;
}
- float draw_width, draw_height, crop_width, crop_height;
-
// get the picture aspect ratio
- draw_width = crop_width = CalculateDrawAspectRatio();
+ const float draw_aspect_ratio = CalculateDrawAspectRatio();
+
+ // Make ControllerInterface aware of the render window region actually being used
+ // to adjust mouse cursor inputs.
+ g_controller_interface.SetAspectRatioAdjustment(draw_aspect_ratio / (win_width / win_height));
+
+ float draw_width, draw_height, crop_width, crop_height;
+ draw_width = crop_width = draw_aspect_ratio;
draw_height = crop_height = 1;
// crop the picture to a standard aspect ratio