DEADSOFTWARE

render: add option -dDISABLE_RENDER
[d2df-sdl.git] / src / game / sdl2 / g_system.pas
index 058a03b9c16980df7aafc7bc7b5db3482547f4da..74e8d0354079582af6be99980952b11d6e8f5769 100644 (file)
@@ -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 --------- *)
 
@@ -405,10 +407,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);