]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Settings.cpp
First step towards using clean methods and correct paths for datas and config
[lugaru.git] / Source / Settings.cpp
index 8258becbd1ad9c365433c91e43c39f7f02ded447..609b9fdd8b0b0233bc1cf15adaca31577e446ff6 100644 (file)
@@ -21,6 +21,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Settings.h"
 #include "Game.h"
 #include "Input.h"
+#include "Utils/Folders.h"
 
 using namespace Game;
 
@@ -79,7 +80,7 @@ void SaveSettings()
         newscreenheight = screenheight;
     if (newscreenheight < 0)
         newscreenheight = screenheight;
-    ofstream opstream(ConvertFileName(":Data:config.txt", "w"));
+    ofstream opstream(Folders::getConfigFilePath());
     opstream << "Screenwidth:\n";
     opstream << newscreenwidth;
     opstream << "\nScreenheight:\n";
@@ -167,7 +168,7 @@ void SaveSettings()
 
 bool LoadSettings()
 {
-    ifstream ipstream(ConvertFileName(":Data:config.txt"), std::ios::in);
+    ifstream ipstream(Folders::getConfigFilePath(), std::ios::in);
     if ( !ipstream || ipstream.fail() ) {
         printf("Config file not found\n");
         return false;