[Scummvm-cvs-logs] SF.net SVN: scummvm:[33187] residual/trunk/engine/backend/saves/default/ default-saves.cpp

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Tue Jul 22 07:51:11 CEST 2008


Revision: 33187
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33187&view=rev
Author:   aquadran
Date:     2008-07-22 05:51:10 +0000 (Tue, 22 Jul 2008)

Log Message:
-----------
added default path saves

Modified Paths:
--------------
    residual/trunk/engine/backend/saves/default/default-saves.cpp

Modified: residual/trunk/engine/backend/saves/default/default-saves.cpp
===================================================================
--- residual/trunk/engine/backend/saves/default/default-saves.cpp	2008-07-22 05:48:02 UTC (rev 33186)
+++ residual/trunk/engine/backend/saves/default/default-saves.cpp	2008-07-22 05:51:10 UTC (rev 33187)
@@ -262,6 +262,14 @@
 	}
 }
 
+#ifdef UNIX
+#ifdef MACOSX
+#define DEFAULT_SAVE_PATH "Documents/Residual Savegames"
+#else
+#define DEFAULT_SAVE_PATH ".residual"
+#endif
+#endif
+
 Common::String DefaultSaveFileManager::getSavePath() const {
 
 	Common::String dir;
@@ -282,6 +290,17 @@
 		dir = ConfMan.get("path");
 #endif
 */
+#ifdef DEFAULT_SAVE_PATH
+	char savePath[MAXPATHLEN];
+#if defined(UNIX)
+	const char *home = getenv("HOME");
+	if (home && *home && strlen(home) < MAXPATHLEN) {
+		snprintf(savePath, MAXPATHLEN, "%s/%s", home, DEFAULT_SAVE_PATH);
+		dir = savePath;
+	}
+#endif
+#endif
+
 	return dir;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list