X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FImageIO.cpp;h=3e6a72e825fc2caf89411e692e27a6b02618f9c8;hb=f38eb24f446b94d592d97b24b315bb44bed7b12c;hp=affcb8c58c29d40cc1a9dc2a96cfedac9b7cb020;hpb=a7c9ba64aa7413abb4c566dad8dc796526952d3e;p=lugaru.git diff --git a/Source/ImageIO.cpp b/Source/ImageIO.cpp index affcb8c..3e6a72e 100644 --- a/Source/ImageIO.cpp +++ b/Source/ImageIO.cpp @@ -27,6 +27,7 @@ along with Lugaru. If not, see . #include "Game.h" #include "ImageIO.h" +#include "Utils/Folders.h" extern bool visibleloading; @@ -74,7 +75,7 @@ bool save_screenshot(const char *file_name) const char *ptr = strrchr((char *)file_name, '.'); if (ptr) { if (strcasecmp(ptr + 1, "png") == 0) - return save_screenshot_png(file_name); + return save_screenshot_png((Folders::getScreenshotDir() + '/' + file_name).c_str()); } STUBBED("Unsupported image type"); @@ -154,7 +155,7 @@ static bool load_png(const char *file_name, ImageRec &tex) if (fp == NULL) { cerr << file_name << " not found" << endl; - return(NULL); + return false; } png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); @@ -291,6 +292,6 @@ save_png_done: if (fp) fclose(fp); if (!retval) - unlink(ConvertFileName(file_name)); + unlink(file_name); return retval; }