From 38aea9a883ec792d49bee91bfcec5468c15eff7a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 29 May 2014 12:53:30 +0300 Subject: Move options into settings. --- src/main.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 35a5570ea..23ad034fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,10 +24,7 @@ #include "main.h" #include "client.h" - -#include -#include -#include +#include "settings.h" #include "utils/delete2.h" #include "utils/gettext.h" @@ -49,6 +46,10 @@ #include #endif +#include +#include +#include + #include #include #include @@ -141,8 +142,7 @@ static void printVersion() std::cout << strprintf("ManaPlus client %s", FULL_VERSION) << std::endl; } -static void parseOptions(const int argc, char *const argv[], - Client::Options &options) +static void parseOptions(const int argc, char *const argv[]) { const char *const optstring = "hvud:U:P:Dc:p:l:L:C:s:t:T:a"; @@ -171,6 +171,8 @@ static void parseOptions(const int argc, char *const argv[], { nullptr, 0, nullptr, 0 } }; + Options &options = settings.options; + while (optind < argc) { const int result = getopt_long(argc, argv, @@ -277,16 +279,14 @@ int main(int argc, char *argv[]) selfName = argv[0]; - // Parse command line options - Client::Options options; - parseOptions(argc, argv, options); + parseOptions(argc, argv); - if (options.printHelp) + if (settings.options.printHelp) { printHelp(); _exit(0); } - else if (options.printVersion) + else if (settings.options.printVersion) { printVersion(); _exit(0); @@ -309,9 +309,9 @@ int main(int argc, char *argv[]) SetCurrentDirectory(PhysFs::getBaseDir()); #endif setPriority(true); - client = new Client(options); + client = new Client; int ret = 0; - if (!options.testMode) + if (!settings.options.testMode) { client->gameInit(); ret = client->gameExec(); -- cgit v1.2.3-60-g2f50