From a1be2963ce681e67a007ae2a93d085d243955936 Mon Sep 17 00:00:00 2001 From: redstrate Date: Tue, 2 Nov 2021 08:49:06 -0400 Subject: [PATCH] Add DirectX version option --- src/settingswindow.cpp | 12 ++++++++++++ src/xivlauncher.cpp | 7 ++++++- src/xivlauncher.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 9517467..6e663a3 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "xivlauncher.h" @@ -19,6 +20,17 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window auto layout = new QFormLayout(this); setLayout(layout); + auto directXCombo = new QComboBox(); + directXCombo->setCurrentIndex(window.settings.value("directx", 0).toInt()); + directXCombo->addItem("DirectX 11"); + directXCombo->addItem("DirectX 9"); + layout->addRow("DirectX Version", directXCombo); + + connect(directXCombo, &QComboBox::currentIndexChanged, [=](int index) { + this->window.settings.setValue("directx", directXCombo->currentIndex()); + this->window.useDX9 = directXCombo->currentIndex() == 1; + }); + #if defined(Q_OS_LINUX) auto wineBox = new QGroupBox("Wine Options"); auto wineBoxLayout = new QFormLayout(); diff --git a/src/xivlauncher.cpp b/src/xivlauncher.cpp index 0e3b6be..6935d5a 100755 --- a/src/xivlauncher.cpp +++ b/src/xivlauncher.cpp @@ -43,7 +43,12 @@ void LauncherWindow::launchGame(const LoginAuth auth) { QList arguments; // now for the actual game... - arguments.push_back(gamePath + "\\game\\ffxiv_dx11.exe"); + if(useDX9) { + arguments.push_back(gamePath + "\\game\\ffxiv.exe"); + } else { + arguments.push_back(gamePath + "\\game\\ffxiv_dx11.exe"); + } + arguments.push_back("DEV.DataPathType=1"); arguments.push_back("DEV.UseSqPack=1"); diff --git a/src/xivlauncher.h b/src/xivlauncher.h index f20def4..9e5fe21 100755 --- a/src/xivlauncher.h +++ b/src/xivlauncher.h @@ -36,6 +36,7 @@ public: QString bootVersion, gameVersion; bool useEsync, useGamescope, useGamemode; + bool useDX9 = false; void launchGame(const LoginAuth auth); void launchExecutable(const QStringList args);