From a9ae691513f20018cc3798929dc6161828adfc7f Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 24 Apr 2017 01:06:03 +0100 Subject: SDL: Improve debug and warning messages when saving screenshots In particular this adds a warning when failing to save a screenshot in OpenGL mode (there was already one in SurfaceSDL mode). --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'backends/graphics/surfacesdl') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index dd28f32bdc..ccfcc94ab3 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2543,10 +2543,17 @@ bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) { SDL_RWclose(file); } - if (saveScreenshot((screenshotsPath + filename).c_str())) - debug("Saved screenshot '%s'", filename.c_str()); - else - warning("Could not save screenshot"); + if (saveScreenshot((screenshotsPath + filename).c_str())) { + if (screenshotsPath.empty()) + debug("Saved screenshot '%s' in current directory", filename.c_str()); + else + debug("Saved screenshot '%s' in directory '%s'", filename.c_str(), screenshotsPath.c_str()); + } else { + if (screenshotsPath.empty()) + warning("Could not save screenshot in current directory"); + else + warning("Could not save screenshot in directory '%s'", screenshotsPath.c_str()); + } return true; } -- cgit v1.2.3