Call the new command line parser from all backends

This commit is contained in:
Henrik Rydgård
2026-07-20 12:02:07 +02:00
parent acc0a19786
commit a59637975a
9 changed files with 173 additions and 82 deletions
+5 -1
View File
@@ -90,6 +90,7 @@
#include "Common/Thread/ThreadManager.h"
#include "Common/Audio/AudioBackend.h"
#include "Common/UI/PopupScreens.h"
#include "Core/CmdLine.h"
#include "Core/ControlMapper.h"
#include "Core/Config.h"
#include "Core/ConfigValues.h"
@@ -393,7 +394,7 @@ static void ClearFailedGPUBackends() {
File::Delete(failedBackendsFile);
}
void NativeInit(int argc, const char *argv[], const char *savegame_dir, const char *external_dir, const char *cache_dir) {
void NativeInit(int argc, const char *argv[], const CommandLineOptions &cmdLineOptions, const char *savegame_dir, const char *external_dir, const char *cache_dir) {
net::Init(); // This needs to happen before we load the config. So on Windows we also run it in Main. It's fine to call multiple times.
g_Config.Init();
@@ -582,6 +583,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
System_Notify(SystemNotification::CONFIG_LOADED);
#endif
// Apply parsed command line options to config.
cmdLineOptions.ApplyToConfig();
const char *fileToLog = nullptr;
Path stateToLoad;