added R_TextureHasAlpha function to check if a loaded texture has alpha
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Oct 2001 21:48:21 +0000 (21:48 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Oct 2001 21:48:21 +0000 (21:48 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@986 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c
r_textures.h

index 5ac0614..eea2586 100644 (file)
@@ -725,3 +725,12 @@ int R_GetTextureSlots(int count)
        gl_texture_number += count;
        return i;
 }
+
+int R_TextureHasAlpha(rtexture_t *rt)
+{
+       gltexture_t *glt;
+       if (!rt)
+               return false;
+       glt = (gltexture_t *)rt;
+       return (glt->flags & TEXF_ALPHA) != 0;
+}
index 9cfcca3..fb4b844 100644 (file)
@@ -18,3 +18,4 @@ extern rtexture_t *R_LoadTexture (char *identifier, int width, int height, byte
 extern int R_GetTexture (rtexture_t *rt);
 // returns a GL texture slot (only used for lightmaps)
 extern int R_GetTextureSlots(int count);
+extern int R_TextureHasAlpha(rtexture_t *rt);