summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-29 12:53:30 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-29 12:56:42 +0300
commit38aea9a883ec792d49bee91bfcec5468c15eff7a (patch)
treeb3315bd1bb7d673ec55be1ed77594ba4a895540e /src/main.cpp
parent5f048b85f826a85278545ac363d7058793fb3ece (diff)
downloadplus-38aea9a883ec792d49bee91bfcec5468c15eff7a.tar.gz
plus-38aea9a883ec792d49bee91bfcec5468c15eff7a.tar.bz2
plus-38aea9a883ec792d49bee91bfcec5468c15eff7a.tar.xz
plus-38aea9a883ec792d49bee91bfcec5468c15eff7a.zip
Move options into settings.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
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();