]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Add support for CACHEPICFLAG_LINEAR (currently unused), ported from wrath-darkplaces
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Jul 2020 14:59:06 +0000 (14:59 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Jul 2020 14:59:06 +0000 (14:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12817 d7cf8633-e32d-0410-b094-e92efae38249

draw.h
gl_draw.c

diff --git a/draw.h b/draw.h
index 5e023da8ad617ed7ac22bdf9de497127a4ceef21..2ab3389763dad67077a0a9a0af87d2427227e0ca 100644 (file)
--- 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;
 
index 3e33b3444aeb2896d2273720978f12cb993be11c..fd4eef5d74953df1388f2181c71829b929b7213e 100644 (file)
--- 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