]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_textures.h
commented out bit-hacking 1/sqrt code
[xonotic/darkplaces.git] / r_textures.h
index 4b52c76d70fa608ec25b9cb90877ad4c3b076a7a..ebcd8893e71ce1f7817104e224a343e8aeaab067 100644 (file)
 // 32bit RGBA
 #define TEXTYPE_RGBA 3
 
-// contents of this structure are private to gl_textures.c
+// contents of this structure are mostly private to gl_textures.c
 typedef struct
 {
-       int useless;
+       // this is exposed (rather than private) for speed reasons only
+       int texnum;
 }
 rtexture_t;
 
@@ -64,7 +65,8 @@ void R_FragmentLocation(rtexture_t *rt, int *x, int *y, float *fx1, float *fy1,
 
 // returns the renderer dependent texture slot number (call this before each
 // use, as a texture might not have been precached)
-int R_GetTexture (rtexture_t *rt);
+#define R_GetTexture(rt) ((rt) ? ((rt)->texnum >= 0 ? (rt)->texnum : R_RealGetTexture(rt)) : 0)
+int R_RealGetTexture (rtexture_t *rt);
 
 // returns true if the texture is transparent (useful for rendering code)
 int R_TextureHasAlpha(rtexture_t *rt);