mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 09:56:30 +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 OSystem_MacOSX::getScreenshotsPath() {
|
||||||
Common::String path = ConfMan.get("screenshotpath");
|
// If the user has configured a screenshots path, use it
|
||||||
if (path.empty())
|
const Common::String path = OSystem_SDL::getScreenshotsPath();
|
||||||
path = getDesktopPathMacOSX();
|
if (!path.empty())
|
||||||
if (!path.empty() && !path.hasSuffix("/"))
|
return path;
|
||||||
path += "/";
|
|
||||||
return path;
|
Common::String desktopPath = getDesktopPathMacOSX();
|
||||||
|
if (!desktopPath.empty() && !desktopPath.hasSuffix("/"))
|
||||||
|
desktopPath += "/";
|
||||||
|
return desktopPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioCDManager *OSystem_MacOSX::createAudioCDManager() {
|
AudioCDManager *OSystem_MacOSX::createAudioCDManager() {
|
||||||
|
@ -238,10 +238,15 @@ Common::String OSystem_Win32::getSystemLanguage() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Common::String OSystem_Win32::getScreenshotsPath() {
|
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.empty()) {
|
||||||
if (!screenshotsPath.hasSuffix("\\") && !screenshotsPath.hasSuffix("/"))
|
// OSystem_SDL may have appended a '/' at the end
|
||||||
screenshotsPath += "\\";
|
if (screenshotsPath.hasSuffix("/")) {
|
||||||
|
screenshotsPath.deleteLastChar();
|
||||||
|
if (!screenshotsPath.hasSuffix("\\") && !screenshotsPath.hasSuffix("/"))
|
||||||
|
screenshotsPath += "\\";
|
||||||
|
}
|
||||||
return screenshotsPath;
|
return screenshotsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user