]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Load configuration before parsing command line options.
authorGuus Sliepen <guus@debian.org>
Thu, 6 Aug 2015 15:19:21 +0000 (17:19 +0200)
committerGuus Sliepen <guus@debian.org>
Thu, 6 Aug 2015 15:19:21 +0000 (17:19 +0200)
Before, if there was a valid configuration file, then some command line
options did not have any effect.

src/init.cpp
src/main.cpp
src/main.h

index 10e7aeb4bef92c2b30c1bcfe57e85dae0c66aa5f..fd6ec71654f1a59c769f72b2aa749400efdddd78 100644 (file)
@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "init.h"
 
+static bool displayLicense;
+
 void checkForLicense()
 {
        if (!engine.loadData(_("data/license")))
@@ -252,18 +254,21 @@ int initMedalService(void *data)
        return 1;
 }
 
+void initConfig()
+{
+       #if UNIX
+       setupUserHomeDirectory();
+       #endif
+
+       displayLicense = loadConfig();
+}
+
 /*
 Chugg chugg chugg.... brrr... chugg chugg chugg...brrrrrr... chugg ch..
 BRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMM!! Well, hopefully anyway! ;)
 */
 void initSystem()
 {
-       #if UNIX
-       setupUserHomeDirectory();
-       #endif
-
-       bool displayLicense = loadConfig();
-       
        long flags = SDL_INIT_VIDEO|SDL_INIT_JOYSTICK;
                        
        if (engine.useAudio)
index 951725af133c0deea9cef340cdff6f1f3f606ac6..e3844bbeee91e230e0659e707fe3146ff8571ccd 100644 (file)
@@ -127,6 +127,8 @@ int main(int argc, char *argv[])
        int recordMode = REPLAY_MODE::NONE;
        int requiredSection = SECTION_INTRO;
 
+       initConfig();
+
        for (int i = 1 ; i < argc ; i++)
        {
                if (strcmp(argv[i], "-fullscreen") == 0) engine.fullScreen = true;
index 67c7e08e0f9f80d2f514f936ac1cfcf6979b9cb6..bf2bf22317fc85b257e978e50d5becb336eb95cd 100644 (file)
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "headers.h"
 
+extern void initConfig();
 extern void initSystem();
 extern void cleanup();