From 9625b336e289c7b755b221f45bad72d8afdbe399 Mon Sep 17 00:00:00 2001 From: Giovanni Cascione Date: Tue, 12 Nov 2024 00:35:25 +0100 Subject: [PATCH] LIBRETRO: limit cursor scaling to overlays As game screen is always drawn at original resolution --- backends/platform/libretro/src/libretro-graphics-opengl.cpp | 2 +- backends/platform/libretro/src/libretro-graphics-surface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/platform/libretro/src/libretro-graphics-opengl.cpp b/backends/platform/libretro/src/libretro-graphics-opengl.cpp index 641f617a78b..ec2669f01a5 100644 --- a/backends/platform/libretro/src/libretro-graphics-opengl.cpp +++ b/backends/platform/libretro/src/libretro-graphics-opengl.cpp @@ -55,7 +55,7 @@ void LibretroOpenGLGraphics::overrideCursorScaling(){ OpenGL::OpenGLGraphicsManager::recalculateCursorScaling(); if (_cursor){ - const frac_t screenScaleFactor = _cursorDontScale ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */ + const frac_t screenScaleFactor = (_cursorDontScale || ! _overlayVisible) ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */ _cursorHotspotXScaled = fracToInt(_cursorHotspotX * screenScaleFactor); _cursorWidthScaled = fracToDouble(_cursor->getWidth() * screenScaleFactor); diff --git a/backends/platform/libretro/src/libretro-graphics-surface.cpp b/backends/platform/libretro/src/libretro-graphics-surface.cpp index bbff18d9dbb..9fd41742729 100644 --- a/backends/platform/libretro/src/libretro-graphics-surface.cpp +++ b/backends/platform/libretro/src/libretro-graphics-surface.cpp @@ -169,7 +169,7 @@ void LibretroGraphics::warpMouse(int x, int y) { } void LibretroGraphics::overrideCursorScaling(){ - const frac_t screenScaleFactor = _cursorDontScale ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */ + const frac_t screenScaleFactor = (_cursorDontScale || ! _overlayVisible) ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */ _cursorHotspotXScaled = fracToInt(_cursorHotspotX * screenScaleFactor); _cursorWidthScaled = fracToDouble(_cursor.w * screenScaleFactor);