]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix jpeg upside down
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Jul 2008 16:07:47 +0000 (16:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Jul 2008 16:07:47 +0000 (16:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8418 d7cf8633-e32d-0410-b094-e92efae38249

jpeg.c

diff --git a/jpeg.c b/jpeg.c
index 0422fe03f12e4aed795598de022e1e4df70dd52b..7c02659b957dfb0ca26eaeab4cb35744f69ea52e 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -760,7 +760,7 @@ qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height,
        struct jpeg_compress_struct cinfo;
        struct jpeg_error_mgr jerr;
        unsigned char *scanline;
-       unsigned int offset, linesize;
+       unsigned int linesize;
        qfile_t* file;
 
        // No DLL = no JPEGs
@@ -803,10 +803,9 @@ qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height,
 
        // Compress each scanline
        linesize = cinfo.image_width * 3;
-       offset = linesize * (cinfo.image_height - 1);
        while (cinfo.next_scanline < cinfo.image_height)
        {
-               scanline = &data[offset - cinfo.next_scanline * linesize];
+               scanline = &data[cinfo.next_scanline * linesize];
 
                qjpeg_write_scanlines (&cinfo, &scanline, 1);
                if (error_in_jpeg)