add q3map2 build to scons

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@193 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
TTimo
2008-01-02 04:47:59 +00:00
parent 1099f571fe
commit 7a51df0e11
6 changed files with 470 additions and 15 deletions

View File

@@ -342,8 +342,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;
@@ -392,18 +391,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 );
}