GIT
/
REPO
/
FRED-BOY
Projects
/
d2df-sdl.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
render: move e_texture -> r_texture
[d2df-sdl.git]
/
src
/
game
/
sdl2
/
g_touch.pas
diff --git
a/src/game/sdl2/g_touch.pas
b/src/game/sdl2/g_touch.pas
index 697187971a198bea8a001a8badf3f9703206fd64..c6a9e232048d3e5b670ad063c7f92a4753e990a9 100644
(file)
--- a/
src/game/sdl2/g_touch.pas
+++ b/
src/game/sdl2/g_touch.pas
@@
-36,7
+36,7
@@
implementation
uses
SysUtils,
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_main, g_gui, g_weapons, g_console, g_window;
var
angleFire: Boolean;
var
angleFire: Boolean;
@@
-58,10
+58,14
@@
implementation
begin
founded := false;
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;
dpi := 96;
+ {$ENDIF}
- sz := Trunc(g_touch_size * dpi); sw := g
ScreenWidth; sh := gScreenHeight
;
+ sz := Trunc(g_touch_size * dpi); sw := g
WinSizeX; sh := gWinSizeY
;
x := 0; y := Round(sh * g_touch_offset / 100);
w := sz; h := sz;
x := 0; y := Round(sh * g_touch_offset / 100);
w := sz; h := sz;
@@
-270,8
+274,8
@@
implementation
Exit;
finger := ev.fingerId + 2;
Exit;
finger := ev.fingerId + 2;
- x := Trunc(ev.x * g
ScreenWidth
);
- y := Trunc(ev.y * g
ScreenHeight
);
+ x := Trunc(ev.x * g
WinSizeX
);
+ y := Trunc(ev.y * g
WinSizeY
);
for i := VK_FIRSTKEY to VK_LASTKEY do
begin
for i := VK_FIRSTKEY to VK_LASTKEY do
begin
DEADSOFTWARE 2012-2025