aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2011-03-01 05:45:56 +0100
committerJohannes Schickel2011-03-01 05:45:56 +0100
commit5ffecd85b332a73ef803b5755f80b6180883153e (patch)
treeb6c1eda8d284362a1c5b647378f6b3c9ad99eff4 /backends/graphics
parent484107907540bd07a5822bee075b450a1ade817c (diff)
downloadscummvm-rg350-5ffecd85b332a73ef803b5755f80b6180883153e.tar.gz
scummvm-rg350-5ffecd85b332a73ef803b5755f80b6180883153e.tar.bz2
scummvm-rg350-5ffecd85b332a73ef803b5755f80b6180883153e.zip
OPENGL: Limit maximum cursor scale.
This avoids too big cursors when the screen resolution is really high.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 50aabc6972..522c36e22d 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -845,7 +845,8 @@ void OpenGLGraphicsManager::refreshCursorScale() {
} else {
// Otherwise, scale the cursor for the overlay
int targetScaleFactor = MIN(_cursorTargetScale, _videoMode.scaleFactor);
- int actualFactor = screenScaleFactor - (targetScaleFactor - 1) * 10000;
+ // We limit the maximum scale to 3 here to avoid too big cursors, for large overlay resolutions
+ int actualFactor = MIN<uint>(3, screenScaleFactor - (targetScaleFactor - 1)) * 10000;
_cursorState.rW = (int16)(_cursorState.w * actualFactor / 10000);
_cursorState.rH = (int16)(_cursorState.h * actualFactor / 10000);
_cursorState.rHotX = (int16)(_cursorState.hotX * actualFactor / 10000);