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?p=d2df-sdl.git;a=commitdiff_plain;h=c89c14b5389074760ba6044f504591047eac64d9 cleanup: remove g_options dependency on r_graphics --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 534dfea..5d40930 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -6454,9 +6454,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 6c250a4..b09e750 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -77,6 +77,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 @@ -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, - g_items, wadreader, r_graphics, g_touch, envvars, g_system; + g_items, wadreader, g_touch, envvars, g_system; var machine: Integer; @@ -331,6 +340,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 f13daa3..b4e2f7b 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -248,9 +248,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 e9d92de..5160510 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, - r_graphics, + r_graphics, g_options, g_base, g_basic, g_textures ;