aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2014-02-12 17:15:07 +0100
committerJohannes Schickel2014-02-12 17:15:07 +0100
commitac5907a8046cd7ab66e43ac7e7e2d39863984917 (patch)
tree35d83af8781d22c9222ecf11128b25377ca0dd55 /backends
parent6576dd758bfaf078abfb430d4b9c99b7047e4308 (diff)
downloadscummvm-rg350-ac5907a8046cd7ab66e43ac7e7e2d39863984917.tar.gz
scummvm-rg350-ac5907a8046cd7ab66e43ac7e7e2d39863984917.tar.bz2
scummvm-rg350-ac5907a8046cd7ab66e43ac7e7e2d39863984917.zip
OPENGL: Use frac_t for cursor scaling.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index a0651f2eb1..dfba14abe6 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -1072,14 +1072,14 @@ void OpenGLGraphicsManager::recalculateCursorScaling() {
// In case scaling is actually enabled we will scale the cursor according
// to the game screen.
if (!_cursorDontScale) {
- const uint screenScaleFactorX = _displayWidth * 10000 / _gameScreen->getWidth();
- const uint screenScaleFactorY = _displayHeight * 10000 / _gameScreen->getHeight();
+ const frac_t screenScaleFactorX = intToFrac(_displayWidth) / _gameScreen->getWidth();
+ const frac_t screenScaleFactorY = intToFrac(_displayHeight) / _gameScreen->getHeight();
- _cursorHotspotXScaled = (_cursorHotspotXScaled * screenScaleFactorX) / 10000;
- _cursorWidthScaled = (_cursorWidthScaled * screenScaleFactorX) / 10000;
+ _cursorHotspotXScaled = fracToInt(_cursorHotspotXScaled * screenScaleFactorX);
+ _cursorWidthScaled = fracToInt(_cursorWidthScaled * screenScaleFactorX);
- _cursorHotspotYScaled = (_cursorHotspotYScaled * screenScaleFactorY) / 10000;
- _cursorHeightScaled = (_cursorHeightScaled * screenScaleFactorY) / 10000;
+ _cursorHotspotYScaled = fracToInt(_cursorHotspotYScaled * screenScaleFactorY);
+ _cursorHeightScaled = fracToInt(_cursorHeightScaled * screenScaleFactorY);
}
}