mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
SDL: Allow specifying the screenshot directory in the config file
There is no GUI option to set the screenshot directory, but this allows power users to set it if they don't want to use the default.
This commit is contained in:
parent
11dd33bb73
commit
e96c057c3d
14
README
14
README
@ -2682,11 +2682,19 @@ configuration of each entry, allowing the custom options to be shown.
|
||||
9.0) Screenshots (SDL backend only):
|
||||
---- -------------------------------
|
||||
On systems using the SDL backend (for example Windows, Mac or Linux) you can use
|
||||
alt+s to take snapshots (see section 5.4 - Hotkeys). The location of the created
|
||||
screenshot file depends on the OS:
|
||||
alt+s to take snapshots (see section 5.4 - Hotkeys).
|
||||
|
||||
You can specify the directory in which you want the screenshots to be created in
|
||||
the config file. To do so add a screenshotpath value under the [scummvm] section:
|
||||
|
||||
[scummvm]
|
||||
screenshotpath=/path/to/screenshots/
|
||||
|
||||
The default location, when no screenshot path is defined in the config file,
|
||||
depends on the OS:
|
||||
Windows: In Users\username\My Pictures\ScummVM Screenshots.
|
||||
macOS X: On the Desktop.
|
||||
Any other OS: In the current directoty.
|
||||
Any other OS: In the current directory.
|
||||
|
||||
|
||||
10.0) Compiling:
|
||||
|
@ -188,7 +188,9 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {
|
||||
}
|
||||
|
||||
Common::String OSystem_MacOSX::getScreenshotsPath() {
|
||||
Common::String path = getDesktopPathMacOSX();
|
||||
Common::String path = ConfMan.get("screenshotpath");
|
||||
if (path.empty())
|
||||
path = getDesktopPathMacOSX();
|
||||
if (!path.empty() && !path.hasSuffix("/"))
|
||||
path += "/";
|
||||
return path;
|
||||
|
@ -573,7 +573,10 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
|
||||
|
||||
//Not specified in base class
|
||||
Common::String OSystem_SDL::getScreenshotsPath() {
|
||||
return Common::String();
|
||||
Common::String path = ConfMan.get("screenshotpath");
|
||||
if (!path.empty() && !path.hasSuffix("/"))
|
||||
path += "/";
|
||||
return path;
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
|
@ -147,13 +147,22 @@ bool OSystem_Win32::openUrl(const Common::String &url) {
|
||||
}
|
||||
|
||||
Common::String OSystem_Win32::getScreenshotsPath() {
|
||||
Common::String screenshotsPath = ConfMan.get("screenshotpath");
|
||||
if (!screenshotsPath.empty()) {
|
||||
if (!screenshotsPath.hasSuffix("\\") && !screenshotsPath.hasSuffix("/")
|
||||
screenshotsPath += "\\";
|
||||
return screenshotsPath;
|
||||
}
|
||||
|
||||
char picturesPath[MAXPATHLEN];
|
||||
|
||||
// Use the My Pictures folder.
|
||||
if (SHGetFolderPath(NULL, CSIDL_MYPICTURES, NULL, SHGFP_TYPE_CURRENT, picturesPath) != S_OK)
|
||||
error("Unable to access My Pictures directory");
|
||||
if (SHGetFolderPath(NULL, CSIDL_MYPICTURES, NULL, SHGFP_TYPE_CURRENT, picturesPath) != S_OK) {
|
||||
warning("Unable to access My Pictures directory");
|
||||
return Common::String();
|
||||
}
|
||||
|
||||
Common::String screenshotsPath = Common::String(picturesPath) + "\\ScummVM Screenshots\\";
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user