DEADSOFTWARE

game: disable gibs for server
[d2df-sdl.git] / src / game / g_game.pas
index 2ce5d95e7107a6b547b0e99670db518ec0335e59..019fdc48445c2c861b49055aff9302419817fc90 100644 (file)
@@ -17,12 +17,15 @@ unit g_game;
 
 interface
 
-uses
-  SysUtils, Classes,
-  MAPDEF,
-  g_base, g_basic, g_player, r_graphics, g_res_downloader,
-  g_sound, g_gui, utils, md5, mempool, xprofiler,
-  g_touch, g_weapons;
+  uses
+    {$IFDEF ENABLE_MENU}
+      g_gui,
+    {$ENDIF}
+    SysUtils, Classes, MAPDEF,
+    g_base, g_basic, g_player, g_res_downloader,
+    g_sound, utils, md5, mempool, xprofiler,
+    g_weapons
+  ;
 
 type
   TGameSettings = record
@@ -86,7 +89,6 @@ procedure g_Game_FreeData();
 procedure g_Game_Update();
 procedure g_Game_PreUpdate();
 procedure g_Game_Quit();
-procedure g_Game_SetupScreenSize();
 function  g_Game_ModeToText(Mode: Byte): string;
 function  g_Game_TextToMode(Mode: string): Byte;
 procedure g_Game_ExecuteEvent(Name: String);
@@ -111,7 +113,6 @@ function  g_Game_GetNextMap(): String;
 procedure g_Game_NextLevel();
 procedure g_Game_Pause(Enable: Boolean);
 procedure g_Game_HolmesPause(Enable: Boolean);
-procedure g_Game_InGameMenu(Show: Boolean);
 function  g_Game_IsWatchedPlayer(UID: Word): Boolean;
 function  g_Game_IsWatchedTeam(Team: Byte): Boolean;
 procedure g_Game_Message(Msg: String; Time: Word);
@@ -126,7 +127,9 @@ procedure g_Game_Announce_KillCombo(Param: Integer);
 procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
 procedure g_Game_StartVote(Command, Initiator: string);
 procedure g_Game_CheckVote;
-procedure g_TakeScreenShot(Filename: string = '');
+{$IFNDEF HEADLESS}
+  procedure g_TakeScreenShot(Filename: string = '');
+{$ENDIF}
 procedure g_FatalError(Text: String);
 procedure g_SimpleError(Text: String);
 function  g_Game_IsTestMap(): Boolean;
@@ -147,8 +150,14 @@ function IsActivePlayer(p: TPlayer): Boolean;
 function GetActivePlayerID_Next(Skip: Integer = -1): Integer;
 procedure SortGameStat(var stat: TPlayerStatArray);
 
-procedure KeyPress (K: Word);
-procedure CharPress (C: AnsiChar);
+
+{$IFDEF ENABLE_MENU}
+  procedure g_Game_InGameMenu(Show: Boolean);
+{$ENDIF}
+{$IFNDEF HEADLESS}
+  procedure CharPress (C: AnsiChar);
+{$ENDIF}
+  procedure KeyPress (K: Word);
 
 { procedure SetWinPause(Enable: Boolean); }
 
@@ -171,8 +180,6 @@ const
   GM_COOP = 4;
   GM_SINGLE = 5;
 
-  MESSAGE_DIKEY = WM_USER + 1;
-
   EXIT_QUIT            = 1;
   EXIT_SIMPLE          = 2;
   EXIT_RESTART         = 3;
@@ -435,16 +442,28 @@ function gPause (): Boolean; inline;
 implementation
 
 uses
-{$IFDEF ENABLE_HOLMES}
-  g_holmes,
-{$ENDIF}
-  e_res, g_window, g_menu, r_render, r_gfx,
-  e_input, e_log, g_console, r_console, g_items, g_map, g_panel,
-  g_playermodel, g_gfx, g_options, Math,
+  {$IFDEF ENABLE_HOLMES}
+    g_holmes,
+  {$ENDIF}
+  {$IFDEF ENABLE_MENU}
+    g_menu,
+  {$ENDIF}
+  {$IFDEF ENABLE_GFX}
+    g_gfx,
+  {$ENDIF}
+  {$IFDEF ENABLE_GIBS}
+    g_gibs,
+  {$ENDIF}
+  {$IFNDEF HEADLESS}
+    r_render, g_system,
+  {$ENDIF}
+  e_res, g_window,
+  e_input, e_log, g_console, g_items, g_map, g_panel,
+  g_playermodel, g_options, Math,
   g_triggers, g_monsters, e_sound, CONFIG,
   g_language, g_net, g_phys,
   ENet, e_msg, g_netmsg, g_netmaster,
