diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-26 11:45:12 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-26 11:58:29 -0600 |
commit | 91d07ce9e2de34e1cf59a2439adc075849694538 (patch) | |
tree | 87942e421376ee6a605c16766870266f57791f7f /src/main.cpp | |
parent | c85b7fd4bf6480495c6f28d10031d3b53988e1d6 (diff) | |
download | mana-91d07ce9e2de34e1cf59a2439adc075849694538.tar.gz mana-91d07ce9e2de34e1cf59a2439adc075849694538.tar.bz2 mana-91d07ce9e2de34e1cf59a2439adc075849694538.tar.xz mana-91d07ce9e2de34e1cf59a2439adc075849694538.zip |
Add a command line option to disable OpenGL
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 14baffbd..a9e455db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -216,6 +216,8 @@ struct Options std::string serverName; short serverPort; + + bool noOpenGL; }; /** @@ -457,7 +459,7 @@ static void initEngine(const Options &options) #endif #ifdef USE_OPENGL - bool useOpenGL = (config.getValue("opengl", 0) == 1); + bool useOpenGL = !options.noOpenGL && (config.getValue("opengl", 0) == 1); // Setup image loading for the right image format Image::setLoadAsOpenGL(useOpenGL); @@ -575,6 +577,7 @@ static void printHelp() << _(" -s --server : Login Server name or IP") << std::endl << _(" -u --skipupdate : Skip the update downloads") << std::endl << _(" -U --username : Login with this username") << std::endl + << _(" -O --noopengl : Disable OpenGL for this sesion") << std::endl << _(" -v --version : Display the version") << std::endl; } @@ -585,7 +588,7 @@ static void printVersion() static void parseOptions(int argc, char *argv[], Options &options) { - const char *optstring = "hvud:U:P:Dc:s:o:C:H:S:"; + const char *optstring = "hvud:U:P:Dc:s:o:C:H:S:O"; const struct option long_options[] = { { "configfile", required_argument, 0, 'C' }, @@ -600,6 +603,7 @@ static void parseOptions(int argc, char *argv[], Options &options) { "server", required_argument, 0, 's' }, { "skipupdate", no_argument, 0, 'u' }, { "username", required_argument, 0, 'U' }, + { "noopengl", no_argument, 0, 'O' }, { "version", no_argument, 0, 'v' }, { 0 } }; @@ -654,6 +658,9 @@ static void parseOptions(int argc, char *argv[], Options &options) case 'S': homeDir = optarg; break; + case 'O': + options.noOpenGL = true; + break; } } } |