// 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"
}
}
-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;
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 );
}