Skip to content

Commit

Permalink
Include Linux flashlight-effect workaround
Browse files Browse the repository at this point in the history
For some reason BorderColor-supports seems to be advertised although it
apparently is not (fully?) supported. At least on my system the
flashlight doesn't draw completely using the bordered texture.
To work around the issue where it exists this adds a ConVar to forcibly
disable the bordered version.
  • Loading branch information
z33ky committed Feb 26, 2020
1 parent 12690cb commit 3578a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sp/src/game/client/flashlighteffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static ConVar r_swingflashlight( "r_swingflashlight", "1", FCVAR_CHEAT );
static ConVar r_flashlightlockposition( "r_flashlightlockposition", "0", FCVAR_CHEAT );
#ifdef EZ
static ConVar r_nvgfov( "r_nvgfov", "100", FCVAR_CHEAT ); // Breadman - Changed for NVG effect
static ConVar r_nvg_force_nonbordered( "r_nvg_force_nonbordered", "0" ); // z33ky - workaround for Linux issue with bordercolor-support detection
#endif
static ConVar r_flashlightfov( "r_flashlightfov", "45.0", FCVAR_CHEAT );
static ConVar r_flashlightoffsetx( "r_flashlightoffsetx", "10.0", FCVAR_CHEAT );
Expand Down Expand Up @@ -93,7 +94,7 @@ CFlashlightEffect::CFlashlightEffect(int nEntIndex)
}
#ifdef EZ
m_iFlashLightType = type;
if ( g_pMaterialSystemHardwareConfig->SupportsBorderColor() && IsNVG() )
if ( g_pMaterialSystemHardwareConfig->SupportsBorderColor() && !r_nvg_force_nonbordered.GetBool() && IsNVG() )
{
m_FlashlightTexture.Init( "effects/Ez_MetroVision_border", TEXTURE_GROUP_OTHER, true );
}
Expand Down Expand Up @@ -617,4 +618,4 @@ void CHeadlightEffect::UpdateLight( const Vector &vecPos, const Vector &vecDir,
}

g_pClientShadowMgr->UpdateProjectedTexture( GetFlashlightHandle(), true );
}
}

0 comments on commit 3578a96

Please # to comment.