]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
r_shadow_deferred now checks for r_shadow_gloss 0 and does not use the
[xonotic/darkplaces.git] / gl_textures.c
index fc027b2f7138fa34d416cecef4499abf0272d6d1..134d514f2b31cecad88fd7e2e1642f49c3f1760c 100644 (file)
@@ -297,6 +297,8 @@ void R_FreeTexture(rtexture_t *rt)
        else
                Host_Error("R_FreeTexture: texture \"%s\" not linked in pool", glt->identifier);
 
+       R_Mesh_ClearBindingsForTexture(glt->texnum);
+
        switch(vid.renderpath)
        {
        case RENDERPATH_GL11:
@@ -1156,7 +1158,7 @@ static void R_UploadFullTexture(gltexture_t *glt, const unsigned char *data)
        {
                // multiply RGB channels by A channel before uploading
                int alpha;
-               for (i = 0;i < width*height*depth*4;i += 4)
+               for (i = 0;i < glt->inputwidth*glt->inputheight*glt->inputdepth*4;i += 4)
                {
                        alpha = prevbuffer[i+3];
                        colorconvertbuffer[i] = (prevbuffer[i] * alpha) >> 8;