diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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 <getopt.h> -#include <iostream> -#include <unistd.h> +#include "settings.h" #include "utils/delete2.h" #include "utils/gettext.h" @@ -49,6 +46,10 @@ #include <windows.h> #endif +#include <getopt.h> +#include <iostream> +#include <unistd.h> + #include <SDL_image.h> #include <SDL_mixer.h> #include <SDL_version.h> @@ -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(); |