From 02f66fa34e2bdb63ca1ba740c5b35b7388550120 Mon Sep 17 00:00:00 2001 From: raa-eruanna Date: Thu, 6 Oct 2016 20:01:20 -0400 Subject: [PATCH] - Backported blood_fade_scalar from Skulltag - Added new pickup_fade_scalar which works the same way for pickups - Default for blood_fade_scalar is 1.0 instead of 0.5 from Skulltag. --- src/v_blend.cpp | 11 +++++++++-- wadsrc/static/menudef.txt | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/v_blend.cpp b/src/v_blend.cpp index e1552105ff..c13ed547c2 100644 --- a/src/v_blend.cpp +++ b/src/v_blend.cpp @@ -52,7 +52,8 @@ #include "v_palette.h" #include "d_player.h" - +CVAR( Float, blood_fade_scalar, 1.0f, CVAR_ARCHIVE ) // [SP] Pulled from Skulltag - changed default from 0.5 to 1.0 +CVAR( Float, pickup_fade_scalar, 1.0f, CVAR_ARCHIVE ) // [SP] Uses same logic as blood_fade_scalar except for pickups // [RH] Amount of red flash for up to 114 damage points. Calculated by hand // using a logarithmic scale and my trusty HP48G. @@ -113,6 +114,9 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int if (CPlayer->bonuscount) { cnt = CPlayer->bonuscount << 3; + + // [SP] Allow player to tone down intensity of pickup flash. + cnt = (int)( cnt * pickup_fade_scalar ); V_AddBlend (RPART(gameinfo.pickupcolor)/255.f, GPART(gameinfo.pickupcolor)/255.f, BPART(gameinfo.pickupcolor)/255.f, cnt > 128 ? 0.5f : cnt / 255.f, blend); @@ -124,7 +128,10 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int if (painFlash.a != 0) { cnt = DamageToAlpha[MIN (113, CPlayer->damagecount * painFlash.a / 255)]; - + + // [BC] Allow users to tone down the intensity of the blood on the screen. + cnt = (int)( cnt * blood_fade_scalar ); + if (cnt) { if (cnt > maxpainblend) diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 17eb806668..95eedaf259 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -660,6 +660,8 @@ OptionMenu "VideoOptions" Slider "$DSPLYMNU_BRIGHTNESS", "Gamma", 0.75, 3.0, 0.05, 2 Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff" Option "$DSPLYMNU_CAPFPS", "cl_capfps", "OffOn" + Slider "$DSPLYMNU_BLOODFADE", "blood_fade_scalar", 0.0, 1.0, 0.05, 1 + Slider "$DSPLYMNU_PICKUPFADE", "pickup_fade_scalar", 0.0, 1.0, 0.05, 1 Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods" StaticText " " @@ -692,6 +694,7 @@ OptionMenu "VideoOptions" Slider "$DSPLYMNU_MOVEBOB", "movebob", 0, 1.0, 0.05, 2 Slider "$DSPLYMNU_STILLBOB", "stillbob", 0, 1.0, 0.05, 2 Slider "$DSPLYMNU_BOBSPEED", "wbobspeed", 0, 2.0, 0.1, 2 + } //-------------------------------------------------------------------------------------------