]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 cc6bda0a06dc375d8517a934ea2c5c30bbd20364..faf906b2fb1af62855eb3ece8a78afde992bba39 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 b4ae602c1ed2268b240dca335175c4b56117ac40..42db03eb7f2e47e9b08af6a46d4bec8c3f167068 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 74bd708effde51b03e090b5f4e878ceda69af797..b5f513be4048b62187ad516fb8b15112785f1e64 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)