DEADSOFTWARE

game: less references to HEADLESS
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Sat, 29 Jan 2022 19:17:14 +0000 (22:17 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Sat, 29 Jan 2022 19:17:14 +0000 (22:17 +0300)
src/game/Doom2DF.lpr
src/game/g_console.pas
src/game/g_corpses.pas
src/game/g_game.pas
src/game/g_holmes.pas
src/game/opengl/r_game.pas
src/game/sdl2/g_system.pas
src/shared/a_modes.inc

index 5a06f52c4e40bc39f5e4624cac70e2ab1ce6c27d..63c895ff61327403c229a522bd5fa4d70b9c604b 100644 (file)
@@ -387,7 +387,6 @@ begin
       begin
         itmp := 0;
         val(ParamStr(idx), itmp, valres);
-        {$IFNDEF HEADLESS}
         if (valres = 0) and (not g_holmes_imfunctional) then
         begin
           case itmp of
@@ -396,11 +395,6 @@ begin
             16: uiContext.font := 'win16';
           end;
         end;
-        {$ELSE}
-        // fuck off, fpc!
-        itmp := itmp;
-        valres := valres;
-        {$ENDIF}
         Inc(idx);
       end;
     end;
index 687a412661b7b6fa3ea0b4eeb9b684c26981f734..ab2099a7ec141608f1a0d661dfd2b6d8408a40a3 100644 (file)
@@ -1542,12 +1542,6 @@ begin
 
   //SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
   //ConsoleHistory[High(ConsoleHistory)] := L;
-
-  (*
-{$IFDEF HEADLESS}
-  e_WriteLog('CON: ' + L, MSG_NOTIFY);
-{$ENDIF}
-  *)
 end;
 
 
index d4c6c5010a6e3f3cc3b5b44250e8bf6150a16c7f..3f08d7966f3dc71a9a19b2a4577f37573b12fb20 100644 (file)
@@ -70,7 +70,7 @@ interface
   procedure g_Corpses_RemoveAll;
   procedure g_Corpses_Update;
 
-  {$IFNDEF HEADLESS}
+  {$IFDEF ENABLE_RENDER}
     function g_Corpses_GetCameraObj (Player: TPlayer): TObj;
   {$ENDIF}
 
@@ -372,7 +372,7 @@ implementation
     SetLength(gCorpses, MaxCorpses);
   end;
 
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
   function g_Corpses_GetCameraObj (Player: TPlayer): TObj;
   begin
     {$IFDEF ENABLE_CORPSES}
index de56a17540e941d289947a4dc780f82bb5555211..13020b7ad4195df873ad1d419dbfdeeadf76553d 100644 (file)
@@ -154,9 +154,10 @@ procedure SortGameStat(var stat: TPlayerStatArray);
 {$IFDEF ENABLE_MENU}
   procedure g_Game_InGameMenu(Show: Boolean);
 {$ENDIF}
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_SYSTEM}
   procedure CharPress (C: AnsiChar);
 {$ENDIF}
+
   procedure KeyPress (K: Word);
 
 { procedure SetWinPause(Enable: Boolean); }
@@ -802,7 +803,7 @@ end;
   end;
 {$ENDIF}
 
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_SYSTEM}
   procedure CharPress (C: AnsiChar);
     {$IFDEF ENABLE_MENU}
       var Msg: g_gui.TMessage;
@@ -2305,7 +2306,7 @@ begin
   // Нужно сменить разрешение:
     if gResolutionChange then
     begin
-      {$IFNDEF HEADLESS}
+      {$IFDEF ENABLE_RENDER}
         e_WriteLog('Changing resolution', TMsgType.Notify);
         r_Render_Apply;
       {$ENDIF}
@@ -2542,9 +2543,9 @@ begin
   gMusic.Free();
   g_Game_FreeData();
   g_PlayerModel_FreeData();
-{$IFNDEF HEADLESS}
-  //g_Menu_Free(); //k8: this segfaults after resolution change; who cares?
-{$ENDIF}
+  {$IFDEF ENABLE_MENU}
+    // g_Menu_Free(); //k8: this segfaults after resolution change; who cares?
+  {$ENDIF}
 
   if NetInitDone then g_Net_Free;
 
index 06cc70736982c57703c3117d2412173fcf48ea0a..2c1544723acf5ed8cd070dfb6cdacdc20fea6907 100644 (file)
@@ -1406,12 +1406,8 @@ end;
 
 // ////////////////////////////////////////////////////////////////////////// //
 procedure g_Holmes_OnEvent (var ev: TFUIEvent);
