X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_touch.pas;h=12a46645989b8d016dd6cc056c3aeab61e4ad935;hb=d0936017ccb8a078d1b03f55478af284bb015bbc;hp=697187971a198bea8a001a8badf3f9703206fd64;hpb=724d5405f0f3fe166b931b1b8b5745b2eb340651;p=d2df-sdl.git diff --git a/src/game/sdl2/g_touch.pas b/src/game/sdl2/g_touch.pas index 6971879..12a4664 100644 --- a/src/game/sdl2/g_touch.pas +++ b/src/game/sdl2/g_touch.pas @@ -36,7 +36,7 @@ implementation uses SysUtils, - e_log, e_graphics, e_input, g_options, g_game, g_main, g_gui, g_weapons, g_console, g_window; + e_log, r_graphics, e_input, g_options, g_game, g_gui, g_weapons, g_console, g_window; var angleFire: Boolean; @@ -58,10 +58,14 @@ implementation begin founded := false; - if SDL_GetDisplayDPI(0, @dpi, nil, nil) <> 0 then + {$IFNDEF SDL2_NODPI} + if SDL_GetDisplayDPI(0, @dpi, nil, nil) <> 0 then + dpi := 96; + {$ELSE} dpi := 96; + {$ENDIF} - sz := Trunc(g_touch_size * dpi); sw := gScreenWidth; sh := gScreenHeight; + sz := Trunc(g_touch_size * dpi); sw := gWinSizeX; sh := gWinSizeY; x := 0; y := Round(sh * g_touch_offset / 100); w := sz; h := sz; @@ -270,8 +274,8 @@ implementation Exit; finger := ev.fingerId + 2; - x := Trunc(ev.x * gScreenWidth); - y := Trunc(ev.y * gScreenHeight); + x := Trunc(ev.x * gWinSizeX); + y := Trunc(ev.y * gWinSizeY); for i := VK_FIRSTKEY to VK_LASTKEY do begin