-  sfs, wadreader, g_system, r_playermodel;
+  sfs, wadreader;
 
   var
     charbuff: packed array [0..15] of AnsiChar = (
@@ -686,13 +705,10 @@ Cheated:
 end;
 
 
+{$IFDEF ENABLE_MENU}
 procedure KeyPress (K: Word);
-{$IFNDEF HEADLESS}
-var
-  Msg: g_gui.TMessage;
-{$ENDIF}
+  var Msg: g_gui.TMessage;
 begin
-{$IFNDEF HEADLESS}
   case K of
     VK_ESCAPE: // <Esc>:
       begin
@@ -765,31 +781,48 @@ begin
         end;
       end;
   end;
-{$ENDIF}
 end;
-
-procedure CharPress (C: AnsiChar);
-var
-  Msg: g_gui.TMessage;
-  a: Integer;
-begin
-  if gConsoleShow or gChatShow then
-  begin
-    g_Console_Char(C)
-  end
-  else if (g_ActiveWindow <> nil) then
+{$ELSE}
+  procedure KeyPress (K: Word);
   begin
-    Msg.Msg := WM_CHAR;
-    Msg.WParam := Ord(C);
-    g_ActiveWindow.OnMessage(Msg);
-  end
-  else
+    gJustChatted := False;
+    if gConsoleShow or gChatShow then
+    begin
+      g_Console_Control(K);
+    end
+  end;
+{$ENDIF}
+
+{$IFNDEF HEADLESS}
+  procedure CharPress (C: AnsiChar);
+    {$IFDEF ENABLE_MENU}
+      var Msg: g_gui.TMessage;
+    {$ENDIF}
+    var a: Integer;
   begin
-    for a := 0 to 14 do charbuff[a] := charbuff[a+1];
-    charbuff[15] := upcase1251(C);
-    Cheat();
+    if gConsoleShow or gChatShow then
+    begin
+      g_Console_Char(C);
+    end
+    {$IFDEF ENABLE_MENU}
+      else if g_ActiveWindow <> nil then
+      begin
+        Msg.Msg := WM_CHAR;
+        Msg.WParam := Ord(C);
+        g_ActiveWindow.OnMessage(Msg);
+      end
+    {$ENDIF}
+    else
+    begin
+      for a := 0 to 14 do
+      begin
+        charbuff[a] := charbuff[a + 1];
+      end;
+      charbuff[15] := upcase1251(C);
+      Cheat;
+    end;
   end;
-end;
+{$ENDIF}
 
 
 // ////////////////////////////////////////////////////////////////////////// //
@@ -888,7 +921,6 @@ var
   UPSTime: LongWord;
   DataLoaded: Boolean = False;
   MessageTime: Word;
-  MessageLineLength: Integer = 80;
   MapList: SSArray = nil;
   MapIndex: Integer = -1;
   InterReadyTime: Integer = -1;
@@ -1227,7 +1259,10 @@ begin
   MessageText := '';
 
   EndingGameCounter := 0;
+
+{$IFDEF ENABLE_MENU}
   g_ActiveWindow := nil;
+{$ENDIF}
 
   gLMSRespawn := LMS_RESPAWN_NONE;
   gLMSRespawnTime := 0;
@@ -1236,20 +1271,23 @@ begin
     EXIT_SIMPLE: // Выход через меню или конец теста
       begin
         g_Game_Free();
-
         if gMapOnce  then
-          begin // Это был тест
-            g_Game_Quit();
-          end
+        begin // Это был тест
+          g_Game_Quit();
+        end
         else
-          begin // Выход в главное меню
+        begin // Выход в главное меню
+          {$IFDEF DISABLE_MENU}
+            gState := STATE_MENU; // ???
+          {$ELSE}
             gMusic.SetByName('MUSIC_MENU');
             gMusic.Play();
             if gState <> STATE_SLIST then
             begin
               g_GUI_ShowWindow('MainMenu');
               gState := STATE_MENU;
-            end else
+            end
+            else
             begin
               // Обновляем список серверов
               slReturnPressed := True;
@@ -1262,9 +1300,9 @@ begin
                 slWaitStr := _lc[I_NET_SLIST_ERROR];
               g_Serverlist_GenerateTable(slCurrent, slTable);
             end;
-
-            g_Game_ExecuteEvent('ongameend');
-          end;
+          {$ENDIF}
+          g_Game_ExecuteEvent('ongameend');
+        end;
       end;
 
     EXIT_RESTART: // Начать уровень сначала
@@ -1634,6 +1672,7 @@ begin
     end
   end;
 
+{$IFDEF ENABLE_MENU}
   // HACK: add dynlight here
   if gwin_k8_enable_light_experiments then
   begin
@@ -1648,6 +1687,7 @@ begin
   end;
 
   if gwin_has_stencil and g_playerLight then g_AddDynLight(plr.GameX+32, plr.GameY+40, 128, 1, 1, 0, 0.6);
+{$ENDIF}
 end;
 
 // HACK: don't have a "key was pressed" function
@@ -1670,12 +1710,14 @@ begin
 end;
 
 procedure g_Game_Update();
-var
-  Msg: g_gui.TMessage;
-  Time: Int64;
-  a: Byte;
-  w: Word;
-  i, b: Integer;
+  var
+    {$IFDEF ENABLE_MENU}
+      Msg: g_gui.TMessage;
+      w: Word;
+    {$ENDIF}
+    Time: Int64;
+    a: Byte;
+    i, b: Integer;
 
   function sendMonsPos (mon: TMonster): Boolean;
   begin
@@ -1723,7 +1765,6 @@ begin
   // no need to, as we'll do it in event handler
 
 // Обновляем консоль (движение и сообщения):
-  r_Console_Update;
   g_Console_Update();
 
   if (NetMode = NET_NONE) and (g_Game_IsNet) and (gGameOn or (gState in [STATE_FOLD, STATE_INTERCUSTOM])) then
@@ -1763,7 +1804,9 @@ begin
               e_KeyPressed(JOY2_ATTACK) or e_KeyPressed(JOY3_ATTACK)
             )
             and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
