Oops, forgot this physfslayer
authorunc0rr
Sun, 21 Oct 2012 00:32:32 +0400
branchphysfslayer
changeset 7772 a33077239712
parent 7770 ff3442338882
child 7774 27f9b9362f47
Oops, forgot this
QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Sun Oct 21 00:31:48 2012 +0400
+++ b/QTfrontend/main.cpp	Sun Oct 21 00:32:32 2012 +0400
@@ -31,7 +31,6 @@
 #include "hwform.h"
 #include "hwconsts.h"
 #include "newnetclient.h"
-#include "physfs.h"
 
 #include "DataManager.h"
 #include "FileEngine.h"
@@ -106,9 +105,7 @@
 {
     HWApplication app(argc, argv);
 
-    PHYSFS_init(argv[0]);
-
-    FileEngineHandler engine;
+    FileEngineHandler engine(argv[0]);
 
     app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
 
@@ -151,7 +148,7 @@
         custom_config = true;
     }
 
-    app.setStyle(new QPlastiqueStyle);
+    app.setStyle(new QPlastiqueStyle());
 
     QDateTime now = QDateTime::currentDateTime();
     srand(now.toTime_t());
@@ -218,11 +215,15 @@
         return 1;
     }
 
+    engine.mount(datadir->absolutePath());
+    engine.mount(cfgdir->absolutePath() + "/Data");
+    engine.setWriteDir(cfgdir->absolutePath());
+
     DataManager & dataMgr = DataManager::instance();
 
     QTranslator Translator;
     {
-        QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
+        QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat);
         QString cc = settings.value("misc/locale", QString()).toString();
         if(cc.isEmpty())
             cc = QLocale::system().name();
@@ -230,7 +231,7 @@
         // load locale file into translator
         Translator.load(
             dataMgr.findFileForRead(
-                QString("Locale/hedgewars_" + cc)
+                QString("physfs://Locale/hedgewars_" + cc)
             )
         );
         app.installTranslator(&Translator);