Fix certain CLI options not overriding GUI preferences. Fixes #435

This commit is contained in:
Cameron Gutman 2020-08-30 01:38:26 -07:00
parent a8be299bbd
commit 14ccc38f4c

View file

@ -941,8 +941,6 @@ private:
// Called in a non-main thread
bool Session::startConnectionAsync()
{
StreamingPreferences prefs;
// Wait 1.5 seconds before connecting to let the user
// have time to read any messages present on the segue
SDL_Delay(1500);
@ -962,7 +960,7 @@ bool Session::startConnectionAsync()
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Found host supported resolution: %dx%d",
mode.width, mode.height);
enableGameOptimizations = prefs.gameOptimizations;
enableGameOptimizations = m_Preferences->gameOptimizations;
break;
}
}
@ -975,7 +973,7 @@ bool Session::startConnectionAsync()
else {
http.launchApp(m_App.id, &m_StreamConfig,
enableGameOptimizations,
prefs.playAudioOnHost,
m_Preferences->playAudioOnHost,
m_InputHandler->getAttachedGamepadMask());
}
} catch (const GfeHttpResponseException& e) {
@ -1064,8 +1062,7 @@ void Session::exec(int displayOriginX, int displayOriginY)
// Initialize the gamepad code with our preferences
// NB: m_InputHandler must be initialize before starting the connection.
StreamingPreferences prefs;
m_InputHandler = new SdlInputHandler(prefs, m_Computer,
m_InputHandler = new SdlInputHandler(*m_Preferences, m_Computer,
m_StreamConfig.width,
m_StreamConfig.height);
@ -1200,7 +1197,7 @@ void Session::exec(int displayOriginX, int displayOriginY)
m_UnexpectedTermination = false;
// Start rich presence to indicate we're in game
RichPresenceManager presence(prefs, m_App.name);
RichPresenceManager presence(*m_Preferences, m_App.name);
// Hijack this thread to be the SDL main thread. We have to do this
// because we want to suspend all Qt processing until the stream is over.