[Scummvm-git-logs] scummvm master -> f6ff9f3d6ff9334f469513daaaa97f6a4c85ca69

spleen1981 noreply at scummvm.org
Fri Oct 25 18:27:41 UTC 2024


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
27c7b5e5cb LIBRETRO: add readability condition to load paths
576e2251c7 LIBRETRO: add checks for iconspath
dbc7039622 LIBRETRO: split settings path checks in separate function
3a94cf76c0 LIBRETRO: add path checks on settings change
f6ff9f3d6f LIBRETRO: move paths checks to applyBackendSettings()


Commit: 27c7b5e5cb339ae9a4be4c8baec971b3018c3136
    https://github.com/scummvm/scummvm/commit/27c7b5e5cb339ae9a4be4c8baec971b3018c3136
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-25T20:25:42+02:00

Commit Message:
LIBRETRO: add readability condition to load paths

Changed paths:
    backends/platform/libretro/src/libretro-os-base.cpp


diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index bdc090ebe0c..f0882e29374 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -65,13 +65,13 @@ void OSystem_libretro::initBackend() {
 	Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
 	Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
 
-	if (! LibRetroFilesystemNode(s_themeDir).isDirectory())
+	if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
 		s_themeDir.clear();
-	if (! LibRetroFilesystemNode(s_extraDir).isDirectory())
+	if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
 		s_extraDir.clear();
 	if (! LibRetroFilesystemNode(s_soundfontPath).exists())
 		s_soundfontPath.clear();
-	if ((s_homeDir.empty() || ! LibRetroFilesystemNode(s_homeDir).isDirectory()) && ! s_systemDir.empty())
+	if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
 		s_homeDir = s_systemDir;
 
 	//Register default paths
@@ -152,7 +152,7 @@ bool OSystem_libretro::checkPathSetting(const char *setting, Common::String cons
 	if (ConfMan.hasKey(setting))
 		setPath = Common::Path::fromConfig(ConfMan.get(setting)).toString();
 
-	if (setPath.empty() || ! (isDirectory ? LibRetroFilesystemNode(setPath).isDirectory() : LibRetroFilesystemNode(setPath).exists()))
+	if (setPath.empty() || ! (isDirectory ? (LibRetroFilesystemNode(setPath).isDirectory() && LibRetroFilesystemNode(setPath).isReadable()) : LibRetroFilesystemNode(setPath).exists()))
 		ConfMan.removeKey(setting, Common::ConfigManager::kApplicationDomain);
 	if (! ConfMan.hasKey(setting))
 		if (defaultPath.empty())
@@ -165,7 +165,7 @@ bool OSystem_libretro::checkPathSetting(const char *setting, Common::String cons
 void OSystem_libretro::setLibretroDir(const char * path, Common::String &var) {
 	var = Common::String(path ? path : "");
 	if (! var.empty())
-		if (! LibRetroFilesystemNode(var).isDirectory())
+		if (! (LibRetroFilesystemNode(var).isDirectory() && LibRetroFilesystemNode(var).isReadable()))
 			var.clear();
 	return;
 }


Commit: 576e2251c7529132e2eb5e6f0e9af2ce1d312396
    https://github.com/scummvm/scummvm/commit/576e2251c7529132e2eb5e6f0e9af2ce1d312396
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-25T20:26:05+02:00

Commit Message:
LIBRETRO: add checks for iconspath

Changed paths:
    backends/platform/libretro/src/libretro-os-base.cpp


diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index f0882e29374..52deb83dae6 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -94,6 +94,7 @@ void OSystem_libretro::initBackend() {
 	checkPathSetting("soundfont", s_soundfontPath, false);
 	checkPathSetting("browser_lastpath", s_homeDir);
 	checkPathSetting("libretro_playlist_path", s_playlistDir.empty() ? s_homeDir : s_playlistDir);
+	checkPathSetting("iconspath", "");
 
 	//Check other settings
 	if (! ConfMan.hasKey("libretro_playlist_version"))


Commit: dbc703962233c4de45f7dc433a89b62c25453a70
    https://github.com/scummvm/scummvm/commit/dbc703962233c4de45f7dc433a89b62c25453a70
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-25T20:26:39+02:00

Commit Message:
LIBRETRO: split settings path checks in separate function

Changed paths:
    backends/platform/libretro/include/libretro-os.h
    backends/platform/libretro/src/libretro-os-base.cpp


diff --git a/backends/platform/libretro/include/libretro-os.h b/backends/platform/libretro/include/libretro-os.h
index 87d5315b420..c4cc63bb687 100644
--- a/backends/platform/libretro/include/libretro-os.h
+++ b/backends/platform/libretro/include/libretro-os.h
@@ -103,6 +103,7 @@ public:
 private:
 	bool checkPathSetting(const char *setting, Common::String const &defaultPath, bool isDirectory = true);
 	void setLibretroDir(const char *path, Common::String &var);
+	void checkAllPathSettings(void);
 
 	/* Events */
 public:
diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index 52deb83dae6..623215ebd04 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -59,42 +59,46 @@ OSystem_libretro::~OSystem_libretro() {
 	_mixer = nullptr;
 }
 
-void OSystem_libretro::initBackend() {
+void OSystem_libretro::checkAllPathSettings() {
 	Common::String s_homeDir(LibRetroFilesystemNode::getHomeDir());
-	Common::String s_themeDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_THEME_SUBDIR);
-	Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
-	Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
-
-	if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
-		s_themeDir.clear();
-	if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
-		s_extraDir.clear();
-	if (! LibRetroFilesystemNode(s_soundfontPath).exists())
-		s_soundfontPath.clear();
-	if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
-		s_homeDir = s_systemDir;
-
-	//Register default paths
-	if (! s_homeDir.empty()) {
-		ConfMan.registerDefault("browser_lastpath", s_homeDir);
-		retro_log_cb(RETRO_LOG_DEBUG, "Default browser last path set to: %s\n", s_homeDir.c_str());
-	}
-	if (! s_saveDir.empty()) {
-		ConfMan.registerDefault("savepath", s_saveDir);
-		retro_log_cb(RETRO_LOG_DEBUG, "Default save path set to: %s\n", s_saveDir.c_str());
-	}
+		Common::String s_themeDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_THEME_SUBDIR);
+		Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
+		Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
+
+		if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
+			s_themeDir.clear();
+		if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
+			s_extraDir.clear();
+		if (! LibRetroFilesystemNode(s_soundfontPath).exists())
+			s_soundfontPath.clear();
+		if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
+			s_homeDir = s_systemDir;
+
+		//Register default paths
+		if (! s_homeDir.empty()) {
+			ConfMan.registerDefault("browser_lastpath", s_homeDir);
+			retro_log_cb(RETRO_LOG_DEBUG, "Default browser last path set to: %s\n", s_homeDir.c_str());
+		}
+		if (! s_saveDir.empty()) {
+			ConfMan.registerDefault("savepath", s_saveDir);
+			retro_log_cb(RETRO_LOG_DEBUG, "Default save path set to: %s\n", s_saveDir.c_str());
+		}
+
+		//Check current path settings
+		if (!checkPathSetting("savepath", s_saveDir))
+			retro_osd_notification("ScummVM save folder not found.");
+		if (!checkPathSetting("themepath", s_themeDir))
+			retro_osd_notification("ScummVM theme folder not found.");
+		if (!checkPathSetting("extrapath", s_extraDir))
+			retro_osd_notification("ScummVM extra folder not found. Some engines/features (e.g. Virtual Keyboard) will not work without relevant datafiles.");
+		checkPathSetting("soundfont", s_soundfontPath, false);
+		checkPathSetting("browser_lastpath", s_homeDir);
+		checkPathSetting("libretro_playlist_path", s_playlistDir.empty() ? s_homeDir : s_playlistDir);
+		checkPathSetting("iconspath", "");
+}
+
+void OSystem_libretro::initBackend() {
 
-	//Check current path settings
-	if (!checkPathSetting("savepath", s_saveDir))
-		retro_osd_notification("ScummVM save folder not found.");
-	if (!checkPathSetting("themepath", s_themeDir))
-		retro_osd_notification("ScummVM theme folder not found.");
-	if (!checkPathSetting("extrapath", s_extraDir))
-		retro_osd_notification("ScummVM extra folder not found. Some engines/features (e.g. Virtual Keyboard) will not work without relevant datafiles.");
-	checkPathSetting("soundfont", s_soundfontPath, false);
-	checkPathSetting("browser_lastpath", s_homeDir);
-	checkPathSetting("libretro_playlist_path", s_playlistDir.empty() ? s_homeDir : s_playlistDir);
-	checkPathSetting("iconspath", "");
 
 	//Check other settings
 	if (! ConfMan.hasKey("libretro_playlist_version"))


Commit: 3a94cf76c05287a4d52b986c18dfa8cd9d7131c0
    https://github.com/scummvm/scummvm/commit/3a94cf76c05287a4d52b986c18dfa8cd9d7131c0
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-25T20:27:03+02:00

Commit Message:
LIBRETRO: add path checks on settings change

Changed paths:
    backends/platform/libretro/src/libretro-os-utils.cpp


diff --git a/backends/platform/libretro/src/libretro-os-utils.cpp b/backends/platform/libretro/src/libretro-os-utils.cpp
index d8c58b49326..15f2efb226c 100644
--- a/backends/platform/libretro/src/libretro-os-utils.cpp
+++ b/backends/platform/libretro/src/libretro-os-utils.cpp
@@ -166,7 +166,7 @@ GUI::OptionsContainerWidget *OSystem_libretro::buildBackendOptionsWidget(GUI::Gu
 }
 
 void OSystem_libretro::applyBackendSettings() {
-	return;
+	checkAllPathSettings();
 }
 
 static const char * const helpTabs[] = {


Commit: f6ff9f3d6ff9334f469513daaaa97f6a4c85ca69
    https://github.com/scummvm/scummvm/commit/f6ff9f3d6ff9334f469513daaaa97f6a4c85ca69
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-25T20:27:28+02:00

Commit Message:
LIBRETRO: move paths checks to applyBackendSettings()

Changed paths:
    backends/platform/libretro/include/libretro-os.h
    backends/platform/libretro/src/libretro-options-widget.cpp
    backends/platform/libretro/src/libretro-os-base.cpp
    backends/platform/libretro/src/libretro-os-utils.cpp


diff --git a/backends/platform/libretro/include/libretro-os.h b/backends/platform/libretro/include/libretro-os.h
index c4cc63bb687..d202368ca18 100644
--- a/backends/platform/libretro/include/libretro-os.h
+++ b/backends/platform/libretro/include/libretro-os.h
@@ -100,11 +100,6 @@ public:
 #endif
 #endif
 
-private:
-	bool checkPathSetting(const char *setting, Common::String const &defaultPath, bool isDirectory = true);
-	void setLibretroDir(const char *path, Common::String &var);
-	void checkAllPathSettings(void);
-
 	/* Events */
 public:
 	bool pollEvent(Common::Event &event) override;
@@ -129,6 +124,8 @@ public:
 	void applyBackendSettings() override;
 private:
 	bool parseGameName(const Common::String &gameName, Common::String &engineId, Common::String &gameId);
+	bool checkPathSetting(const char *setting, Common::String const &defaultPath, bool isDirectory = true);
+	void setLibretroDir(const char *path, Common::String &var);
 
 	/* Inputs */
 public:
diff --git a/backends/platform/libretro/src/libretro-options-widget.cpp b/backends/platform/libretro/src/libretro-options-widget.cpp
index 99ceac7ffa6..7e3a1c1faff 100644
--- a/backends/platform/libretro/src/libretro-options-widget.cpp
+++ b/backends/platform/libretro/src/libretro-options-widget.cpp
@@ -291,5 +291,6 @@ bool LibretroOptionsWidget::save() {
 
 	ConfMan.setBool("libretro_hooks_clear", _hooksClear->getState(), _domain);
 
+	/* Always return true to call applyBackendSettings every time settings are applied */
 	return true;
 }
diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index 623215ebd04..e7bb67090f1 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -14,7 +14,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
 #if defined(_WIN32)
 #include "backends/fs/windows/windows-fs-factory.h"
 #define FS_SYSTEM_FACTORY WindowsFilesystemFactory
@@ -36,7 +35,6 @@
 #include "backends/platform/libretro/include/libretro-core.h"
 #include "backends/platform/libretro/include/libretro-timer.h"
 #include "backends/platform/libretro/include/libretro-os.h"
-#include "backends/platform/libretro/include/libretro-fs.h"
 #include "backends/platform/libretro/include/libretro-graphics-surface.h"
 #ifdef USE_OPENGL
 #include "backends/platform/libretro/include/libretro-graphics-opengl.h"
@@ -59,48 +57,10 @@ OSystem_libretro::~OSystem_libretro() {
 	_mixer = nullptr;
 }
 
-void OSystem_libretro::checkAllPathSettings() {
-	Common::String s_homeDir(LibRetroFilesystemNode::getHomeDir());
-		Common::String s_themeDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_THEME_SUBDIR);
-		Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
-		Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
-
-		if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
-			s_themeDir.clear();
-		if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
-			s_extraDir.clear();
-		if (! LibRetroFilesystemNode(s_soundfontPath).exists())
-			s_soundfontPath.clear();
-		if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
-			s_homeDir = s_systemDir;
-
-		//Register default paths
-		if (! s_homeDir.empty()) {
-			ConfMan.registerDefault("browser_lastpath", s_homeDir);
-			retro_log_cb(RETRO_LOG_DEBUG, "Default browser last path set to: %s\n", s_homeDir.c_str());
-		}
-		if (! s_saveDir.empty()) {
-			ConfMan.registerDefault("savepath", s_saveDir);
-			retro_log_cb(RETRO_LOG_DEBUG, "Default save path set to: %s\n", s_saveDir.c_str());
-		}
-
-		//Check current path settings
-		if (!checkPathSetting("savepath", s_saveDir))
-			retro_osd_notification("ScummVM save folder not found.");
-		if (!checkPathSetting("themepath", s_themeDir))
-			retro_osd_notification("ScummVM theme folder not found.");
-		if (!checkPathSetting("extrapath", s_extraDir))
-			retro_osd_notification("ScummVM extra folder not found. Some engines/features (e.g. Virtual Keyboard) will not work without relevant datafiles.");
-		checkPathSetting("soundfont", s_soundfontPath, false);
-		checkPathSetting("browser_lastpath", s_homeDir);
-		checkPathSetting("libretro_playlist_path", s_playlistDir.empty() ? s_homeDir : s_playlistDir);
-		checkPathSetting("iconspath", "");
-}
-
 void OSystem_libretro::initBackend() {
+	/* ScummVM paths checks are triggered by applyBackendSettings on setupGraphics() */
 
-
-	//Check other settings
+	/* Initialize other settings */
 	if (! ConfMan.hasKey("libretro_playlist_version"))
 		ConfMan.set("libretro_playlist_version", 0);
 
@@ -152,29 +112,6 @@ void OSystem_libretro::destroy() {
 	delete this;
 }
 
-bool OSystem_libretro::checkPathSetting(const char *setting, Common::String const &defaultPath, bool isDirectory) {
-	Common::String setPath;
-	if (ConfMan.hasKey(setting))
-		setPath = Common::Path::fromConfig(ConfMan.get(setting)).toString();
-
-	if (setPath.empty() || ! (isDirectory ? (LibRetroFilesystemNode(setPath).isDirectory() && LibRetroFilesystemNode(setPath).isReadable()) : LibRetroFilesystemNode(setPath).exists()))
-		ConfMan.removeKey(setting, Common::ConfigManager::kApplicationDomain);
-	if (! ConfMan.hasKey(setting))
-		if (defaultPath.empty())
-			return false;
-		else
-			ConfMan.set(setting, defaultPath);
-	return true;
-}
-
-void OSystem_libretro::setLibretroDir(const char * path, Common::String &var) {
-	var = Common::String(path ? path : "");
-	if (! var.empty())
-		if (! (LibRetroFilesystemNode(var).isDirectory() && LibRetroFilesystemNode(var).isReadable()))
-			var.clear();
-	return;
-}
-
 void OSystem_libretro::getScreen(const Graphics::ManagedSurface *&screen) {
 	if (retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_REQUEST_SW)
 		screen = dynamic_cast<LibretroGraphics *>(_graphicsManager)->getScreen();
diff --git a/backends/platform/libretro/src/libretro-os-utils.cpp b/backends/platform/libretro/src/libretro-os-utils.cpp
index 15f2efb226c..93fbc9adcb6 100644
--- a/backends/platform/libretro/src/libretro-os-utils.cpp
+++ b/backends/platform/libretro/src/libretro-os-utils.cpp
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-#define FORBIDDEN_SYMBOL_EXCEPTION_time
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
 
 #include <features/features_cpu.h>
 
@@ -30,6 +30,7 @@
 #include "backends/platform/libretro/include/libretro-core.h"
 #include "backends/platform/libretro/include/libretro-os.h"
 #include "backends/platform/libretro/include/libretro-options-widget.h"
+#include "backends/platform/libretro/include/libretro-fs.h"
 
 void OSystem_libretro::getTimeAndDate(TimeDate &t, bool skipRecord) const {
 	uint32 curTime = (uint32)(cpu_features_get_time_usec() / 1000000);
@@ -165,8 +166,67 @@ GUI::OptionsContainerWidget *OSystem_libretro::buildBackendOptionsWidget(GUI::Gu
 
 }
 
+bool OSystem_libretro::checkPathSetting(const char *setting, Common::String const &defaultPath, bool isDirectory) {
+	Common::String setPath;
+	if (ConfMan.hasKey(setting))
+		setPath = Common::Path::fromConfig(ConfMan.get(setting)).toString();
+	if (setPath.empty() || ! (isDirectory ? (LibRetroFilesystemNode(setPath).isDirectory() && LibRetroFilesystemNode(setPath).isReadable()) : LibRetroFilesystemNode(setPath).exists()))
+		ConfMan.removeKey(setting, Common::ConfigManager::kApplicationDomain);
+	if (! ConfMan.hasKey(setting))
+		if (defaultPath.empty())
+			return false;
+		else
+			ConfMan.set(setting, defaultPath);
+	return true;
+}
+
+void OSystem_libretro::setLibretroDir(const char * path, Common::String &var) {
+	var = Common::String(path ? path : "");
+	if (! var.empty())
+		if (! (LibRetroFilesystemNode(var).isDirectory() && LibRetroFilesystemNode(var).isReadable()))
+			var.clear();
+	return;
+}
+
 void OSystem_libretro::applyBackendSettings() {
-	checkAllPathSettings();
+	/* ScummVM paths checks at startup and on settings applied */
+	Common::String s_homeDir(LibRetroFilesystemNode::getHomeDir());
+	Common::String s_themeDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_THEME_SUBDIR);
+	Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
+	Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
+
+	if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
+		s_themeDir.clear();
+	if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
+		s_extraDir.clear();
+	if (! LibRetroFilesystemNode(s_soundfontPath).exists())
+		s_soundfontPath.clear();
+	if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
+		s_homeDir = s_systemDir;
+
+	//Register default paths
+	if (! s_homeDir.empty()) {
+		ConfMan.registerDefault("browser_lastpath", s_homeDir);
+		retro_log_cb(RETRO_LOG_DEBUG, "Default browser last path set to: %s\n", s_homeDir.c_str());
+	}
+	if (! s_saveDir.empty()) {
+		ConfMan.registerDefault("savepath", s_saveDir);
+		retro_log_cb(RETRO_LOG_DEBUG, "Default save path set to: %s\n", s_saveDir.c_str());
+	}
+
+	//Check current path settings
+	if (!checkPathSetting("savepath", s_saveDir)) {
+		ConfMan.setAndFlush("savepath", s_homeDir);
+		retro_osd_notification("ScummVM save folder not found.");
+	}
+	if (!checkPathSetting("themepath", s_themeDir))
+		retro_osd_notification("ScummVM theme folder not found.");
+	if (!checkPathSetting("extrapath", s_extraDir))
+		retro_osd_notification("ScummVM extra folder not found. Some engines/features (e.g. Virtual Keyboard) will not work without relevant datafiles.");
+	checkPathSetting("soundfont", s_soundfontPath, false);
+	checkPathSetting("browser_lastpath", s_homeDir);
+	checkPathSetting("libretro_playlist_path", s_playlistDir.empty() ? s_homeDir : s_playlistDir);
+	checkPathSetting("iconspath", "");
 }
 
 static const char * const helpTabs[] = {




More information about the Scummvm-git-logs mailing list