From: DeaDDooMER Date: Wed, 9 Jun 2021 11:23:11 +0000 (+0300) Subject: cleanup: remove g_options dependency on r_graphics X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a0060b33ed283433e67f417ffb8abc99e9ec0e93;p=d2df-sdl.git cleanup: remove g_options dependency on r_graphics --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 85f8589..7e06f0b 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -6833,9 +6833,6 @@ begin 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'); diff --git a/src/game/g_options.pas b/src/game/g_options.pas index 420ef52..ecfa4e7 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -76,6 +76,15 @@ var 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 @@ -84,7 +93,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, - g_items, wadreader, r_graphics, g_touch, envvars, g_system; + g_items, wadreader, g_touch, envvars, g_system; var machine: Integer; @@ -333,6 +342,8 @@ initialization 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, '', ''); diff --git a/src/game/g_window.pas b/src/game/g_window.pas index 7a719b6..06bfb14 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -246,9 +246,6 @@ var valres: Word; {$ENDIF} begin -{$IFDEF HEADLESS} - e_NoGraphics := true; -{$ENDIF} idx := 1; while (idx <= ParamCount) do diff --git a/src/game/opengl/r_gfx.pas b/src/game/opengl/r_gfx.pas index 955bdec..293e3aa 100644 --- a/src/game/opengl/r_gfx.pas +++ b/src/game/opengl/r_gfx.pas @@ -25,7 +25,7 @@ implementation {$INCLUDE ../nogl/noGLuses.inc} SysUtils, Classes, Math, utils, - g_base, r_graphics, + g_base, r_graphics, g_options, g_game, g_gfx ; diff --git a/src/game/opengl/r_graphics.pas b/src/game/opengl/r_graphics.pas index 5bd4aee..f7b7fd3 100644 --- a/src/game/opengl/r_graphics.pas +++ b/src/game/opengl/r_graphics.pas @@ -119,17 +119,11 @@ procedure e_MakeScreenshot(st: TStream; Width, Height: Word); 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 - paszlib, crc, utils; - + paszlib, crc, utils, g_options; type TTexture = record diff --git a/src/game/opengl/r_monsters.pas b/src/game/opengl/r_monsters.pas index 45f8dd3..9a74745 100644 --- a/src/game/opengl/r_monsters.pas +++ b/src/game/opengl/r_monsters.pas @@ -24,7 +24,7 @@ implementation uses SysUtils, Classes, Math, - r_graphics, + r_graphics, g_options, MAPDEF, g_base, g_basic, g_game, g_phys, g_monsters diff --git a/src/game/opengl/r_panel.pas b/src/game/opengl/r_panel.pas index c3c7566..f96cfb0 100644 --- a/src/game/opengl/r_panel.pas +++ b/src/game/opengl/r_panel.pas @@ -27,7 +27,7 @@ implementation uses {$INCLUDE ../nogl/noGLuses.inc} SysUtils, Classes, Math, utils, - r_graphics, + r_graphics, g_options, g_base, g_basic, g_textures, g_game ;