]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add support for CACHEPICFLAG_LINEAR (currently unused), ported from wrath-darkplaces
authorMario <mario@smbclan.net>
Sat, 30 May 2020 13:52:03 +0000 (23:52 +1000)
committerMario <mario@smbclan.net>
Sat, 30 May 2020 13:56:38 +0000 (23:56 +1000)
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 18e38754dc97b7072a98a723e41802eee8fc9102..38508d775ec23c80123069586a803916a26d8045 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