WritePicture: also support png input images :P
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 May 2010 12:37:48 +0000 (12:37 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 May 2010 12:37:48 +0000 (12:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10176 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.h
gl_textures.c
jpeg.c

index cc6bda0..faf906b 100644 (file)
@@ -11,6 +11,7 @@ extern cvar_t vid_conheight;
 extern cvar_t vid_pixelheight;
 extern cvar_t scr_screenshot_jpeg;
 extern cvar_t scr_screenshot_jpeg_quality;
+extern cvar_t scr_screenshot_png;
 extern cvar_t scr_screenshot_gammaboost;
 extern cvar_t scr_screenshot_name;
 
index b4ae602..42db03e 100644 (file)
@@ -528,8 +528,8 @@ static void r_textures_start(void)
        // Disable JPEG screenshots if the DLL isn't loaded
        if (! JPEG_OpenLibrary ())
                Cvar_SetValueQuick (&scr_screenshot_jpeg, 0);
-       // TODO: support png screenshots?
-       PNG_OpenLibrary ();
+       if (! PNG_OpenLibrary ())
+               Cvar_SetValueQuick (&scr_screenshot_png, 0);
 }
 
 static void r_textures_shutdown(void)
diff --git a/jpeg.c b/jpeg.c
index 74bd708..b5f513b 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -1032,6 +1032,7 @@ qboolean Image_Compress(const char *imagename, size_t maxsize, void **buf, size_
        CompressedImageCacheItem *i;
 
        JPEG_OpenLibrary (); // for now; LH had the idea of replacing this by a better format
+       PNG_OpenLibrary (); // for loading
 
        // No DLL = no JPEGs
        if (!jpeg_dll)