[Scummvm-git-logs] scummvm master -> c3f4936d1ba2af178816cc9bb06087025e4a2bea
spleen1981
noreply at scummvm.org
Fri Jul 31 08:53:10 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
c3f4936d1b LIBRETRO: fix not visible mouse cursor
Commit: c3f4936d1ba2af178816cc9bb06087025e4a2bea
https://github.com/scummvm/scummvm/commit/c3f4936d1ba2af178816cc9bb06087025e4a2bea
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-07-31T10:52:57+02:00
Commit Message:
LIBRETRO: fix not visible mouse cursor
Changed paths:
backends/platform/libretro/src/libretro-graphics-opengl.cpp
backends/platform/libretro/src/libretro-graphics-surface.cpp
diff --git a/backends/platform/libretro/src/libretro-graphics-opengl.cpp b/backends/platform/libretro/src/libretro-graphics-opengl.cpp
index 9c77c2ee8cf..85854dfc03b 100644
--- a/backends/platform/libretro/src/libretro-graphics-opengl.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-opengl.cpp
@@ -55,11 +55,8 @@ void LibretroOpenGLGraphics::overrideCursorScaling() {
OpenGL::OpenGLGraphicsManager::recalculateCursorScaling();
if (_cursor) {
- const float screenScaleFactorX = (_cursorScaleX == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
- const float screenScaleFactorY = (_cursorScaleY == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
-
- const float cursorScaleFactorX = screenScaleFactorX * _cursorScaleX;
- const float cursorScaleFactorY = screenScaleFactorY * _cursorScaleY;
+ const float cursorScaleFactorX = (_cursorScaleX == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200 * _cursorScaleX; /* hard coded as base resolution 320x200 is hard coded upstream */
+ const float cursorScaleFactorY = (_cursorScaleY == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200 * _cursorScaleY; /* hard coded as base resolution 320x200 is hard coded upstream */
_cursorHotspotXScaled = _cursorHotspotX * cursorScaleFactorX;
_cursorWidthScaled = _cursor->getWidth() * cursorScaleFactorX;
diff --git a/backends/platform/libretro/src/libretro-graphics-surface.cpp b/backends/platform/libretro/src/libretro-graphics-surface.cpp
index 0889ed3fcda..8405e6c4336 100644
--- a/backends/platform/libretro/src/libretro-graphics-surface.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-surface.cpp
@@ -169,17 +169,14 @@ void LibretroGraphics::warpMouse(int x, int y) {
}
void LibretroGraphics::overrideCursorScaling() {
- const float screenScaleFactorX = (_cursorScaleX == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
- const float screenScaleFactorY = (_cursorScaleY == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
+ const float cursorScaleFactorX = (_cursorScaleX == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200 * _cursorScaleX; /* hard coded as base resolution 320x200 is hard coded upstream */
+ const float cursorScaleFactorY = (_cursorScaleY == 0 || ! _overlayVisible) ? 1.0f : (float)getWindowHeight() / 200 * _cursorScaleY; /* hard coded as base resolution 320x200 is hard coded upstream */
- const float cursorScaleFactorX = screenScaleFactorX * _cursorScaleX;
- const float cursorScaleFactorY = screenScaleFactorY * _cursorScaleY;
+ _cursorHotspotXScaled = _cursorHotspotX * cursorScaleFactorX;
+ _cursorWidthScaled = _cursor.w * cursorScaleFactorX;
- _cursorHotspotXScaled = fracToInt(_cursorHotspotX * cursorScaleFactorX);
- _cursorWidthScaled = fracToDouble(_cursor.w * cursorScaleFactorX);
-
- _cursorHotspotYScaled = fracToInt(_cursorHotspotY * cursorScaleFactorY);
- _cursorHeightScaled = fracToDouble(_cursor.h * cursorScaleFactorY);
+ _cursorHotspotYScaled = _cursorHotspotY * cursorScaleFactorY;
+ _cursorHeightScaled = _cursor.h * cursorScaleFactorY;
}
void LibretroGraphics::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, const Graphics::PixelFormat *format, const byte *mask, frac_t scaleX, frac_t scaleY) {
More information about the Scummvm-git-logs
mailing list