Skip to content

Commit

Permalink
"Diminished Lighting" toggle
Browse files Browse the repository at this point in the history
commit de09013
Author: Alaux <73968015+MrAlaux@users.noreply.github.com>
Date:   Fri Dec 8 02:02:29 2023 -0300

    Update documentation

commit 8ea90da
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 686380b
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 3de5494
Author: Alaux <73968015+MrAlaux@users.noreply.github.com>
Date:   Sat Oct 7 03:40:44 2023 -0300

    Diminished lighting toggle
  • Loading branch information
MrAlaux committed Dec 8, 2023
1 parent 5f1e609 commit 9eabbaf
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/doomstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/doomstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/m_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/r_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions src/r_segs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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];
Expand Down
8 changes: 7 additions & 1 deletion src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9eabbaf

Please sign in to comment.