X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_system.pas;h=daec5d954e8ecc1885f9e8f5d5b2360ccfb83bc7;hb=67a536daf73aa6f586896b521dd4029a1068df27;hp=bc60586efecc3ccee0b8fecc7421d4bd3256ae59;hpb=5ff315211d9cab4ed4b38c339857a06611d9b0ed;p=d2df-sdl.git diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index bc60586..daec5d9 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -48,7 +48,7 @@ implementation {$IFDEF ENABLE_HOLMES} sdlcarcass, {$ENDIF} - {$IFNDEF HEADLESS} + {$IFDEF ENABLE_RENDER} r_render, {$ENDIF} {$IFDEF ENABLE_MENU} @@ -71,9 +71,11 @@ implementation JoystickHatState: array [0..e_MaxJoys - 1, 0..e_MaxJoyHats - 1, HAT_LEFT..HAT_DOWN] of Boolean; JoystickZeroAxes: array [0..e_MaxJoys - 1, 0..e_MaxJoyAxes - 1] of Integer; +{$IFDEF ENABLE_TOUCH} var (* touch *) angleFire: Boolean; keyFinger: array [VK_FIRSTKEY..VK_LASTKEY] of Integer; +{$ENDIF} (* --------- Graphics --------- *) @@ -390,15 +392,13 @@ implementation procedure sys_ShowKeyboard (yes: Boolean); begin - {$IFNDEF HEADLESS} - if g_dbg_input then - e_LogWritefln('g_Touch_ShowKeyboard(%s)', [yes]); - (* on desktop we always receive text (needed for cheats) *) - if yes or (SDL_HasScreenKeyboardSupport() = SDL_FALSE) then - SDL_StartTextInput - else - SDL_StopTextInput - {$ENDIF} + if g_dbg_input then + e_LogWritefln('g_Touch_ShowKeyboard(%s)', [yes]); + (* on desktop we always receive text (needed for cheats) *) + if yes or (SDL_HasScreenKeyboardSupport() = SDL_FALSE) then + SDL_StartTextInput + else + SDL_StopTextInput end; procedure HandleTouch (const ev: TSDL_TouchFingerEvent); @@ -406,10 +406,16 @@ implementation x, y, i, finger: Integer; function IntersectControl(ctl, xx, yy: Integer): Boolean; - var x, y, w, h: Integer; founded: Boolean; + {$IFDEF ENABLE_RENDER} + var x, y, w, h: Integer; founded: Boolean; + {$ENDIF} begin - r_Render_GetKeyRect(ctl, x, y, w, h, founded); - result := founded and (xx >= x) and (yy >= y) and (xx <= x + w) and (yy <= y + h); + {$IFDEF ENABLE_RENDER} + r_Render_GetKeyRect(ctl, x, y, w, h, founded); + Result := founded and (xx >= x) and (yy >= y) and (xx <= x + w) and (yy <= y + h); + {$ELSE} + Result := False + {$ENDIF} end; procedure KeyUp (finger, i: Integer);