+{$IFDEF ENABLE_MENU}
             and (g_ActiveWindow = nil)
+{$ENDIF}
           )
           or (g_Game_IsNet and ((gInterTime > gInterEndTime) or ((gInterReadyCount >= NetClientCount) and (NetClientCount > 0))))
         )
@@ -1782,9 +1825,11 @@ begin
               begin
               // Выход в главное меню:
                 g_Game_Free;
+{$IFDEF ENABLE_MENU}
                 g_GUI_ShowWindow('MainMenu');
                 gMusic.SetByName('MUSIC_MENU');
                 gMusic.Play();
+{$ENDIF}
                 gState := STATE_MENU;
               end else
               begin
@@ -1810,7 +1855,9 @@ begin
             e_KeyPressed(JOY2_ATTACK) or e_KeyPressed(JOY3_ATTACK)
           )
           and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
+{$IFDEF ENABLE_MENU}
           and (g_ActiveWindow = nil)
+{$ENDIF}
         )
         then
         begin
@@ -1945,7 +1992,11 @@ begin
     // Обрабатываем клавиши игроков:
       if gPlayer1 <> nil then gPlayer1.ReleaseKeys();
       if gPlayer2 <> nil then gPlayer2.ReleaseKeys();
+{$IFDEF DISABLE_MENU}
+      if (not gConsoleShow) and (not gChatShow) then
+{$ELSE}
       if (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then
+{$ENDIF}
       begin
         ProcessPlayerControls(gPlayer1, 0, P1MoveButton);
         ProcessPlayerControls(gPlayer2, 1, P2MoveButton);
@@ -1958,8 +2009,12 @@ begin
     end; // if server
 
   // Наблюдатель
-    if (gPlayer1 = nil) and (gPlayer2 = nil) and
-       (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then
+    if (gPlayer1 = nil) and (gPlayer2 = nil)
+      and (not gConsoleShow) and (not gChatShow)
+{$IFDEF ENABLE_MENU}
+      and (g_ActiveWindow = nil)
+{$ENDIF}
+    then
     begin
       if not gSpectKeyPress then
       begin
@@ -2122,9 +2177,13 @@ begin
     g_Triggers_Update();
     g_Weapon_Update();
     g_Monsters_Update();
-    g_GFX_Update();
-    r_GFX_Update;
+    {$IFDEF ENABLE_GFX}
+      g_GFX_Update;
+    {$ENDIF}
     g_Player_UpdateAll();
+    {$IFDEF ENABLE_GIBS}
+      g_Gibs_Update;
+    {$ENDIF}
     g_Player_UpdatePhysicalObjects();
 
     // server: send newly spawned monsters unconditionally
@@ -2204,6 +2263,7 @@ begin
   end; // if gameOn ...
 
 // Активно окно интерфейса - передаем клавиши ему:
+{$IFDEF ENABLE_MENU}
   if g_ActiveWindow <> nil then
   begin
     w := e_GetFirstKeyPressed();
@@ -2222,8 +2282,10 @@ begin
   // Нужно сменить разрешение:
     if gResolutionChange then
     begin
-      e_WriteLog('Changing resolution', TMsgType.Notify);
-      r_Render_Apply;
+      {$IFNDEF HEADLESS}
+        e_WriteLog('Changing resolution', TMsgType.Notify);
+        r_Render_Apply;
+      {$ENDIF}
       gResolutionChange := False;
       g_ActiveWindow := nil;
     end;
@@ -2234,9 +2296,7 @@ begin
       //e_WriteLog('Read language file', MSG_NOTIFY);
       //g_Language_Load(DataDir + gLanguage + '.txt');
       g_Language_Set(gLanguage);
-{$IFNDEF HEADLESS}
       g_Menu_Reset();
-{$ENDIF}
       gLanguageChange := False;
     end;
   end;
@@ -2249,6 +2309,7 @@ begin
   begin
     KeyPress(IK_F10);
   end;
+{$ENDIF}
 
   Time := GetTickCount64() {div 1000};
 
@@ -2469,7 +2530,10 @@ begin
     g_Game_DeleteTestMap();
 
   gExit := EXIT_QUIT;
-  sys_RequestQuit;
+
+  {$IFNDEF HEADLESS}
+    sys_RequestQuit;
+  {$ENDIF}
 end;
 
 procedure g_Game_FreeData();
@@ -2561,45 +2625,6 @@ begin
   e_WriteLog(Format(_lc[I_SIMPLE_ERROR], [Text]), TMsgType.Warning);
 end;
 
-procedure g_Game_SetupScreenSize();
-const
-  RES_FACTOR = 4.0 / 3.0;
-var
-  s: Single;
-  rf: Single;
-  bw, bh: Word;
-begin
-// Размер экранов игроков:
-  gPlayerScreenSize.X := gScreenWidth-196;
-  if (gPlayer1 <> nil) and (gPlayer2 <> nil) then
-    gPlayerScreenSize.Y := gScreenHeight div 2
-  else
-    gPlayerScreenSize.Y := gScreenHeight;
-
-// Размер заднего плана:
-  if BackID <> DWORD(-1) then
-  begin
-    s := SKY_STRETCH;
-    if (gScreenWidth*s > gMapInfo.Width) or
-       (gScreenHeight*s > gMapInfo.Height) then
-    begin
-      gBackSize.X := gScreenWidth;
-      gBackSize.Y := gScreenHeight;
-    end
-    else
-    begin
-      e_GetTextureSize(BackID, @bw, @bh);
-      rf := Single(bw) / Single(bh);
-      if (rf > RES_FACTOR) then bw := Round(Single(bh) * RES_FACTOR)
-      else if (rf < RES_FACTOR) then bh := Round(Single(bw) / RES_FACTOR);
-      s := Max(gScreenWidth / bw, gScreenHeight / bh);
-      if (s < 1.0) then s := 1.0;
-      gBackSize.X := Round(bw*s);
-      gBackSize.Y := Round(bh*s);
-    end;
-  end;
-end;
-
 procedure g_Game_AddPlayer(Team: Byte = TEAM_NONE);
 begin
   if ((not gGameOn) and (gState <> STATE_INTERCUSTOM))
@@ -2761,9 +2786,6 @@ begin
 
   g_Game_ExecuteEvent('ongamestart');
 
-// Установка размеров окон игроков:
-  g_Game_SetupScreenSize();
-
 // Создание первого игрока:
   gPlayer1 := g_Player_Get(g_Player_Create(gPlayer1Settings.Model,
                                            gPlayer1Settings.Color,
@@ -2845,9 +2867,6 @@ begin
 
   g_Game_ExecuteEvent('ongamestart');
 
-// Установка размеров окон игроков:
-  g_Game_SetupScreenSize();
-
 // Режим наблюдателя:
   if nPlayers = 0 then
   begin
@@ -2949,9 +2968,6 @@ begin
 
   g_Game_ExecuteEvent('ongamestart');
 
-// Установка размеров окна игрока
-  g_Game_SetupScreenSize();
-
 // Режим наблюдателя:
   if nPlayers = 0 then
   begin
@@ -3063,9 +3079,6 @@ begin
 
   g_Game_ExecuteEvent('ongamestart');
 
-// Установка размеров окон игроков:
-  g_Game_SetupScreenSize();
-
   NetState := NET_STATE_AUTH;
 
   g_Game_SetLoadingText(_lc[I_LOAD_CONNECT], 0, False);
@@ -3334,14 +3347,18 @@ begin
   begin
     //result := g_Map_Load(gGameSettings.WAD + ':\' + ResName);
     result := g_Map_Load(NewWAD+':\'+ResName);
-    r_Render_LoadTextures;
+    {$IFNDEF HEADLESS}
+      r_Render_LoadTextures;
+    {$ENDIF}
   end;
   if Result then
     begin
       g_Player_ResetAll(Force or gLastMap, gGameSettings.GameType = GT_SINGLE);
 
       gState := STATE_NONE;
-      g_ActiveWindow := nil;
+      {$IFDEF ENABLE_MENU}
+        g_ActiveWindow := nil;
+      {$ENDIF}
       gGameOn := True;
 
       DisableCheats();
@@ -3937,12 +3954,18 @@ begin
   begin
     if Length(p) = 2 then
     begin
-      a := Max(0, StrToInt(p[1]));
-      g_GFX_SetMax(a)
+      {$IFDEF ENABLE_GFX}
+        a := Max(0, StrToInt(p[1]));
+        g_GFX_SetMax(a)
+      {$ENDIF}
     end
     else if Length(p) = 1 then
     begin
-      e_LogWritefln('%s', [g_GFX_GetMax()])
+      {$IFDEF ENABLE_GFX}
+        e_LogWritefln('%s', [g_GFX_GetMax()])
+      {$ELSE}
+        e_LogWritefln('%s', [0])
+      {$ENDIF}
     end
     else
     begin
@@ -3969,12 +3992,18 @@ begin
   begin
     if Length(p) = 2 then
     begin
-      a := Max(0, StrToInt(p[1]));
-      g_Gibs_SetMax(a)
+      {$IFDEF ENABLE_GIBS}
+        a := Max(0, StrToInt(p[1]));
+        g_Gibs_SetMax(a)
+      {$ENDIF}
     end
     else if Length(p) = 1 then
     begin
-      e_LogWritefln('%s', [g_Gibs_GetMax()])
+      {$IFDEF ENABLE_GIBS}
+        e_LogWritefln('%s', [g_Gibs_GetMax()])
+      {$ELSE}
+        e_LogWritefln('%s', [0])
+      {$ENDIF}
     end
     else
     begin
@@ -4572,8 +4601,12 @@ begin
   chstr := '';
   if cmd = 'pause' then
   begin
-    if (g_ActiveWindow = nil) then
+    {$IFDEF ENABLE_MENU}
+      if (g_ActiveWindow = nil) then
+        g_Game_Pause(not gPauseMain);
+    {$ELSE}
       g_Game_Pause(not gPauseMain);
+    {$ENDIF}
   end
   else if cmd = 'endgame' then
     gExit := EXIT_SIMPLE
@@ -5504,7 +5537,9 @@ begin
   end
   else if cmd = 'screenshot' then
   begin
-    g_TakeScreenShot()
+    {$IFNDEF HEADLESS}
+      g_TakeScreenShot()
+    {$ENDIF}
   end
   else if cmd = 'weapon' then
   begin
@@ -5741,8 +5776,10 @@ begin
         g_Game_Free();
         g_Game_Quit();
       end;
+{$IFNDEF HEADLESS}
     'r_reset':
-       r_Render_Apply;
+         r_Render_Apply;
+{$ENDIF}
     'r_maxfps':
       begin
         if Length(p) = 2 then
@@ -5788,36 +5825,30 @@ begin
   end;
 end;
 
+{$IFNDEF HEADLESS}
 procedure g_TakeScreenShot(Filename: string = '');
-  var s: TStream; t: TDateTime; dir, date, name: String;
+  var t: TDateTime; dir, date, name: String;
 begin
-  if e_NoGraphics then Exit;
-  try
-    dir := e_GetWriteableDir(ScreenshotDirs);
+  if e_NoGraphics then
+    Exit;
 
-    if Filename = '' then
-    begin
-      t := Now;
-      DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
-      Filename := 'screenshot-' + date;
-    end;
-    
-    name := e_CatPath(dir, Filename + '.png');
-    s := createDiskFile(name);
-    try
-      e_MakeScreenshot(s, gScreenWidth, gScreenHeight);
-      s.Free;
-      g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [name]))
-    except
-      g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [name]));
-      s.Free;
-      DeleteFile(name)
-    end
-  except
-    g_Console_Add('oh shit, i can''t create screenshot!')
-  end
+  dir := e_GetWriteableDir(ScreenshotDirs);
+  if Filename = '' then
+  begin
+    t := Now;
+    DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
+    Filename := 'screenshot-' + date;
+  end;
+
+  name := e_CatPath(dir, Filename + '.png');
+  if r_Render_WriteScreenShot(name) then
+    g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [name]))
+  else
+    g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [name]));
 end;
