mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 23:08:47 +00:00
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
This commit is contained in:
parent
42c03c4dad
commit
b92f6480a0
9 changed files with 59 additions and 21 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#include "Common/Matrix.h"
|
||||
#include "Common/WindowSystemInfo.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
|
@ -52,6 +53,14 @@ public:
|
|||
bool IsInit() const { return m_is_init; }
|
||||
void UpdateInput();
|
||||
|
||||
// Set adjustment from the full render window aspect-ratio to the drawn aspect-ratio.
|
||||
// Used to fit mouse cursor inputs to the relevant region of the render window.
|
||||
void SetAspectRatioAdjustment(float);
|
||||
|
||||
// Calculated from the aspect-ratio adjustment.
|
||||
// Inputs based on window coordinates should be multiplied by this.
|
||||
Common::Vec2 GetWindowInputScale() const;
|
||||
|
||||
HotplugCallbackHandle RegisterDevicesChangedCallback(std::function<void(void)> callback);
|
||||
void UnregisterDevicesChangedCallback(const HotplugCallbackHandle& handle);
|
||||
void InvokeDevicesChangedCallbacks() const;
|
||||
|
@ -62,6 +71,7 @@ private:
|
|||
std::atomic<bool> m_is_init;
|
||||
std::atomic<bool> m_is_populating_devices{false};
|
||||
WindowSystemInfo m_wsi;
|
||||
std::atomic<float> m_aspect_ratio_adjustment = 1;
|
||||
};
|
||||
|
||||
extern ControllerInterface g_controller_interface;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue