1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Fix mouse wrap in fullscreen (desktop)

This commit is contained in:
Mathieu Schroeter 2018-06-25 17:43:49 +02:00
parent 589b720474
commit 3834861c1e

View File

@ -1013,12 +1013,11 @@ CPixmap::FromGameToDisplay (Sint32 & x, Sint32 & y)
x *= factor;
y *= factor;
if (static_cast<double> (w) / h == static_cast<double> (SCRNUM) / SCRDEN)
if (!g_bFullScreen)
return;
double _w = w, _h = h;
double ratio = w * SCRDEN / SCRNUM;
x = x * ratio / LXIMAGE + (_w - ratio) / 2;
x = x * _w / LXIMAGE;
y = y * _h / LYIMAGE;
}