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

Get size only when necessary

This commit is contained in:
Mathieu Schroeter 2018-06-27 18:19:38 +02:00
parent 4a21224de5
commit 190147015d

View File

@ -990,9 +990,6 @@ CPixmap::FromDisplayToGame (Sint32 & x, Sint32 & y, double prevScale)
void
CPixmap::FromGameToDisplay (Sint32 & x, Sint32 & y)
{
Sint32 w, h;
SDL_GetWindowSize (g_window, &w, &h);
double factor = 1;
if (!g_bFullScreen)
@ -1004,6 +1001,9 @@ CPixmap::FromGameToDisplay (Sint32 & x, Sint32 & y)
if (!g_bFullScreen)
return;
Sint32 w, h;
SDL_GetWindowSize (g_window, &w, &h);
double _w = w, _h = h;
x = x * _w / LXIMAGE ();