aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/win32
diff options
context:
space:
mode:
authorKirben2017-04-24 10:57:02 +1000
committerKirben2017-04-24 10:57:02 +1000
commitb46a1b688d65c94ec7631eba861ea1ed1600dd20 (patch)
tree304551fb4c698a040e8a2dac85af2238f261dcf1 /backends/platform/sdl/win32
parenta1dab31c08a38d8e023377e84d9122f0309ee921 (diff)
downloadscummvm-rg350-b46a1b688d65c94ec7631eba861ea1ed1600dd20.tar.gz
scummvm-rg350-b46a1b688d65c94ec7631eba861ea1ed1600dd20.tar.bz2
scummvm-rg350-b46a1b688d65c94ec7631eba861ea1ed1600dd20.zip
WINDOWS: Hopefully fix mingw compilation.
Diffstat (limited to 'backends/platform/sdl/win32')
-rw-r--r--backends/platform/sdl/win32/win32.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index e09fb5e055..f50059e165 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -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"
@@ -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;
}