1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00

Fix the game not launching properly

This commit is contained in:
Joshua Goins 2022-02-25 22:25:39 -05:00
parent 7a08eb549f
commit b51977e9d9

View file

@ -188,6 +188,15 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, const QStrin
void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
QList<QString> arguments;
arguments.append(args);
launchExecutable(profile, process, arguments);
}
void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
QList<QString> arguments;
auto env = process->processEnvironment();
#if defined(Q_OS_LINUX)
if(profile.useGamescope) {
arguments.push_back("gamescope");
@ -198,13 +207,13 @@ void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess
if(profile.gamescope.borderless)
arguments.push_back("-b");
if(profile.gamescope.width >= 0)
if(profile.gamescope.width > 0)
arguments.push_back("-w " + QString::number(profile.gamescope.width));
if(profile.gamescope.height >= 0)
if(profile.gamescope.height > 0)
arguments.push_back("-h " + QString::number(profile.gamescope.height));
if(profile.gamescope.refreshRate >= 0)
if(profile.gamescope.refreshRate > 0)
arguments.push_back("-r " + QString::number(profile.gamescope.refreshRate));
}
@ -212,15 +221,6 @@ void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess
arguments.push_back("gamemoderun");
#endif
arguments.append(args);
launchExecutable(profile, process, args);
}
void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
QList<QString> arguments;
auto env = process->processEnvironment();
#if defined(Q_OS_LINUX)
if(profile.useEsync) {
env.insert("WINEESYNC", QString::number(1));