Browse Source

ref: gl: add PARM_TEX_FILTERING handler

master
Alibek Omarov 11 months ago
parent
commit
4599983c8e
  1. 21
      ref/gl/gl_context.c

21
ref/gl/gl_context.c

@ -167,6 +167,25 @@ qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte *buf )
return loaded; return loaded;
} }
static qboolean R_TextureFilteringEnabled( int arg )
{
gl_texture_t *glt;
if( arg < 0 )
return gl_texture_nearest.value == 0.0f;
glt = R_GetTexture( arg );
if( FBitSet( glt->flags, TF_NEAREST ))
return false;
// lightmaps have special cvar
if( FBitSet( glt->flags, TF_ATLAS_PAGE ))
return gl_lightmap_nearest.value == 0.0f;
return gl_texture_nearest.value == 0.0f;
}
static int GL_RefGetParm( int parm, int arg ) static int GL_RefGetParm( int parm, int arg )
{ {
gl_texture_t *glt; gl_texture_t *glt;
@ -237,6 +256,8 @@ static int GL_RefGetParm( int parm, int arg )
return glState.stencilEnabled; return glState.stencilEnabled;
case PARM_SKY_SPHERE: case PARM_SKY_SPHERE:
return FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX ); return FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX );
case PARM_TEX_FILTERING:
return R_TextureFilteringEnabled( arg );
default: default:
return ENGINE_GET_PARM_( parm, arg ); return ENGINE_GET_PARM_( parm, arg );
} }

Loading…
Cancel
Save