[Scummvm-git-logs] scummvm master -> 10028c857c1e71b06ca8934c0053f659ab9dbf9f

sev- sev at scummvm.org
Tue Jul 27 18:36:38 UTC 2021


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

Summary:
10028c857c SYMBIAN: Can find and use game data placed by installer on any drive.


Commit: 10028c857c1e71b06ca8934c0053f659ab9dbf9f
    https://github.com/scummvm/scummvm/commit/10028c857c1e71b06ca8934c0053f659ab9dbf9f
Author: Fiodar Stryzhniou (fedor_qd at mail.ru)
Date: 2021-07-27T20:36:35+02:00

Commit Message:
SYMBIAN: Can find and use game data placed by installer on any drive.

Apply style fixes from #3170

Changed paths:
    backends/platform/symbian/src/SymbianOS.cpp


diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index 400878cf86..bed6a9a65d 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -31,7 +31,7 @@
 #include <eikenv.h> // for CEikonEnv::Static()
 
 #if (__GNUC__ && __cplusplus)
-//If a pop has no matching push, the command-line options are restored.
+// If a pop has no matching push, the command-line options are restored.
 #pragma GCC diagnostic pop
 #endif
 
@@ -57,12 +57,12 @@
 ////////// extern "C" ///////////////////////////////////////////////////
 namespace Symbian {
 
-// make this easily available everywhere
+// Make this easily available everywhere.
 char *GetExecutablePath() {
 	return CSDLApp::GetExecutablePathCStr();
 }
 
-} // namespace Symbian {
+} // namespace Symbian.
 
 ////////// OSystem_SDL_Symbian //////////////////////////////////////////
 
@@ -77,26 +77,16 @@ void OSystem_SDL_Symbian::init() {
 }
 
 void OSystem_SDL_Symbian::initBackend() {
-	// Calculate the default savepath
+	// Calculate the default savepath.
 	Common::String savePath;
 	savePath = Symbian::GetExecutablePath();
 	savePath += DEFAULT_SAVE_PATH "\\";
 	_savefileManager = new DefaultSaveFileManager(savePath);
 
-	// If savepath has not already been set then set it
+	// If savepath has not already been set then set it.
 	if (!ConfMan.hasKey("savepath")) {
 		ConfMan.set("savepath", savePath);
 	}
-	
-#if !RELEASE_BUILD
-	_LIT(KDefaultBetaExtraPath,"!:\\DATA\\ScummVM\\BETA\\");
-	RFs _RFs = FsSession();
-	_RFs.SessionPath(_localpath);
-	_RFs.SetSessionPath(KDefaultBetaExtraPath);
-	
-	Common::String extrapath;
-	ConfMan.registerDefault("extrapath", extrapath);
-#endif
 
 #if _DEBUG
 #warning "set debuglevel = 20"
@@ -104,7 +94,7 @@ void OSystem_SDL_Symbian::initBackend() {
 	if (!ConfMan.hasKey("debuglevel"))
 		printf("debuglevel not set!\n");
 #endif
-	// Ensure that the current set path (might have been altered by the user) exists
+	// Ensure that the current set path (might have been altered by the user) exists.
 	Common::String currentPath = ConfMan.get("savepath");
 	TFileName fname;
 	TPtrC8 ptr((const unsigned char*)currentPath.c_str(), currentPath.size());
@@ -112,13 +102,13 @@ void OSystem_SDL_Symbian::initBackend() {
 	BaflUtils::EnsurePathExistsL(FsSession(), fname);
 
 	ConfMan.setBool("FM_high_quality", false);
-#if !defined(S60) || defined(S60V3) // S60 has low quality as default
+#if !defined(S60) || defined(S60V3) // S60 has low quality as default.
 	ConfMan.setBool("FM_medium_quality", true);
 #else
 	ConfMan.setBool("FM_medium_quality", false);
 #endif
 	// Symbian OS  should have joystick_num set to 0 in the ini file,
-	// but uiq devices might refuse opening the joystick
+	// but uiq devices might refuse opening the joystick.
 	ConfMan.setInt("joystick_num", 0);
 	ConfMan.setBool("fullscreen", true);
 	ConfMan.flushToDisk();
@@ -126,19 +116,40 @@ void OSystem_SDL_Symbian::initBackend() {
 	if (_mixerManager == nullptr) {
 		_mixerManager = new SymbianSdlMixerManager();
 
-		// Setup and start mixer
+		// Setup and start mixer.
 		_mixerManager->init();
 	}
 
-	// Call parent implementation of this method
+	// Call parent implementation of this method.
 	OSystem_SDL::initBackend();
 }
 
 void OSystem_SDL_Symbian::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+	RFs rfs = FsSession();
+	TChar driveLetter;
+	TFileName extraPath;
+
+#if !RELEASE_BUILD
+	_LIT(KDefaultBetaExtraPath,"!:\\DATA\\ScummVM\\BETA\\");
+	extraPath = KDefaultBetaExtraPath;
+#else
+	_LIT(KDefaultExtraPath,"!:\\DATA\\ScummVM\\");
+	extraPath = KDefaultExtraPath;
 	Common::FSNode pluginsNode(Symbian::GetExecutablePath());
 	if (pluginsNode.exists() && pluginsNode.isDirectory()) {
 			s.add("SYMBIAN_DATAFOLDER", new Common::FSDirectory(Symbian::GetExecutablePath()), priority);
 		}
+#endif
+
+	for (TInt i = EDriveA; i <= EDriveZ; i++) {
+		if (rfs.DriveToChar(i, driveLetter) != KErrNone)
+			continue;
+		extraPath[0] = driveLetter;
+		if(BaflUtils::FolderExists(rfs, extraPath)){
+			TBuf8<KMaxFileName> fileName8 = extraPath.Collapse();
+			s.add("SYMBIAN_DATAFOLDER" + driveLetter, new Common::FSDirectory((char *)fileName8.PtrZ()), priority);
+		}
+	}
 }
 
 void OSystem_SDL_Symbian::quitWithErrorMsg(const char * /*aMsg*/) {
@@ -169,9 +180,9 @@ Common::KeymapperDefaultBindings *OSystem_SDL_Symbian::getKeymapperDefaultBindin
 }
 
 
-// Symbian bsearch implementation is flawed
+// Symbian bsearch implementation is flawed.
 void* scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
-	// Perform binary search
+	// Perform binary search.
 	size_t lo = 0;
 	size_t hi = nmemb;
 	while (lo < hi) {
@@ -189,7 +200,7 @@ void* scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size
 	return NULL;
 }
 
-/** Provide access to file server session. Lifetime managed bu UI framework. */
+/** Provide access to file server session. Lifetime managed by UI framework. */
 RFs &FsSession() {
 	return CEikonEnv::Static()->FsSession();
 }




More information about the Scummvm-git-logs mailing list