From 1124d1db316c8b1bd67bcb00520b3a55d99d5cf4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 7 Jan 2015 20:37:08 +0100 Subject: OPENGL: Fix truncation issue resulting in wrong mouse coordinates. --- backends/graphics/opengl/opengl-graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/graphics/opengl') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index bace9f468f..5821856c30 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -928,8 +928,8 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) { const int16 width = _gameScreen->getWidth(); const int16 height = _gameScreen->getHeight(); - x = (x * width) / _displayWidth; - y = (y * height) / _displayHeight; + x = (x * width) / (int)_displayWidth; + y = (y * height) / (int)_displayHeight; // Make sure we only supply valid coordinates. x = CLIP(x, 0, width - 1); -- cgit v1.2.3