- 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.
This commit is contained in:
raa-eruanna 2016-10-06 20:01:20 -04:00
parent 99c4d03ad4
commit 02f66fa34e
2 changed files with 12 additions and 2 deletions

View file

@ -52,7 +52,8 @@
#include "v_palette.h" #include "v_palette.h"
#include "d_player.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 // [RH] Amount of red flash for up to 114 damage points. Calculated by hand
// using a logarithmic scale and my trusty HP48G. // using a logarithmic scale and my trusty HP48G.
@ -114,6 +115,9 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int
{ {
cnt = CPlayer->bonuscount << 3; 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, 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); BPART(gameinfo.pickupcolor)/255.f, cnt > 128 ? 0.5f : cnt / 255.f, blend);
} }
@ -125,6 +129,9 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int
{ {
cnt = DamageToAlpha[MIN (113, CPlayer->damagecount * painFlash.a / 255)]; 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)
{ {
if (cnt > maxpainblend) if (cnt > maxpainblend)

View file

@ -660,6 +660,8 @@ OptionMenu "VideoOptions"
Slider "$DSPLYMNU_BRIGHTNESS", "Gamma", 0.75, 3.0, 0.05, 2 Slider "$DSPLYMNU_BRIGHTNESS", "Gamma", 0.75, 3.0, 0.05, 2
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff" Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
Option "$DSPLYMNU_CAPFPS", "cl_capfps", "OffOn" 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" Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods"
StaticText " " StaticText " "
@ -692,6 +694,7 @@ OptionMenu "VideoOptions"
Slider "$DSPLYMNU_MOVEBOB", "movebob", 0, 1.0, 0.05, 2 Slider "$DSPLYMNU_MOVEBOB", "movebob", 0, 1.0, 0.05, 2
Slider "$DSPLYMNU_STILLBOB", "stillbob", 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 Slider "$DSPLYMNU_BOBSPEED", "wbobspeed", 0, 2.0, 0.1, 2
} }
//------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------