From: divverent Date: Mon, 21 Jul 2008 16:07:47 +0000 (+0000) Subject: fix jpeg upside down X-Git-Tag: xonotic-v0.1.0preview~2163 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d689da6d1d694e78d7099027e44e6f9e16f50d0;p=xonotic%2Fdarkplaces.git fix jpeg upside down git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8418 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/jpeg.c b/jpeg.c index 0422fe03..7c02659b 100644 --- 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)