From ac5907a8046cd7ab66e43ac7e7e2d39863984917 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Use frac_t for cursor scaling. --- backends/graphics/opengl/opengl-graphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/graphics') 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); } } -- cgit v1.2.3