summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graphicsmanager.cpp7
-rw-r--r--src/main.cpp8
-rw-r--r--src/options.h2
3 files changed, 15 insertions, 2 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 257d4233e..938c0ccf1 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -254,7 +254,12 @@ void GraphicsManager::createRenderers()
{
RenderType useOpenGL = RENDER_SOFTWARE;
if (!settings.options.noOpenGL)
- useOpenGL = intToRenderType(config.getIntValue("opengl"));
+ {
+ if (settings.options.renderer < 0)
+ useOpenGL = intToRenderType(config.getIntValue("opengl"));
+ else
+ useOpenGL = intToRenderType(settings.options.renderer);
+ }
// Setup image loading for the right image format
ImageHelper::setOpenGlMode(useOpenGL);
diff --git a/src/main.cpp b/src/main.cpp
index 23ad034fc..7fc00918f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -127,6 +127,8 @@ static void printHelp()
// TRANSLATORS: command line help
<< _(" --safemode : Start game in safe mode") << std::endl
// TRANSLATORS: command line help
+ << _(" --renderer : Set renderer type") << std::endl
+ // TRANSLATORS: command line help
<< _(" -T --tests : Start testing drivers and "
"auto configuring") << std::endl
#ifdef USE_OPENGL
@@ -144,7 +146,7 @@ static void printVersion()
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";
+ const char *const optstring = "hvud:U:P:Dc:p:l:L:C:s:t:T:a:r";
const struct option long_options[] =
{
@@ -168,6 +170,7 @@ static void parseOptions(const int argc, char *const argv[])
{ "safemode", no_argument, nullptr, 'm' },
{ "tests", no_argument, nullptr, 'T' },
{ "test", required_argument, nullptr, 't' },
+ { "renderer", required_argument, nullptr, 'r' },
{ nullptr, 0, nullptr, 0 }
};
@@ -250,6 +253,9 @@ static void parseOptions(const int argc, char *const argv[])
options.testMode = true;
options.test = std::string(optarg);
break;
+ case 'r':
+ options.renderer = static_cast<int>(atoi(optarg));
+ break;
default:
break;
}
diff --git a/src/options.h b/src/options.h
index ebd9069a8..def02200b 100644
--- a/src/options.h
+++ b/src/options.h
@@ -54,6 +54,7 @@ struct Options final
screenshotDir(),
test(),
serverName(),
+ renderer(-1),
serverPort(0),
printHelp(false),
printVersion(false),
@@ -78,6 +79,7 @@ struct Options final
std::string screenshotDir;
std::string test;
std::string serverName;
+ int renderer;
uint16_t serverPort;
bool printHelp;
bool printVersion;