DEADSOFTWARE

game: less references to HEADLESS
[d2df-sdl.git] / src / game / sdl2 / g_system.pas
index abfbfb322dfebceeb83d4f5c9b99fd7ee204e6fb..d42612803e82798cae30add27b89fca8c7d39724 100644 (file)
@@ -48,7 +48,7 @@ implementation
     {$IFDEF ENABLE_HOLMES}
       sdlcarcass,
     {$ENDIF}
-    {$IFNDEF HEADLESS}
+    {$IFDEF ENABLE_RENDER}
       r_render,
     {$ENDIF}
     {$IFDEF ENABLE_MENU}
@@ -391,15 +391,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);
@@ -407,10 +405,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);