Browse Source

engine: client: force nearest filter for HUD textures and sprites to avoid artifacts with hud_scale

pull/2/head
Alibek Omarov 2 years ago
parent
commit
e5b32fe8ac
  1. 5
      engine/client/cl_game.c
  2. 4
      engine/client/cl_scrn.c

5
engine/client/cl_game.c

@ -1162,6 +1162,11 @@ static qboolean CL_LoadHudSprite( const char *szSpriteName, model_t *m_pSprite, @@ -1162,6 +1162,11 @@ static qboolean CL_LoadHudSprite( const char *szSpriteName, model_t *m_pSprite,
// it's hud sprite, make difference names to prevent free shared textures
if( type == SPR_CLIENT || type == SPR_HUDSPRITE )
SetBits( m_pSprite->flags, MODEL_CLIENT );
// force nearest filter for hud sprites to have less artifacts with hud_scale
if( type == SPR_HUDSPRITE )
SetBits( texFlags, TF_NEAREST );
m_pSprite->numtexinfo = texFlags; // store texFlags into numtexinfo
if( !FS_FileExists( szSpriteName, false ) )

4
engine/client/cl_scrn.c

@ -587,7 +587,7 @@ qboolean SCR_LoadFixedWidthFont( const char *fontname ) @@ -587,7 +587,7 @@ qboolean SCR_LoadFixedWidthFont( const char *fontname )
if( !FS_FileExists( fontname, false ))
return false;
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_KEEP_SOURCE );
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_KEEP_SOURCE|TF_NEAREST );
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
cls.creditsFont.charHeight = clgame.scrInfo.iCharHeight = fontWidth / 16;
cls.creditsFont.type = FONT_FIXED;
@ -619,7 +619,7 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname ) @@ -619,7 +619,7 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname )
if( !FS_FileExists( fontname, false ))
return false;
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE );
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_NEAREST );
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
// half-life font with variable chars witdh

Loading…
Cancel
Save