]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/image/jpeg.cpp
fix windows compile, it's possible the linux build broke and will need misc tweaks...
[xonotic/netradiant.git] / plugins / image / jpeg.cpp
index db3d12c4456a6a0ac688cf8a7cc0e6fb0e137368..66df32ffd0caf4c883871f14069811be85cae18f 100644 (file)
@@ -34,20 +34,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // Leonardo Zide (leo@lokigames.com)
 //
 
+#include <stdio.h>
 #include <setjmp.h>
 #include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
 #include <glib.h>
 
+extern "C" {
 #include <jpeglib.h>
 #include <jerror.h>
- /*
-extern "C" {
-#include "radiant_jpeglib.h"
-#include "jpeg6/jerror.h"
 }
- */
 
 #include "image.h"
 
@@ -348,8 +344,7 @@ static void j_putGrayScanlineToRGB (unsigned char* jpegline, int widthPix, unsig
   }
 }
 
-static int _LoadJPGBuff (void *src_buffer, int src_size, unsigned char **pic, int *width, int *height) 
-{
+static int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ) {
   struct jpeg_decompress_struct cinfo;
   struct my_jpeg_error_mgr jerr;
   JSAMPARRAY buffer;
@@ -398,18 +393,16 @@ static int _LoadJPGBuff (void *src_buffer, int src_size, unsigned char **pic, in
   return 0;
 }
 
-void LoadJPG (const char *filename, unsigned char **pic, int *width, int *height)
-{
+void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) {
   unsigned char *fbuffer = NULL;
   int nLen = vfsLoadFile ((char *)filename, (void **)&fbuffer, 0 );
   if (nLen == -1)
     return;
 
-  if (_LoadJPGBuff (fbuffer, nLen, pic, width, height) != 0)
-  {
+  if ( LoadJPGBuff( fbuffer, nLen, pic, width, height ) != 0 ) {
     g_FuncTable.m_pfnSysPrintf( "WARNING: JPEG library failed to load %s because %s\n", filename, *pic );
     *pic = NULL;
   }
 
-  vfsFreeFile (fbuffer);
+  vfsFreeFile( fbuffer );
 }