mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 04:35:16 +00:00
SDL: Do not query directly ConfMan for the screenshotpath in Windows and macOS backends
Instead we call the OSystem_SDL implementation of getScreenshotsPath(), as done in the POSIX backend. This change means that if we change how we handle a user-specified screenshot path in the SDL backend, the Windows and macOS backends will still get the correct path.
This commit is contained in:
parent
54c84b8700
commit
533693437d
@ -269,12 +269,15 @@ Common::String OSystem_MacOSX::getDefaultLogFileName() {
|
||||
}
|
||||
|
||||
Common::String OSystem_MacOSX::getScreenshotsPath() {
|
||||
Common::String path = ConfMan.get("screenshotpath");
|
||||
if (path.empty())
|
||||
path = getDesktopPathMacOSX();
|
||||
if (!path.empty() && !path.hasSuffix("/"))
|
||||
path += "/";
|
||||
return path;
|
||||
// If the user has configured a screenshots path, use it
|
||||
const Common::String path = OSystem_SDL::getScreenshotsPath();
|
||||
if (!path.empty())
|
||||
return path;
|
||||
|
||||
Common::String desktopPath = getDesktopPathMacOSX();
|
||||
if (!desktopPath.empty() && !desktopPath.hasSuffix("/"))
|
||||
desktopPath += "/";
|
||||
return desktopPath;
|
||||
}
|
||||
|
||||
AudioCDManager *OSystem_MacOSX::createAudioCDManager() {
|
||||
|
@ -238,10 +238,15 @@ Common::String OSystem_Win32::getSystemLanguage() const {
|
||||
}
|
||||
|
||||
Common::String OSystem_Win32::getScreenshotsPath() {
|
||||
Common::String screenshotsPath = ConfMan.get("screenshotpath");
|
||||
// If the user has configured a screenshots path, use it
|
||||
Common::String screenshotsPath = OSystem_SDL::getScreenshotsPath();
|
||||
if (!screenshotsPath.empty()) {
|
||||
if (!screenshotsPath.hasSuffix("\\") && !screenshotsPath.hasSuffix("/"))
|
||||
screenshotsPath += "\\";
|
||||
// OSystem_SDL may have appended a '/' at the end
|
||||
if (screenshotsPath.hasSuffix("/")) {
|
||||
screenshotsPath.deleteLastChar();
|
||||
if (!screenshotsPath.hasSuffix("\\") && !screenshotsPath.hasSuffix("/"))
|
||||
screenshotsPath += "\\";
|
||||
}
|
||||
return screenshotsPath;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user