X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=jpeg.c;h=b0a8da9072e740d100e1c8880b4ccfb17a05559f;hb=603987edca0ef1132be0d2e1698c9e850cf3b08f;hp=45a2c32b56040932b2e501eca6bf62d383cf6c83;hpb=9dc8149ee231682452a52a4ec4bdee3981da5492;p=xonotic%2Fdarkplaces.git diff --git a/jpeg.c b/jpeg.c index 45a2c32b..b0a8da90 100644 --- a/jpeg.c +++ b/jpeg.c @@ -397,7 +397,9 @@ qboolean JPEG_OpenLibrary (void) { const char* dllnames [] = { -#ifdef WIN32 +#if defined(WIN64) + "libjpeg64.dll", +#elif defined(WIN32) "libjpeg.dll", #elif defined(MACOSX) "libjpeg.62.dylib", @@ -468,7 +470,7 @@ static void JPEG_SkipInputData (j_decompress_ptr cinfo, long num_bytes) cinfo->src->bytes_in_buffer -= num_bytes; } -static void JPEG_MemSrc (j_decompress_ptr cinfo, qbyte *buffer) +static void JPEG_MemSrc (j_decompress_ptr cinfo, const qbyte *buffer) { cinfo->src = cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (struct jpeg_source_mgr)); @@ -496,7 +498,7 @@ JPEG_LoadImage Load a JPEG image into a RGBA buffer ==================== */ -qbyte* JPEG_LoadImage (qbyte *f, int matchwidth, int matchheight) +qbyte* JPEG_LoadImage (const qbyte *f, int matchwidth, int matchheight) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; @@ -628,7 +630,7 @@ static void JPEG_TermDestination (j_compress_ptr cinfo) // Write any data remaining in the buffer if (datacount > 0) - if (FS_Write (dest->outfile, dest->buffer, datacount) != datacount) + if (FS_Write (dest->outfile, dest->buffer, datacount) != (fs_offset_t)datacount) error_in_jpeg = true; }