diff --git a/src/gi.cpp b/src/gi.cpp index 3c53b5b5c..0ac9c82b6 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -369,6 +369,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast") GAMEINFOKEY_COLOR(dimcolor, "dimcolor") GAMEINFOKEY_FLOAT(dimamount, "dimamount") + GAMEINFOKEY_FLOAT(bluramount, "bluramount") GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") diff --git a/src/gi.h b/src/gi.h index bf9ccd450..3f51055fe 100644 --- a/src/gi.h +++ b/src/gi.h @@ -155,6 +155,7 @@ struct gameinfo_t FString CursorPic; uint32_t dimcolor; float dimamount; + float bluramount; int definventorymaxamount; int defaultrespawntime; int defaultdropstyle; diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index cc1092ccc..827dd7da2 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -145,8 +145,7 @@ CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITC GLRenderer->ClearTonemapPalette(); } -CVAR(Float, gl_menu_blur, 1.0f, CVAR_ARCHIVE) -CVAR(Bool, gl_menu_blur_enabled, true, CVAR_ARCHIVE) +CVAR(Float, gl_menu_blur, -1.0f, CVAR_ARCHIVE) EXTERN_CVAR(Float, vid_brightness) 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; - 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; FGLDebug::PushGroup("BlurScene"); diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index 1bfad8841..ce59a032c 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -180,7 +180,7 @@ public: void ClearTonemapPalette(); void LensDistortScene(); void ApplyFXAA(); - void BlurScene(); + void BlurScene(float gameinfobluramount); void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma); void DrawPresentTexture(const GL_IRECT &box, bool applyGamma); void Flush(); diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 5f0910759..795ee99e5 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -782,7 +782,7 @@ void M_Drawer (void) { screen->Dim(fade); if (GLRenderer) - GLRenderer->BlurScene(); + GLRenderer->BlurScene(gameinfo.bluramount); V_SetBorderNeedRefresh(); } CurrentMenu->CallDrawer(); diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 1a4a97148..ecf47f78a 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2696,6 +2696,7 @@ GLPREFMNU_SPRBILLFACECAMERA = "Sprites face camera"; GLPREFMNU_PARTICLESTYLE = "Particle style"; GLPREFMNU_AMBLIGHT = "Ambient light level"; GLPREFMNU_RENDERQUALITY = "Rendering quality"; +GLPREFMNU_MENUBLUR = "Menu Blur"; GLPREFMNU_VRMODE = "Stereo 3D VR"; GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo"; GLPREFMNU_MULTISAMPLE = "Multisample"; diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 4bff1283e..f35a5f2cd 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -38,6 +38,7 @@ gameinfo weaponslot = 7, "LAZDevice" dimcolor = "ff d7 00" dimamount = 0.2 + bluramount = 0.5 definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 diff --git a/wadsrc/static/mapinfo/doomcommon.txt b/wadsrc/static/mapinfo/doomcommon.txt index f24095941..b96164a20 100644 --- a/wadsrc/static/mapinfo/doomcommon.txt +++ b/wadsrc/static/mapinfo/doomcommon.txt @@ -38,6 +38,7 @@ gameinfo weaponslot = 7, "BFG9000" dimcolor = "ff d7 00" dimamount = 0.2 + bluramount = 0.5 definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index 361bf5cde..f87bd0f02 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -37,6 +37,7 @@ gameinfo weaponslot = 7, "Mace" dimcolor = "00 00 ff" dimamount = 0.2 + bluramount = 0.5 definventorymaxamount = 16 defaultrespawntime = 12 defaultdropstyle = 1 diff --git a/wadsrc/static/mapinfo/hexen.txt b/wadsrc/static/mapinfo/hexen.txt index 6b17df101..a52105a07 100644 --- a/wadsrc/static/mapinfo/hexen.txt +++ b/wadsrc/static/mapinfo/hexen.txt @@ -36,6 +36,7 @@ gameinfo weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge" dimcolor = "00 00 ff" dimamount = 0.2 + bluramount = 0.5 definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 diff --git a/wadsrc/static/mapinfo/mindefaults.txt b/wadsrc/static/mapinfo/mindefaults.txt index 885587281..f02ff78d0 100644 --- a/wadsrc/static/mapinfo/mindefaults.txt +++ b/wadsrc/static/mapinfo/mindefaults.txt @@ -27,6 +27,7 @@ gameinfo intermissioncounter = true dimcolor = "6f 00 6b" dimamount = 0.8 + bluramount = 0.0 definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index 17b8a1924..fbdf3d9e3 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -38,6 +38,7 @@ gameinfo weaponslot = 8, "Sigil" dimcolor = "ff d7 00" dimamount = 0.2 + bluramount = 0.5 definventorymaxamount = 25 defaultrespawntime = 16 defaultdropstyle = 2 diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index f6f699088..143057396 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2169,6 +2169,8 @@ OptionMenu "OpenGLOptions" Option "$GLPREFMNU_PARTICLESTYLE", gl_particles_style, "Particles" Option "$GLPREFMNU_RENDERQUALITY", gl_render_precise, "Precision" StaticText " " + Slider "$GLPREFMNU_MENUBLUR", gl_menu_blur, 0, 5.0, 0.5, 2 + StaticText " " Option "$GLPREFMNU_VRMODE", vr_mode, "VRMode" Option "$GLPREFMNU_VRQUADSTEREO", vr_enable_quadbuffered, "OnOff" StaticText " "