]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.c
fix for double to float warning in MSVC
[xonotic/darkplaces.git] / image.c
diff --git a/image.c b/image.c
index 1c414dd75b268146e3cbc717480a18107bb5fa18..f36e975d75627102d3369bd847a72316a384a330 100644 (file)
--- a/image.c
+++ b/image.c
@@ -159,6 +159,7 @@ qbyte* LoadPCX (qbyte *f, int matchwidth, int matchheight)
                        else
                                a[x++] = dataByte;
                }
+               fin += pcx.bytes_per_line - image_width; // the number of bytes per line is always forced to an even number
                while(x < image_width)
                        a[x++] = 0;
        }
@@ -587,8 +588,9 @@ rtexture_t *loadtextureimagewithmask (rtexturepool_t *pool, char* filename, int
        return rt;
 }
 
-void Image_WriteTGARGB_preflipped (char *filename, int width, int height, qbyte *data)
+qboolean Image_WriteTGARGB_preflipped (char *filename, int width, int height, qbyte *data)
 {
+       qboolean ret;
        qbyte *buffer, *in, *out, *end;
 
        buffer = Mem_Alloc(tempmempool, width*height*3 + 18);
@@ -611,9 +613,10 @@ void Image_WriteTGARGB_preflipped (char *filename, int width, int height, qbyte
                *out++ = in[1];
                *out++ = in[0];
        }
-       COM_WriteFile (filename, buffer, width*height*3 + 18 );
+       ret = COM_WriteFile (filename, buffer, width*height*3 + 18 );
 
        Mem_Free(buffer);
+       return ret;
 }
 
 void Image_WriteTGARGB (char *filename, int width, int height, qbyte *data)
@@ -1183,3 +1186,4 @@ void Image_MipReduce(qbyte *in, qbyte *out, int *width, int *height, int destwid
                        Sys_Error("Image_MipReduce: desired size already achieved\n");
        }
 }
+