From: divverent Date: Sat, 8 May 2010 12:37:48 +0000 (+0000) Subject: WritePicture: also support png input images :P X-Git-Tag: xonotic-v0.1.0preview~230^2~302 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e0f3baa334fd30a181cd1eacf39dc26e8841b4e9;p=xonotic%2Fdarkplaces.git WritePicture: also support png input images :P git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10176 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.h b/cl_screen.h index cc6bda0a..faf906b2 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -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; diff --git a/gl_textures.c b/gl_textures.c index b4ae602c..42db03eb 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -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 74bd708e..b5f513be 100644 --- 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)