mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-23 12:57:45 +00:00
Add a bunch of Wine performance options to settings
This commit is contained in:
parent
f8566a5669
commit
95abfb472d
3 changed files with 86 additions and 36 deletions
|
@ -5,6 +5,8 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QLabel>
|
||||
#include <QFileDialog>
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
|
||||
#include "xivlauncher.h"
|
||||
|
||||
|
@ -15,6 +17,57 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
|
|||
auto layout = new QFormLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
auto wineBox = new QGroupBox("Wine Options");
|
||||
auto wineBoxLayout = new QFormLayout();
|
||||
wineBox->setLayout(wineBoxLayout);
|
||||
|
||||
auto infoLabel = new QLabel("This is a list of possible enhancements you can make to your Wine gaming experience.\n"
|
||||
"This is all stuff you can do outside of the launcher, but we can take care of it for you.");
|
||||
wineBoxLayout->addWidget(infoLabel);
|
||||
|
||||
auto useEsync = new QCheckBox("Use Esync");
|
||||
useEsync->setChecked(window.settings.value("useEsync", false).toBool());
|
||||
wineBoxLayout->addWidget(useEsync);
|
||||
|
||||
auto esyncLabel = new QLabel("Improves general game performance, but requires a Wine built with the Esync patches.\n"
|
||||
"If you use the latest Wine staging, it should work.");
|
||||
wineBoxLayout->addWidget(esyncLabel);
|
||||
|
||||
connect(useEsync, &QCheckBox::stateChanged, [this](int state) {
|
||||
this->window.useEsync = state;
|
||||
this->window.settings.setValue("useEsync", static_cast<bool>(state));
|
||||
});
|
||||
|
||||
auto useGamescope = new QCheckBox("Use Gamescope");
|
||||
useGamescope->setChecked(window.settings.value("useGamescope", false).toBool());
|
||||
wineBoxLayout->addWidget( useGamescope);
|
||||
|
||||
auto gamescopeLabel = new QLabel("Use the SteamOS compositor that uses Wayland.\n"
|
||||
"If you are experiencing input issues on XWayland, try this option if you have it installed.");
|
||||
wineBoxLayout->addWidget(gamescopeLabel);
|
||||
|
||||
connect(useGamescope, &QCheckBox::stateChanged, [this](int state) {
|
||||
this->window.useGamescope = state;
|
||||
this->window.settings.setValue("useGamescope", static_cast<bool>(state));
|
||||
});
|
||||
|
||||
auto useGamemode = new QCheckBox("Use Gamemode");
|
||||
useGamemode->setChecked(window.settings.value("useGamemode", false).toBool());
|
||||
wineBoxLayout->addWidget(useGamemode);
|
||||
|
||||
auto gamemodeLabel = new QLabel("Use Feral Interactive's GameMode, which applies a couple of performance enhancements.\n"
|
||||
"May give a slight performance boost, but requires GameMode to be installed.\n");
|
||||
wineBoxLayout->addWidget(gamemodeLabel);
|
||||
|
||||
connect(useGamemode, &QCheckBox::stateChanged, [this](int state) {
|
||||
this->window.useGamemode = state;
|
||||
this->window.settings.setValue("useGamemode", static_cast<bool>(state));
|
||||
});
|
||||
|
||||
layout->addRow(wineBox);
|
||||
#endif
|
||||
|
||||
auto currentGameDirectory = new QLabel(window.gamePath);
|
||||
layout->addRow("Game Directory", currentGameDirectory);
|
||||
|
||||
|
|
|
@ -42,42 +42,42 @@ void LauncherWindow::buildRequest(QNetworkRequest& request) {
|
|||
void LauncherWindow::launch(const LoginAuth auth) {
|
||||
auto process = new QProcess(this);
|
||||
process->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
process->setWorkingDirectory(gamePath + "/game/");
|
||||
|
||||
bool isWine = false;
|
||||
QString winePath;
|
||||
QString ffxivPath;
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
ffxivPath = gamePath + "\\game\\ffxiv_dx11.exe";
|
||||
#endif
|
||||
QList<QString> arguments;
|
||||
|
||||
// for platforms using wine, set wine before ffxiv_dx11.exe
|
||||
// TODO: make wine path configurable
|
||||
#if defined(Q_OS_MACOS)
|
||||
isWine = true;
|
||||
// TODO: this is assuming FFXIV is installed in /Applications
|
||||
winePath = "/Applications/FINAL FANTASY XIV ONLINE.app/Contents/SharedSupport/finalfantasyxiv/FINAL FANTASY XIV ONLINE/wine";
|
||||
ffxivPath = QDir::homePath() + "/Library/Application Support/FINAL FANTASY XIV ONLINE/Bottles/published_Final_Fantasy/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn/game/ffxiv_dx11.exe";
|
||||
arguments.push_back("/Applications/FINAL FANTASY XIV ONLINE.app/Contents/SharedSupport/finalfantasyxiv/FINAL FANTASY XIV ONLINE/wine");
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
isWine = true;
|
||||
// TODO: this is assuming you want to use the wine in your PATH, which isn't always the case
|
||||
winePath = "wine";
|
||||
|
||||
// TODO: this is assuming it's in your default WINEPREFIX
|
||||
ffxivPath = gamePath + "/game/ffxiv_dx11.exe";
|
||||
process->setWorkingDirectory(gamePath + "/game/");
|
||||
#endif
|
||||
|
||||
QList<QString> arguments;
|
||||
if (isWine) {
|
||||
arguments.push_back(ffxivPath);
|
||||
if(useGamescope) {
|
||||
arguments.push_back("gamescope");
|
||||
arguments.push_back("-f");
|
||||
arguments.push_back("-b");
|
||||
}
|
||||
|
||||
// i wonder what these mean...
|
||||
if(useGamemode)
|
||||
arguments.push_back("gamemoderun");
|
||||
|
||||
arguments.push_back("wine");
|
||||
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << "DXVK_HUD=full";
|
||||
|
||||
if(useEsync) {
|
||||
env << "WINEESYNC=1";
|
||||
}
|
||||
|
||||
process->setEnvironment(env);
|
||||
#endif
|
||||
|
||||
// now for the actual game...
|
||||
arguments.push_back(gamePath + "\\game\\ffxiv_dx11.exe");
|
||||
arguments.push_back("DEV.DataPathType=1");
|
||||
arguments.push_back("DEV.UseSqPack=1");
|
||||
// by the way, it looks like setting graphics options is possible via these too, i wonder what
|
||||
// else is hiding :-)))
|
||||
|
||||
arguments.push_back(QString("DEV.MaxEntitledExpansionID=%1").arg(auth.maxExpansion));
|
||||
arguments.push_back(QString("DEV.TestSID=%1").arg(auth.SID));
|
||||
|
@ -91,14 +91,9 @@ void LauncherWindow::launch(const LoginAuth auth) {
|
|||
arguments.push_back(QString("DEV.LobbyHost0%1=%2 DEV.LobbyPort0%1=54994").arg(QString::number(i), auth.lobbyhost));
|
||||
}
|
||||
|
||||
if (isWine) {
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
//env << "DXVK_FILTER_DEVICE_NAME=AMD";
|
||||
process->setEnvironment(env);
|
||||
process->start(winePath, arguments);
|
||||
} else {
|
||||
process->start(ffxivPath, arguments);
|
||||
}
|
||||
auto executable = arguments[0];
|
||||
arguments.removeFirst();
|
||||
process->start(executable, arguments);
|
||||
}
|
||||
|
||||
QString LauncherWindow::readVersion(QString path) {
|
||||
|
|
|
@ -35,17 +35,19 @@ public:
|
|||
QString gamePath;
|
||||
QString bootVersion, gameVersion;
|
||||
|
||||
bool useEsync, useGamescope, useGamemode;
|
||||
|
||||
void launch(const LoginAuth auth);
|
||||
void buildRequest(QNetworkRequest& request);
|
||||
void setSSL(QNetworkRequest& request);
|
||||
QString readVersion(QString path);
|
||||
|
||||
QSettings settings;
|
||||
|
||||
private:
|
||||
void readInitialInformation();
|
||||
|
||||
SapphireLauncher* sapphireLauncher;
|
||||
SquareBoot* squareBoot;
|
||||
SquareLauncher* squareLauncher;
|
||||
|
||||
QSettings settings;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue