DEADSOFTWARE

cleanup: remove g_options dependency on r_graphics
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 9 Jun 2021 11:23:11 +0000 (14:23 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Tue, 29 Jun 2021 09:51:11 +0000 (12:51 +0300)
src/game/g_game.pas
src/game/g_options.pas
src/game/g_window.pas
src/game/opengl/r_gfx.pas
src/game/opengl/r_graphics.pas
src/game/opengl/r_monsters.pas
src/game/opengl/r_panel.pas

index 534dfeafc800978a0a460ea8169c00400e55c692..5d4093084e15df09133e9c4c70ad9146f140ba56 100644 (file)
@@ -6454,9 +6454,6 @@ begin
 
   conRegVar('dbg_ignore_level_bounds', @g_dbg_ignore_bounds, 'ignore level bounds', '',  false);
 
 
   conRegVar('dbg_ignore_level_bounds', @g_dbg_ignore_bounds, 'ignore level bounds', '',  false);
 
-  conRegVar('r_scale', @g_dbg_scale, 0.01, 100.0, 'render scale', '',  false);
-  conRegVar('r_resolution_scale', @r_pixel_scale, 0.01, 100.0, 'upscale factor', '', false);
-
   conRegVar('light_enabled', @gwin_k8_enable_light_experiments, 'enable/disable dynamic lighting', 'lighting');
   conRegVar('light_player_halo', @g_playerLight, 'enable/disable player halo', 'player light halo');
 
   conRegVar('light_enabled', @gwin_k8_enable_light_experiments, 'enable/disable dynamic lighting', 'lighting');
   conRegVar('light_player_halo', @g_playerLight, 'enable/disable player halo', 'player light halo');
 
index 6c250a43f1c8b5d3c20fe7ba9791015e4e70cb0f..b09e750ab197fa68f9aa7c316638e2dc255ed643 100644 (file)
@@ -77,6 +77,15 @@ var
   gsItemRespawnTime: Word = 60;
   gsWarmupTime: Word = 30;
 
   gsItemRespawnTime: Word = 60;
   gsWarmupTime: Word = 30;
 
+{$IFDEF HEADLESS}
+  e_NoGraphics: Boolean = True;
+{$ELSE}
+  e_NoGraphics: Boolean = False;
+{$ENDIF}
+  e_FastScreenshots: Boolean = true; // it's REALLY SLOW with `false`
+  g_dbg_scale: Single = 1.0;
+  r_pixel_scale: Single = 1.0;
+
 implementation
 
 uses
 implementation
 
 uses
@@ -85,7 +94,7 @@ uses
   {$ENDIF}
   e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
   g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
   {$ENDIF}
   e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
   g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
-  g_items, wadreader, r_graphics, g_touch, envvars, g_system;
+  g_items, wadreader, g_touch, envvars, g_system;
 
   var
     machine: Integer;
 
   var
     machine: Integer;
@@ -331,6 +340,8 @@ initialization
   conRegVar('r_texfilter', @gTextureFilter, '', '');
   conRegVar('r_npot', @glNPOTOverride, '', '');
   conRegVar('r_interp', @gLerpActors, '', 'interpolate actors');
   conRegVar('r_texfilter', @gTextureFilter, '', '');
   conRegVar('r_npot', @glNPOTOverride, '', '');
   conRegVar('r_interp', @gLerpActors, '', 'interpolate actors');
+  conRegVar('r_scale', @g_dbg_scale, 0.01, 100.0, 'render scale', '',  false);
+  conRegVar('r_resolution_scale', @r_pixel_scale, 0.01, 100.0, 'upscale factor', '', false);
 
   (* Sound *)
   conRegVar('s_nosound', @gNoSound, '', '');
 
   (* Sound *)
   conRegVar('s_nosound', @gNoSound, '', '');
index f13daa3f8b8a9b9c656a3c376d631c19f759bbff..b4e2f7b6b0329612cf4cddd02899aabcbd4ee289 100644 (file)
@@ -248,9 +248,6 @@ var
   valres: Word;
   {$ENDIF}
 begin
   valres: Word;
   {$ENDIF}
 begin
-{$IFDEF HEADLESS}
-  e_NoGraphics := true;
-{$ENDIF}
 
   idx := 1;
   while (idx <= ParamCount) do
 
   idx := 1;
   while (idx <= ParamCount) do
index 955bdec20c6554ff098df35bc54bb2c7c358b3ca..293e3aa174f0171f26be3f375135519062fa81a4 100644 (file)
@@ -25,7 +25,7 @@ implementation
     {$INCLUDE ../nogl/noGLuses.inc}
     SysUtils, Classes, Math,
     utils,
     {$INCLUDE ../nogl/noGLuses.inc}
     SysUtils, Classes, Math,
     utils,
-    g_base, r_graphics,
+    g_base, r_graphics, g_options,
     g_game,
     g_gfx
   ;
     g_game,
     g_gfx
   ;
index 5bd4aee4f8a610310a43142106f3f6ce6dc7eac2..f7b7fd3e299e25af9357defbb18fe5e13da57abd 100644 (file)
@@ -119,17 +119,11 @@ procedure e_MakeScreenshot(st: TStream; Width, Height: Word);
 
 var
   e_Colors: TRGB;
 
 var
   e_Colors: TRGB;
-  e_NoGraphics: Boolean = False;
-  e_FastScreenshots: Boolean = true; // it's REALLY SLOW with `false`
-  g_dbg_scale: Single = 1.0;
-  r_pixel_scale: Single = 1.0;
-
 
 implementation
 
 uses
 
 implementation
 
 uses
-  paszlib, crc, utils;
-
+  paszlib, crc, utils, g_options;
 
 type
   TTexture = record
 
 type
   TTexture = record
index 45f8dd33d17427a2bb1e375d330d18a9eb2bff35..9a747455ecc9e5ffc71d9e04d4682c509212b3cd 100644 (file)
@@ -24,7 +24,7 @@ implementation
 
   uses
     SysUtils, Classes, Math,
 
   uses
     SysUtils, Classes, Math,
-    r_graphics,
+    r_graphics, g_options,
     MAPDEF,
     g_base, g_basic, g_game, g_phys,
     g_monsters
     MAPDEF,
     g_base, g_basic, g_game, g_phys,
     g_monsters
index e9d92de45f9c9788b8b492bc563835b92738c7dd..5160510d65026345c4a4b07ca1e4b956e21c9604 100644 (file)
@@ -27,7 +27,7 @@ implementation
   uses
     {$INCLUDE ../nogl/noGLuses.inc}
     SysUtils, Classes, Math,
   uses
     {$INCLUDE ../nogl/noGLuses.inc}
     SysUtils, Classes, Math,
-    r_graphics,
+    r_graphics, g_options,
     g_base, g_basic, g_textures
   ;
 
     g_base, g_basic, g_textures
   ;