From: cloudwalk Date: Wed, 15 Jul 2020 14:59:06 +0000 (+0000) Subject: Add support for CACHEPICFLAG_LINEAR (currently unused), ported from wrath-darkplaces X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=782dd2e09d4b81ed3b62cbbff2d9ebccce5eefb9;p=xonotic%2Fdarkplaces.git Add support for CACHEPICFLAG_LINEAR (currently unused), ported from wrath-darkplaces git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12817 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/draw.h b/draw.h index 5e023da8..2ab33897 100644 --- a/draw.h +++ b/draw.h @@ -35,7 +35,8 @@ typedef enum cachepicflags_e CACHEPICFLAG_NEWPIC = 16, // disables matching texflags check, because a pic created with Draw_NewPic should not be subject to that CACHEPICFLAG_MIPMAP = 32, CACHEPICFLAG_NEAREST = 64, // force nearest filtering instead of linear - CACHEPICFLAG_FAILONMISSING = 128 // return NULL if the pic has no texture + CACHEPICFLAG_FAILONMISSING = 128, // return NULL if the pic has no texture + CACHEPICFLAG_LINEAR = 256 // force linear filtering even if nearest_2d is enabled } cachepicflags_t; diff --git a/gl_draw.c b/gl_draw.c index 3e33b344..fd4eef5d 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -94,7 +94,9 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags) texflags |= TEXF_MIPMAP; if (!(cachepicflags & CACHEPICFLAG_NOCOMPRESSION) && gl_texturecompression_2d.integer && gl_texturecompression.integer) texflags |= TEXF_COMPRESS; - if ((cachepicflags & CACHEPICFLAG_NEAREST) || r_nearest_2d.integer) + if (cachepicflags & CACHEPICFLAG_LINEAR) + texflags |= TEXF_FORCELINEAR; + else if ((cachepicflags & CACHEPICFLAG_NEAREST) || r_nearest_2d.integer) texflags |= TEXF_FORCENEAREST; // check whether the picture has already been cached