foxygit / doom Log in
commit 5cf245c0027abb2478aaf1f90efcaecd80af3a9e
Author:     Jonathan Dowland <jon+github@alcopop.org>
AuthorDate: Wed Mar 1 12:30:07 2017 +0000
Commit:     Jonathan Dowland <jon+github@alcopop.org>
CommitDate: Wed Mar 1 14:01:37 2017 +0000

    Fix error message for PNG screenshots

    This lunchtime's small distraction...

    When there are no available filenames for writing out a screenshot,
    chocolate errored out with "V_ScreenShot: Couldn't create a PCX",
    even if PNG screenshots were enabled. Write out a correct message
    for the PNG case.
---
 src/v_video.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/v_video.c b/src/v_video.c
index 2cc0c019..08aeca9f 100644
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -849,7 +849,16 @@ void V_ScreenShot(char *format)

     if (i == 100)
     {
-        I_Error ("V_ScreenShot: Couldn't create a PCX");
+#ifdef HAVE_LIBPNG
+        if (png_screenshots)
+        {
+            I_Error ("V_ScreenShot: Couldn't create a PNG");
+        }
+        else
+#endif
+        {
+            I_Error ("V_ScreenShot: Couldn't create a PCX");
+        }
     }

 #ifdef HAVE_LIBPNG