+{$ENDIF}
 
+{$IFDEF ENABLE_MENU}
 procedure g_Game_InGameMenu(Show: Boolean);
 begin
   if (g_ActiveWindow = nil) and Show then
@@ -5848,6 +5879,7 @@ begin
         g_Game_Pause(False);
     end;
 end;
+{$ENDIF}
 
 procedure g_Game_Pause (Enable: Boolean);
 var
@@ -5991,12 +6023,11 @@ begin
   end;
 end;
 
-procedure g_Game_Message(Msg: string; Time: Word);
-begin
-  MessageLineLength := (gScreenWidth - 204) div e_CharFont_GetMaxWidth(gMenuFont);
-  MessageText := b_Text_Wrap(b_Text_Format(Msg), MessageLineLength);
-  MessageTime := Time;
-end;
+  procedure g_Game_Message (Msg: string; Time: Word);
+  begin
+    MessageText := Msg;
+    MessageTime := Time;
+  end;
 
 procedure g_Game_ChatSound(Text: String; Taunt: Boolean = True);
 const
@@ -6297,7 +6328,9 @@ begin
     PBarWasHere := false;
   end;
 
-  g_ActiveWindow := nil;
+  {$IFDEF ENABLE_MENU}
+    g_ActiveWindow := nil;
+  {$ENDIF}
 
   ProcessLoading(true);
 end;
@@ -6579,8 +6612,10 @@ begin
   conRegVar('mon_sq_enabled', @gmon_debug_use_sqaccel, 'accelerated spatial queries for monsters', 'accelerated monster coldet');
   conRegVar('wtrace_sq_enabled', @gwep_debug_fast_trace, 'accelerated spatial queries for weapon hitscan trace', 'accelerated weapon hitscan');
 
+{$IFDEF ENABLE_GFX}
   conRegVar('pr_enabled', @gpart_dbg_enabled, 'enable/disable particles', 'particles');
   conRegVar('pr_phys_enabled', @gpart_dbg_phys_enabled, 'enable/disable particle physics', 'particle physics');
+{$ENDIF}
 
   conRegVar('los_enabled', @gmon_dbg_los_enabled, 'enable/disable monster LOS calculations', 'monster LOS', true);
   conRegVar('mon_think', @gmon_debug_think, 'enable/disable monster thinking', 'monster thinking', true);