Handle weapon wheel blur shader in the event handler.

This commit is contained in:
Mari the Deer 2023-10-23 17:30:04 +02:00
commit 6392a89cb9
3 changed files with 11 additions and 12 deletions

View file

@ -31,6 +31,14 @@ extend Class SWWMHandler
if ( !swwm_shaders ) ClearAllShaders(true);
return;
}
// handle weapon wheel shader here
if ( wsel )
{
PPShader.SetEnabled("BokehSel",true);
double salph = SWWMUtility.Lerp(wsel.olalph,wsel.alph,e.fractic);
PPShader.SetUniform1f("BokehSel","strength",salph);
}
else PPShader.SetEnabled("BokehSel",false);
let divi = DivineSpriteEffect(mo.FindInventory("DivineSpriteEffect"));
if ( divi )
{

View file

@ -1130,11 +1130,7 @@ Class SWWMWeaponSelect : HUDMessageBase
case 2:
// fade out
alph -= 6./GameTicRate;
if ( alph <= 0. )
{
PPShader.SetEnabled("BokehSel",false); // clear the shader
return true;
}
if ( alph <= 0. ) return true;
break;
}
// smooth scroll
@ -1152,11 +1148,6 @@ Class SWWMWeaponSelect : HUDMessageBase
double fractic = System.GetTimeFrac();
double ssmoothY = SWWMUtility.Lerp(olsmoothY,smoothY,fractic);
double salph = SWWMUtility.Lerp(olalph,alph,fractic);
if ( swwm_shaders )
{
PPShader.SetEnabled("BokehSel",true);
PPShader.SetUniform1f("BokehSel","strength",salph);
}
Screen.Dim("Black",.4*salph,0,0,Screen.GetWidth(),Screen.GetHeight());
double hs;
Vector2 ss;