mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-26 18:55:37 +01:00
ref: gl: make use of new TF_ALLOW_NEAREST_TOGGLE flag
This commit is contained in:
parent
04f42df7d5
commit
600d574376
@ -46,8 +46,8 @@ GNU General Public License for more details.
|
||||
#define REF_API_VERSION 7
|
||||
|
||||
|
||||
#define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP)
|
||||
#define TF_FONT (TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP|TF_ALLOW_NEAREST_TOGGLE)
|
||||
#define TF_FONT (TF_NOMIPMAP|TF_CLAMP|TF_ALLOW_NEAREST_TOGGLE)
|
||||
#define TF_IMAGE (TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_DECAL (TF_CLAMP)
|
||||
|
||||
|
@ -131,7 +131,7 @@ qboolean GL_TextureFilteringEnabled( const gl_texture_t *tex )
|
||||
if( FBitSet( tex->flags, TF_ATLAS_PAGE ))
|
||||
return gl_lightmap_nearest.value == 0.0f;
|
||||
|
||||
if( FBitSet( tex->flags, TF_SKYSIDE ))
|
||||
if( FBitSet( tex->flags, TF_ALLOW_NEAREST_TOGGLE ))
|
||||
return gl_texture_nearest.value == 0.0f;
|
||||
|
||||
return true;
|
||||
@ -329,8 +329,6 @@ void R_SetTextureParameters( void )
|
||||
// change all the existing mipmapped texture objects
|
||||
for( i = 0; i < gl_numTextures; i++ )
|
||||
GL_UpdateTextureParams( i );
|
||||
|
||||
R_UpdateRippleTexParams();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -496,7 +496,6 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse );
|
||||
void R_InitRipples( void );
|
||||
void R_ResetRipples( void );
|
||||
void R_AnimateRipples( void );
|
||||
void R_UpdateRippleTexParams( void );
|
||||
void R_UploadRipples( texture_t *image );
|
||||
|
||||
//
|
||||
|
@ -882,11 +882,7 @@ void R_InitRipples( void )
|
||||
pic.numMips = 1;
|
||||
memset( pic.buffer, 0, pic.size );
|
||||
|
||||
g_ripple.rippletexturenum = GL_LoadTextureInternal( "*rippletex", &pic, TF_NOMIPMAP );
|
||||
|
||||
// need to set proper tex params for TF_NOMIPMAP texture,
|
||||
// as during upload it fails TF_NEAREST check and gets blurry even with gl_texture_nearest 1
|
||||
R_UpdateRippleTexParams();
|
||||
g_ripple.rippletexturenum = GL_LoadTextureInternal( "*rippletex", &pic, TF_NOMIPMAP|TF_ALLOW_NEAREST_TOGGLE );
|
||||
}
|
||||
|
||||
static void R_SwapBufs( void )
|
||||
@ -967,24 +963,6 @@ void R_AnimateRipples( void )
|
||||
R_RunRipplesAnimation( g_ripple.oldbuf, g_ripple.curbuf );
|
||||
}
|
||||
|
||||
void R_UpdateRippleTexParams( void )
|
||||
{
|
||||
gl_texture_t *tex = R_GetTexture( g_ripple.rippletexturenum );
|
||||
|
||||
GL_Bind( XASH_TEXTURE0, g_ripple.rippletexturenum );
|
||||
|
||||
if( gl_texture_nearest.value )
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
}
|
||||
else
|
||||
{
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
pglTexParameteri( tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
}
|
||||
}
|
||||
|
||||
void R_UploadRipples( texture_t *image )
|
||||
{
|
||||
gl_texture_t *glt;
|
||||
|
Loading…
Reference in New Issue
Block a user