- made gl_menu_blur into a menu option

- made bluramount also into a gameinfo option
- negative gl_menu_blur cvar now uses gameinfo option, 0 disables it
- removed gl_menu_blur_enabled since gl_menu_blur==0 does that anyway
- made gl_menu_blur default to -1 to use gameinfo option
- add default gameinfo bluramount options
This commit is contained in:
Rachael Alexanderson 2017-03-14 19:11:13 -04:00
parent 954f21f71d
commit b747b0c3c6
13 changed files with 23 additions and 6 deletions

View file

@ -369,6 +369,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast") GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast")
GAMEINFOKEY_COLOR(dimcolor, "dimcolor") GAMEINFOKEY_COLOR(dimcolor, "dimcolor")
GAMEINFOKEY_FLOAT(dimamount, "dimamount") GAMEINFOKEY_FLOAT(dimamount, "dimamount")
GAMEINFOKEY_FLOAT(bluramount, "bluramount")
GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount") GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")

View file

@ -155,6 +155,7 @@ struct gameinfo_t
FString CursorPic; FString CursorPic;
uint32_t dimcolor; uint32_t dimcolor;
float dimamount; float dimamount;
float bluramount;
int definventorymaxamount; int definventorymaxamount;
int defaultrespawntime; int defaultrespawntime;
int defaultdropstyle; int defaultdropstyle;

View file

@ -145,8 +145,7 @@ CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITC
GLRenderer->ClearTonemapPalette(); GLRenderer->ClearTonemapPalette();
} }
CVAR(Float, gl_menu_blur, 1.0f, CVAR_ARCHIVE) CVAR(Float, gl_menu_blur, -1.0f, CVAR_ARCHIVE)
CVAR(Bool, gl_menu_blur_enabled, true, CVAR_ARCHIVE)
EXTERN_CVAR(Float, vid_brightness) EXTERN_CVAR(Float, vid_brightness)
EXTERN_CVAR(Float, vid_contrast) EXTERN_CVAR(Float, vid_contrast)
@ -475,10 +474,17 @@ void FGLRenderer::BloomScene(int fixedcm)
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void FGLRenderer::BlurScene() void FGLRenderer::BlurScene(float gameinfobluramount)
{ {
// first, respect the CVar
float blurAmount = gl_menu_blur; float blurAmount = gl_menu_blur;
if ((!gl_menu_blur_enabled) || (gl_menu_blur <= 0.0) || !FGLRenderBuffers::IsEnabled())
// if CVar is negative, use the gameinfo entry
if (gl_menu_blur < 0)
blurAmount = gameinfobluramount;
// if blurAmount == 0 or somehow still returns negative, exit to prevent a crash, clearly we don't want this
if ((blurAmount <= 0.0) || !FGLRenderBuffers::IsEnabled())
return; return;
FGLDebug::PushGroup("BlurScene"); FGLDebug::PushGroup("BlurScene");

View file

@ -180,7 +180,7 @@ public:
void ClearTonemapPalette(); void ClearTonemapPalette();
void LensDistortScene(); void LensDistortScene();
void ApplyFXAA(); void ApplyFXAA();
void BlurScene(); void BlurScene(float gameinfobluramount);
void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma); void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
void DrawPresentTexture(const GL_IRECT &box, bool applyGamma); void DrawPresentTexture(const GL_IRECT &box, bool applyGamma);
void Flush(); void Flush();

View file

@ -782,7 +782,7 @@ void M_Drawer (void)
{ {
screen->Dim(fade); screen->Dim(fade);
if (GLRenderer) if (GLRenderer)
GLRenderer->BlurScene(); GLRenderer->BlurScene(gameinfo.bluramount);
V_SetBorderNeedRefresh(); V_SetBorderNeedRefresh();
} }
CurrentMenu->CallDrawer(); CurrentMenu->CallDrawer();

View file

@ -2696,6 +2696,7 @@ GLPREFMNU_SPRBILLFACECAMERA = "Sprites face camera";
GLPREFMNU_PARTICLESTYLE = "Particle style"; GLPREFMNU_PARTICLESTYLE = "Particle style";
GLPREFMNU_AMBLIGHT = "Ambient light level"; GLPREFMNU_AMBLIGHT = "Ambient light level";
GLPREFMNU_RENDERQUALITY = "Rendering quality"; GLPREFMNU_RENDERQUALITY = "Rendering quality";
GLPREFMNU_MENUBLUR = "Menu Blur";
GLPREFMNU_VRMODE = "Stereo 3D VR"; GLPREFMNU_VRMODE = "Stereo 3D VR";
GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo"; GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo";
GLPREFMNU_MULTISAMPLE = "Multisample"; GLPREFMNU_MULTISAMPLE = "Multisample";

View file

@ -38,6 +38,7 @@ gameinfo
weaponslot = 7, "LAZDevice" weaponslot = 7, "LAZDevice"
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.5
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -38,6 +38,7 @@ gameinfo
weaponslot = 7, "BFG9000" weaponslot = 7, "BFG9000"
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.5
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -37,6 +37,7 @@ gameinfo
weaponslot = 7, "Mace" weaponslot = 7, "Mace"
dimcolor = "00 00 ff" dimcolor = "00 00 ff"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.5
definventorymaxamount = 16 definventorymaxamount = 16
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -36,6 +36,7 @@ gameinfo
weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge" weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge"
dimcolor = "00 00 ff" dimcolor = "00 00 ff"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.5
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -27,6 +27,7 @@ gameinfo
intermissioncounter = true intermissioncounter = true
dimcolor = "6f 00 6b" dimcolor = "6f 00 6b"
dimamount = 0.8 dimamount = 0.8
bluramount = 0.0
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -38,6 +38,7 @@ gameinfo
weaponslot = 8, "Sigil" weaponslot = 8, "Sigil"
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.5
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 16 defaultrespawntime = 16
defaultdropstyle = 2 defaultdropstyle = 2

View file

@ -2169,6 +2169,8 @@ OptionMenu "OpenGLOptions"
Option "$GLPREFMNU_PARTICLESTYLE", gl_particles_style, "Particles" Option "$GLPREFMNU_PARTICLESTYLE", gl_particles_style, "Particles"
Option "$GLPREFMNU_RENDERQUALITY", gl_render_precise, "Precision" Option "$GLPREFMNU_RENDERQUALITY", gl_render_precise, "Precision"
StaticText " " StaticText " "
Slider "$GLPREFMNU_MENUBLUR", gl_menu_blur, 0, 5.0, 0.5, 2
StaticText " "
Option "$GLPREFMNU_VRMODE", vr_mode, "VRMode" Option "$GLPREFMNU_VRMODE", vr_mode, "VRMode"
Option "$GLPREFMNU_VRQUADSTEREO", vr_enable_quadbuffered, "OnOff" Option "$GLPREFMNU_VRQUADSTEREO", vr_enable_quadbuffered, "OnOff"
StaticText " " StaticText " "