]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.c
no longer kicks off client if it got signon 1 twice during a reconnect (not sure...
[xonotic/darkplaces.git] / image.c
diff --git a/image.c b/image.c
index 6b5dd6a1774631a11c58df6915d43abfadde81ea..7ef2326b0c5af4ea41f57a7cba31f5588920da49 100644 (file)
--- a/image.c
+++ b/image.c
@@ -931,6 +931,7 @@ void Image_WriteTGARGBA (const char *filename, int width, int height, const qbyt
        buffer[14] = (height >> 0) & 0xFF;
        buffer[15] = (height >> 8) & 0xFF;
        buffer[16] = 32;        // pixel size
+       buffer[17] = 8; // transparent flag? (seems to be needed by gimp)
 
        // swap rgba to bgra and flip upside down
        out = buffer + 18;
@@ -1307,7 +1308,7 @@ void Image_Resample (const void *indata, int inwidth, int inheight, int indepth,
                        Mem_Free(resamplerow1);
                resamplerowsize = outwidth*4;
                if (!resamplemempool)
-                       resamplemempool = Mem_AllocPool("Image Scaling Buffer");
+                       resamplemempool = Mem_AllocPool("Image Scaling Buffer", 0, NULL);
                resamplerow1 = Mem_Alloc(resamplemempool, resamplerowsize*2);
                resamplerow2 = resamplerow1 + resamplerowsize;
        }
@@ -1502,8 +1503,8 @@ void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *ou
                        n[1] = dv[0][2]*dv[1][0]-dv[0][0]*dv[1][2];
                        n[2] = dv[0][0]*dv[1][1]-dv[0][1]*dv[1][0];
                        */
-                       n[0] = ((p1[0] + p1[1] + p1[2]) - (p0[0] + p0[1] + p0[2]));
-                       n[1] = ((p0[0] + p0[1] + p0[2]) - (p2[0] + p2[1] + p2[2]));
+                       n[0] = ((p0[0] + p0[1] + p0[2]) - (p1[0] + p1[1] + p1[2]));
+                       n[1] = ((p2[0] + p2[1] + p2[2]) - (p0[0] + p0[1] + p0[2]));
                        n[2] = ibumpscale;
                        VectorNormalize(n);
                        /*