-{$IF not DEFINED(HEADLESS)}
-var
-  doeat: Boolean = false;
-{$ENDIF}
+  var doeat: Boolean = false;
 begin
-{$IF not DEFINED(HEADLESS)}
   if g_Game_IsNet then exit;
   if not g_holmes_enabled then exit;
   if g_holmes_imfunctional then exit;
@@ -1424,12 +1420,14 @@ begin
 
   if (ev.key) then
   begin
+{$IFDEF USE_SDL2}
     case ev.scan of
       SDL_SCANCODE_LCTRL, SDL_SCANCODE_RCTRL,
       SDL_SCANCODE_LALT, SDL_SCANCODE_RALT,
       SDL_SCANCODE_LSHIFT, SDL_SCANCODE_RSHIFT:
         doeat := true;
     end;
+{$ENDIF}
   end
   else if (ev.mouse) then
   begin
@@ -1455,7 +1453,6 @@ begin
   end;
 
   if (doeat) then ev.eat();
-{$ENDIF}
 end;
 
 
@@ -1466,10 +1463,10 @@ begin
   if not g_holmes_enabled then exit;
   if g_holmes_imfunctional then exit;
 
-  {$IF not DEFINED(HEADLESS)}
   holmesInitCommands();
   holmesInitBinds();
 
+{$IFDEF ENABLE_RENDER}
   glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // modify color buffer
   glDisable(GL_STENCIL_TEST);
   glDisable(GL_BLEND);
@@ -1477,7 +1474,7 @@ begin
   glDisable(GL_TEXTURE_2D);
 
   if gGameOn then plrDebugDraw();
-  {$ENDIF}
+{$ENDIF}
 
   laserSet := false;
 end;
@@ -1489,8 +1486,9 @@ begin
   if not g_holmes_enabled then exit;
   if g_holmes_imfunctional then exit;
 
-  {$IF not DEFINED(HEADLESS)}
   gGfxDoClear := false;
+
+{$IFDEF ENABLE_RENDER}
   //if assigned(prerenderFrameCB) then prerenderFrameCB();
   uiDraw();
   glMatrixMode(GL_MODELVIEW);
@@ -1501,7 +1499,7 @@ begin
   finally
     glPopMatrix();
   end;
-  {$ENDIF}
+{$ENDIF}
 end;
 
 
index 314c7e7ac21d663d3dc4ba4546f71f03143b52ed..6b25a4f69aa81c63b34fb3e30cc5402270810d81 100644 (file)
@@ -810,9 +810,7 @@ begin
   // HACK: take stats screenshot immediately after the first frame of the stats showing
   if gScreenshotStats and (not StatShotDone) and (Length(CustomStat.PlayerStat) > 1) then
   begin
-{$IFNDEF HEADLESS}
     g_TakeScreenShot('stats/' + StatFilename);
-{$ENDIF}
     StatShotDone := True;
   end;
 end;
@@ -2170,9 +2168,7 @@ begin
   end;
 {$ENDIF}
 
-{$IFNDEF HEADLESS}
   r_Console_Draw();
-{$ENDIF}
 
   if g_debug_Sounds and gGameOn then
   begin
index 74e8d0354079582af6be99980952b11d6e8f5769..d42612803e82798cae30add27b89fca8c7d39724 100644 (file)
@@ -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);
index 13ee251ab42e57a9271428f782b23fba338e33f4..4ba00072e19a70c49acf7c929bce56f33712aa66 100644 (file)
   {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
     {$ERROR Only one render driver must be selected!}
   {$ENDIF}
-{$ELSE}
+{$ELSEIF DEFINED(ENABLE_RENDER)}
   {$DEFINE USE_OPENGL}
   {.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
 {$ENDIF}
 
 {$IFDEF ENABLE_HOLMES}
+  {$IFDEF DISABLE_SYSTEM}
+    {$FATAL System driver required for current Holmes implementation}
+  {$ENDIF}
+  {$IFDEF DISABLE_RENDER}
+    {$FATAL Render driver required for current Holmes implementation}
+  {$ENDIF}
   {$IFNDEF USE_SDL2}
-    {$ERROR Holmes supported only with SDL2}
+    {$FATAL SDL2 required for current Holmes implementation}
   {$ENDIF}
   {$IFNDEF USE_OPENGL}
-    {$ERROR Holmes supported only with desktop OpenGL}
+    {$FATAL Desktop OpenGL required for current Holmes implementation}
   {$ENDIF}
 {$ENDIF}