]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - jpeg.c
com_list: Actually initialize a list to point to itself...
[xonotic/darkplaces.git] / jpeg.c
diff --git a/jpeg.c b/jpeg.c
index 0a6e160a2bedd3b14597af69e42dcf1b3490855e..beab84335221c9ad4e3f06cb4e765fdc8bbc45b8 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
 */
 
 
-#include "quakedef.h"
+#include "darkplaces.h"
+#include "cl_screen.h"
 #include "image.h"
 #include "jpeg.h"
 #include "image_png.h"
 
-cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
+extern cvar_t sv_writepicture_quality;
 cvar_t r_texture_jpeg_fastpicmip = {CF_CLIENT | CF_ARCHIVE, "r_texture_jpeg_fastpicmip", "1", "perform gl_picmip during decompression for JPEG files (faster)"};
 
 // jboolean is unsigned char instead of int on Win32
@@ -168,9 +169,9 @@ typedef struct {
   /* The decompressor output side may not use these variables. */
   int dc_tbl_no;                /* DC entropy table selector (0..3) */
   int ac_tbl_no;                /* AC entropy table selector (0..3) */
-  
+
   /* Remaining fields should be treated as private by applications. */
-  
+
   /* These values are computed during compression or decompression startup: */
   /* Component's size in DCT blocks.
    * Any dummy blocks added to complete an MCU are not counted; therefore
@@ -522,7 +523,7 @@ qbool JPEG_OpenLibrary (void)
 #endif
 
        // Load the DLL
-       return Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs);
+       return Sys_LoadDependency (dllnames, &jpeg_dll, jpegfuncs);
 #endif
 }
 
@@ -537,7 +538,7 @@ Unload the JPEG DLL
 void JPEG_CloseLibrary (void)
 {
 #ifndef LINK_TO_LIBJPEG
-       Sys_UnloadLibrary (&jpeg_dll);
+       Sys_FreeLibrary (&jpeg_dll);
        jpeg_tried_loading = false; // allow retry
 #endif
 }
@@ -898,7 +899,7 @@ static size_t JPEG_try_SaveImage_to_Buffer (struct jpeg_compress_struct *cinfo,
        cinfo->in_color_space = JCS_RGB;
        cinfo->input_components = 3;
        qjpeg_set_defaults (cinfo);
-       qjpeg_set_quality (cinfo, quality, FALSE);
+       qjpeg_set_quality (cinfo, quality, false);
 
        cinfo->comp_info[0].h_samp_factor = 2;
        cinfo->comp_info[0].v_samp_factor = 2;
@@ -1016,7 +1017,7 @@ static void CompressedImageCache_Add(const char *imagename, size_t maxsize, void
 
        if(strlen(imagename) >= MAX_QPATH)
                return; // can't add this
-       
+
        i = (CompressedImageCacheItem*) Z_Malloc(sizeof(CompressedImageCacheItem));
        strlcpy(i->imagename, imagename, sizeof(i->imagename));
        i->maxsize = maxsize;