]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
Implement "forcenearest" particle effect key, ported from wrath-darkplaces
[xonotic/darkplaces.git] / gl_rmain.c
index aafef20bf3e04cc7d2d909b3a6720fd25417ec94..2f2942ad92330d7762c21fc9f2a85b00141f6c10 100644 (file)
@@ -2950,10 +2950,18 @@ static int componentorder[4] = {0, 1, 2, 3};
 
 static rtexture_t *R_LoadCubemap(const char *basename)
 {
-       int i, j, cubemapsize;
+       int i, j, cubemapsize, forcefilter;
        unsigned char *cubemappixels, *image_buffer;
        rtexture_t *cubemaptexture;
        char name[256];
+
+       // HACK: if the cubemap name starts with a !, the cubemap is nearest-filtered
+       forcefilter = TEXF_FORCELINEAR;
+       if (basename && basename[0] == '!')
+       {
+               basename++;
+               forcefilter = TEXF_FORCENEAREST;
+       }
        // must start 0 so the first loadimagepixels has no requested width/height
        cubemapsize = 0;
        cubemappixels = NULL;
@@ -2996,7 +3004,7 @@ static rtexture_t *R_LoadCubemap(const char *basename)
                if (developer_loading.integer)
                        Con_Printf("loading cubemap \"%s\"\n", basename);
 
-               cubemaptexture = R_LoadTextureCubeMap(r_main_texturepool, basename, cubemapsize, cubemappixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, (gl_texturecompression_lightcubemaps.integer && gl_texturecompression.integer ? TEXF_COMPRESS : 0) | TEXF_FORCELINEAR | TEXF_CLAMP, -1, NULL);
+               cubemaptexture = R_LoadTextureCubeMap(r_main_texturepool, basename, cubemapsize, cubemappixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, (gl_texturecompression_lightcubemaps.integer && gl_texturecompression.integer ? TEXF_COMPRESS : 0) | forcefilter | TEXF_CLAMP, -1, NULL);
                Mem_Free(cubemappixels);
        }
        else