From 9eabbaf39bc2ce9b19bd9564aec605159f0d44a2 Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Fri, 8 Dec 2023 02:03:31 -0300 Subject: [PATCH] "Diminished Lighting" toggle commit de09013dc8dd3bb2a878dcec5a3d27a89e425f0c Author: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Fri Dec 8 02:02:29 2023 -0300 Update documentation commit 8ea90dae291500ccd494bb8f015c0465a7fa7680 Author: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Thu Dec 7 23:57:16 2023 -0300 Remove menu item, check for Strict Mode commit 686380b7a0c43253aca43afa74170612a5732cf7 Merge: 3de5494 5f1e609 Author: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Thu Dec 7 23:22:00 2023 -0300 Merge branch 'master' into diminished_lighting_toggle commit 3de5494821d51f01ecc18b8be810d5b82effec01 Author: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Sat Oct 7 03:40:44 2023 -0300 Diminished lighting toggle --- CHANGELOG.md | 1 + README.md | 11 ++++++----- src/doomstat.c | 1 + src/doomstat.h | 1 + src/m_misc.c | 7 +++++++ src/r_plane.c | 3 +++ src/r_segs.c | 5 +++++ src/r_things.c | 8 +++++++- 8 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2efdef43d..9c679c2bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - **Support for intermediate resolutions** (e.g. 3X, 5X) **and 9X (1800p)** - **_Background for all menus_** setting - **_Vanilla Fake Contrast_** setting +- Toggle for **Diminished Lighting** - **Minimap mode for Automap** - **NUGHUD:** - Ammo and Health icons; diff --git a/README.md b/README.md index 234aa4c22..0fd35978b 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ For these settings, their CVAR names are provided alongside the _CFG-Only_ label - **Support for higher resolutions:** 3X (600p), 4X (800p)... up to 9X (1800p) [by _ceski_] - **Selection of widescreen ratios** in the setup menu itself [i.b. Crispy Doom] -- Toggle to **stretch viewport to fit window** (CFG-Only: `stretch_to_fit`) [i.b. and partially p.f. Crispy Doom; i.b. ZDoom] +- **Stretch viewport to fit window** setting (CFG-Only: `stretch_to_fit`) [i.b. and partially p.f. Crispy Doom; i.b. ZDoom] - **Gamma Correction slider ranging from 0.50 to 2.0 in steps of 0.05** -- Toggle for **Gamma Correction key cycling**, through either original or extended gamma levels (CFG-Only: `gammacycle`) +- **Gamma Correction key cycling** setting, to cycle through either original or extended gamma levels (CFG-Only: `gammacycle`) - **Menu items for _Air Absorption_ and _Doppler Effect_**, both of which are **now set to 5 by default** - **Tweaked _Stretch Short Skies_ algorithm** - _**Screen Wipe Style**_ selection: @@ -57,15 +57,16 @@ For these settings, their CVAR names are provided alongside the _CFG-Only_ label - _**Disable Radiation Suit Tint**_ setting - _**Damage Tint Cap**_ and _**Bonus Tint Cap**_, to attenuate or disable the red and yellow screen tints - _**Fake Contrast**_ setting +- Toggle for **Diminished Lighting** (CFG-Only: `diminished_lighting`) - _**Screen Wipe speed percentage**_ setting - _**Sound Clipping Distance**_ selection, to optionally double the distance at which SFX become audible - **_Organize Saves by IWAD_** setting - _**One-Key Quick Save/Load**_ setting, to skip the confirmation prompt - _**Play Internal Demos**_ setting - _**Quick "Quit Game"**_ setting, to skip the confirmation prompt [p.f. Crispy Doom] -- Toggling of _**Weapon Flash Lighting**_ [p.f. Crispy Doom] -- Toggling of _**Weapon Flash Sprite**_ [p.f. Crispy Doom] -- Toggling of _**Invulnerability Colormap**_ [p.f. Crispy Doom] +- Toggle for _**Weapon Flash Lighting**_ [p.f. Crispy Doom] +- Toggle for _**Weapon Flash Sprite**_ [p.f. Crispy Doom] +- Toggle for _**Invulnerability Colormap**_ [p.f. Crispy Doom] ### Weapons diff --git a/src/doomstat.c b/src/doomstat.c index 676d94932..53a8ffc8e 100644 --- a/src/doomstat.c +++ b/src/doomstat.c @@ -164,6 +164,7 @@ int no_radsuit_tint; int damagecount_cap; int bonuscount_cap; int fake_contrast; +int diminished_lighting; // CFG-Only int wipe_speed_percentage; int s_clipping_dist_x2; int one_key_saveload; diff --git a/src/doomstat.h b/src/doomstat.h index dad965599..67fc0e698 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -492,6 +492,7 @@ extern int no_radsuit_tint; extern int damagecount_cap; extern int bonuscount_cap; extern int fake_contrast; +extern int diminished_lighting; // CFG-Only extern int wipe_speed_percentage; extern int s_clipping_dist_x2; extern int one_key_saveload; diff --git a/src/m_misc.c b/src/m_misc.c index ffc74bbf0..ed542e26a 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -870,6 +870,13 @@ default_t defaults[] = { "Fake contrast for walls (0 = Off, 1 = Smooth, 2 = Vanilla)" }, + { + "diminished_lighting", + (config_t *) &diminished_lighting, NULL, + {1}, {0,1}, number, ss_gen, wad_yes, + "1 to enable diminished lighting (light emitted by player)" + }, + { "s_clipping_dist_x2", (config_t *) &s_clipping_dist_x2, NULL, diff --git a/src/r_plane.c b/src/r_plane.c index f14db09eb..e56ef9b6c 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -165,6 +165,9 @@ static void R_MapPlane(int y, int x1, int x2) index = distance >> LIGHTZSHIFT; if (index >= MAXLIGHTZ ) index = MAXLIGHTZ-1; + + if (STRICTMODE(!diminished_lighting)) { index = MAXLIGHTZ-1; } // [Nugget] + ds_colormap[0] = planezlight[index]; ds_colormap[1] = fullcolormap; } diff --git a/src/r_segs.c b/src/r_segs.c index 45ed6dfa9..bd151f926 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -168,6 +168,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2) if (index >= MAXLIGHTSCALE ) index = MAXLIGHTSCALE-1; + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + dc_colormap[0] = dc_colormap[1] = walllights[index]; } @@ -385,6 +387,9 @@ static void R_RenderSegLoop (void) if (index >= MAXLIGHTSCALE ) index = MAXLIGHTSCALE-1; + + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + dc_colormap[0] = walllights[index]; dc_colormap[1] = (!fixedcolormap && STRICTMODE(brightmaps)) ? fullcolormap : dc_colormap[0]; diff --git a/src/r_things.c b/src/r_things.c index d96aeffcf..6bf4b2bc8 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -640,6 +640,9 @@ void R_ProjectSprite (mobj_t* thing) int index = (int) (xscale/fovdiff) / ((1 << LIGHTSCALESHIFT) * hires); // killough 11/98 if (index >= MAXLIGHTSCALE) index = MAXLIGHTSCALE-1; + + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + vis->colormap[0] = spritelights[index]; vis->colormap[1] = fullcolormap; } @@ -799,7 +802,10 @@ void R_DrawPSprite (pspdef_t *psp, boolean translucent) // [Nugget] Translucent vis->colormap[0] = vis->colormap[1] = fullcolormap; // full bright // killough 3/20/98 else { - vis->colormap[0] = spritelights[MAXLIGHTSCALE-1]; // local light + // [Nugget] + const int index = (STRICTMODE(!diminished_lighting)) ? 0 : MAXLIGHTSCALE-1; + + vis->colormap[0] = spritelights[index]; // local light vis->colormap[1] = fullcolormap; } vis->brightmap = R_BrightmapForState(psp->state - states);