summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/CommandLineParse.cpp
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-11-08 11:00:18 +1000
committerGitHub <noreply@github.com>2019-11-08 11:00:18 +1000
commit47677ecaa705cb0f87d9f08fe455e445ccf98989 (patch)
treed0f77568be291ee68c2764daa459afd2a6b3aebb /Source/Core/UICommon/CommandLineParse.cpp
parent9db1ce8ef9e67abb58b61634c88d6abd548d2177 (diff)
parent379f264aa8b7dce66f68cf38bfafa57616f3804e (diff)
Merge pull request #8437 from JosJuice/batch-render-to-main
Disable render to main when using batch mode
Diffstat (limited to 'Source/Core/UICommon/CommandLineParse.cpp')
-rw-r--r--Source/Core/UICommon/CommandLineParse.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/Core/UICommon/CommandLineParse.cpp b/Source/Core/UICommon/CommandLineParse.cpp
index 5a12d62997..bf3a556a29 100644
--- a/Source/Core/UICommon/CommandLineParse.cpp
+++ b/Source/Core/UICommon/CommandLineParse.cpp
@@ -22,7 +22,7 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
{
public:
CommandLineConfigLayerLoader(const std::list<std::string>& args, const std::string& video_backend,
- const std::string& audio_backend)
+ const std::string& audio_backend, bool batch)
: ConfigLayerLoader(Config::LayerType::CommandLine)
{
if (!video_backend.empty())
@@ -31,6 +31,11 @@ public:
if (!audio_backend.empty())
m_values.emplace_back(Config::MAIN_DSP_HLE.location, ValueToString(audio_backend == "HLE"));
+ // Batch mode hides the main window, and render to main hides the render window. To avoid a
+ // situation where we would have no window at all, disable render to main when using batch mode.
+ if (batch)
+ m_values.emplace_back(Config::MAIN_RENDER_TO_MAIN.location, ValueToString(false));
+
// Arguments are in the format of <System>.<Section>.<Key>=Value
for (const auto& arg : args)
{
@@ -98,7 +103,7 @@ std::unique_ptr<optparse::OptionParser> CreateParser(ParserOptions options)
parser->add_option("-l", "--logger").action("store_true").help("Open the logger");
parser->add_option("-b", "--batch")
.action("store_true")
- .help("Run Dolphin without the user interface (Requires --exec)");
+ .help("Run Dolphin without the user interface (Requires --exec or --nand-title)");
parser->add_option("-c", "--confirm").action("store_true").help("Set Confirm on Stop");
}
@@ -114,13 +119,14 @@ std::unique_ptr<optparse::OptionParser> CreateParser(ParserOptions options)
static void AddConfigLayer(const optparse::Values& options)
{
+ std::list<std::string> config_args;
if (options.is_set_by_user("config"))
- {
- const std::list<std::string>& config_args = options.all("config");
- Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
- config_args, static_cast<const char*>(options.get("video_backend")),
- static_cast<const char*>(options.get("audio_emulation"))));
- }
+ config_args = options.all("config");
+
+ Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
+ std::move(config_args), static_cast<const char*>(options.get("video_backend")),
+ static_cast<const char*>(options.get("audio_emulation")),
+ static_cast<bool>(options.get("batch"))));
}
optparse::Values& ParseArguments(optparse::OptionParser* parser, int argc, char** argv)