mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-06-04 19:01:15 +00:00
Use system libjpeg8
The unused WriteLossless() was using libjpeg internals found in jpegint.h. This header is available with libjpeg8, but not shipped by most distros. Disable the relevant code - no functional changes.
This commit is contained in:
parent
1b858a774f
commit
e704911fed
67 changed files with 37 additions and 24607 deletions
|
@ -29,6 +29,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "../idlib/precompiled.h"
|
||||
#pragma hdrstop
|
||||
|
||||
#include <jpeglib.h>
|
||||
|
||||
#include "tr_local.h"
|
||||
|
||||
/*
|
||||
|
@ -48,8 +50,6 @@ void R_LoadImage( const char *name, byte **pic, int *width, int *height, bool ma
|
|||
*/
|
||||
|
||||
extern "C" {
|
||||
#include "jpeg-6/jpeglib.h"
|
||||
|
||||
// hooks from jpeg lib to our system
|
||||
|
||||
void jpg_Error( const char *fmt, ... ) {
|
||||
|
@ -835,27 +835,25 @@ static void LoadJPG( const char *filename, unsigned char **pic, int *width, int
|
|||
if ( pic ) {
|
||||
*pic = NULL; // until proven otherwise
|
||||
}
|
||||
{
|
||||
int len;
|
||||
idFile *f;
|
||||
|
||||
f = fileSystem->OpenFileRead( filename );
|
||||
if ( !f ) {
|
||||
return;
|
||||
}
|
||||
len = f->Length();
|
||||
if ( timestamp ) {
|
||||
*timestamp = f->Timestamp();
|
||||
}
|
||||
if ( !pic ) {
|
||||
fileSystem->CloseFile( f );
|
||||
return; // just getting timestamp
|
||||
}
|
||||
fbuffer = (byte *)Mem_ClearedAlloc( len + 4096 );
|
||||
f->Read( fbuffer, len );
|
||||
int len;
|
||||
idFile *f;
|
||||
|
||||
f = fileSystem->OpenFileRead( filename );
|
||||
if ( !f ) {
|
||||
return;
|
||||
}
|
||||
len = f->Length();
|
||||
if ( timestamp ) {
|
||||
*timestamp = f->Timestamp();
|
||||
}
|
||||
if ( !pic ) {
|
||||
fileSystem->CloseFile( f );
|
||||
}
|
||||
|
||||
return; // just getting timestamp
|
||||
}
|
||||
fbuffer = (byte *)Mem_ClearedAlloc( len + 4096 );
|
||||
f->Read( fbuffer, len );
|
||||
fileSystem->CloseFile( f );
|
||||
|
||||
/* Step 1: allocate and initialize JPEG decompression object */
|
||||
|
||||
|
@ -871,7 +869,7 @@ static void LoadJPG( const char *filename, unsigned char **pic, int *width, int
|
|||
|
||||
/* Step 2: specify data source (eg, a file) */
|
||||
|
||||
jpeg_stdio_src(&cinfo, fbuffer);
|
||||
jpeg_mem_src(&cinfo, fbuffer, len);
|
||||
|
||||
/* Step 3: read file parameters with jpeg_read_header() */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue