Skip to content

Commit

Permalink
WINDOWS: Hopefully fix mingw compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirben committed Apr 24, 2017
1 parent a1dab31 commit b46a1b6
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions backends/platform/sdl/win32/win32.cpp
Expand Up @@ -29,7 +29,8 @@
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include <shellapi.h>
//#include <ShlObj.h>
#define _WIN32_IE 0x500 // required for SHGFP_TYPE_CURRENT in shlobj.h
#include <shlobj.h>

#include "common/scummsys.h"
#include "common/config-manager.h"
Expand Down Expand Up @@ -154,22 +155,22 @@ Common::String OSystem_Win32::getScreenshotsPath() {
return screenshotsPath;
}

// char picturesPath[MAXPATHLEN];
//
// // Use the My Pictures folder.
// if (SHGetFolderPath(NULL, CSIDL_MYPICTURES, NULL, SHGFP_TYPE_CURRENT, picturesPath) != S_OK) {
// warning("Unable to access My Pictures directory");
// return Common::String();
// }
//
// screenshotsPath = Common::String(picturesPath) + "\\ScummVM Screenshots\\";
//
// // If the directory already exists (as it should in most cases),
// // we don't want to fail, but we need to stop on other errors (such as ERROR_PATH_NOT_FOUND)
// if (!CreateDirectory(screenshotsPath.c_str(), NULL)) {
// if (GetLastError() != ERROR_ALREADY_EXISTS)
// error("Cannot create ScummVM Screenshots folder");
// }
char picturesPath[MAXPATHLEN];

// Use the My Pictures folder.
if (SHGetFolderPath(NULL, CSIDL_MYPICTURES, NULL, SHGFP_TYPE_CURRENT, picturesPath) != S_OK) {
warning("Unable to access My Pictures directory");
return Common::String();
}

screenshotsPath = Common::String(picturesPath) + "\\ScummVM Screenshots\\";

// If the directory already exists (as it should in most cases),
// we don't want to fail, but we need to stop on other errors (such as ERROR_PATH_NOT_FOUND)
if (!CreateDirectory(screenshotsPath.c_str(), NULL)) {
if (GetLastError() != ERROR_ALREADY_EXISTS)
error("Cannot create ScummVM Screenshots folder");
}

return screenshotsPath;
}
Expand Down

0 comments on commit b46a1b6

Please sign in to comment.