diff --git a/Client/core/CClientVariables.cpp b/Client/core/CClientVariables.cpp index 0b77fbdaf5b..f3478cfb944 100644 --- a/Client/core/CClientVariables.cpp +++ b/Client/core/CClientVariables.cpp @@ -357,7 +357,7 @@ void CClientVariables::LoadDefaults() DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function) - DEFAULT("process_cpu_affinity", false); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games + DEFAULT("process_cpu_affinity", true); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games if (!Exists("locale")) { diff --git a/Client/core/CCore.cpp b/Client/core/CCore.cpp index 920c44d9cac..5e4b17c07a9 100644 --- a/Client/core/CCore.cpp +++ b/Client/core/CCore.cpp @@ -1770,7 +1770,7 @@ void CCore::OnPostColorFilterRender() void CCore::ApplyCoreInitSettings() { #if (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) - const auto aware = CVARS_GET_VALUE("process_dpi_aware"); + bool aware = CVARS_GET_VALUE("process_dpi_aware"); // The minimum supported client for the function below is Windows Vista (Longhorn). // For more information, refer to the Microsoft Learn article: @@ -1779,13 +1779,13 @@ void CCore::ApplyCoreInitSettings() SetProcessDPIAware(); #endif - const auto revision = GetApplicationSettingInt("reset-settings-revision"); + int revision = GetApplicationSettingInt("reset-settings-revision"); // Users with the default skin will be switched to the 2023 version by replacing "Default" with "Default 2023". // The "Default 2023" GUI skin was introduced in commit 2d9e03324b07e355031ecb3263477477f1a91399. if (revision < 21486) { - const auto skin = CVARS_GET_VALUE("current_skin"); + auto skin = CVARS_GET_VALUE("current_skin"); if (skin == "Default") CVARS_SET("current_skin", "Default 2023"); @@ -1793,25 +1793,21 @@ void CCore::ApplyCoreInitSettings() SetApplicationSettingInt("reset-settings-revision", 21486); } - const auto process = GetCurrentProcess(); - const int priorities[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS}; - const auto priority = CVARS_GET_VALUE("process_priority") % 3; + HANDLE process = GetCurrentProcess(); + const int priorities[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS}; + int priority = CVARS_GET_VALUE("process_priority") % 3; SetPriorityClass(process, priorities[priority]); - const auto affinity = CVARS_GET_VALUE("process_cpu_affinity"); - + bool affinity = CVARS_GET_VALUE("process_cpu_affinity"); if (!affinity) return; DWORD_PTR mask; DWORD_PTR sys; - const auto result = GetProcessAffinityMask(process, &mask, &sys); - - if (!result) - return; - - SetProcessAffinityMask(process, mask & ~1); + BOOL result = GetProcessAffinityMask(process, &mask, &sys); + if (result) + SetProcessAffinityMask(process, mask & ~1); } // diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index bab74ba4312..e2351fdaa70 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -3245,13 +3245,11 @@ void CSettings::LoadData() DWORD_PTR mask; DWORD_PTR sys; - const auto process = GetCurrentProcess(); - const auto result = GetProcessAffinityMask(process, &mask, &sys); + HANDLE process = GetCurrentProcess(); + BOOL result = GetProcessAffinityMask(process, &mask, &sys); if (bVar && result) - { SetProcessAffinityMask(process, mask & ~1); - } else { SYSTEM_INFO info; @@ -3657,19 +3655,17 @@ void CSettings::SaveData() CScreenShot::SetPhotoSavingInsideDocuments(photoSaving); // Process CPU Affinity - const auto affinity = m_pProcessAffinityCheckbox->GetSelected(); + bool affinity = m_pProcessAffinityCheckbox->GetSelected(); CVARS_SET("process_cpu_affinity", affinity); DWORD_PTR mask; DWORD_PTR sys; - const auto process = GetCurrentProcess(); - const auto result = GetProcessAffinityMask(process, &mask, &sys); + HANDLE process = GetCurrentProcess(); + BOOL result = GetProcessAffinityMask(process, &mask, &sys); if (affinity && result) - { SetProcessAffinityMask(process, mask & ~1); - } else { SYSTEM_INFO info; @@ -4785,9 +4781,7 @@ bool CSettings::OnAffinityClick(CGUIElement* pElement) shownWarning = true; std::string message = std::string( - _("Enabling this setting may improve game performance, but on some processors, it may worsen it.\n" - "We have observed issues with AMD Ryzen processors featuring 3D V-Cache.\n" - "The exact list of affected processors is unknown.\n" + _("This option should only be changed if you experience performance issues.\n" "\nAre you sure you want to enable this option?")); CQuestionBox* pQuestionBox = CCore::GetSingleton().GetLocalGUI()->GetMainMenu()->GetQuestionWindow(); @@ -4967,7 +4961,7 @@ bool CSettings::OnShowAdvancedSettingDescription(CGUIElement* pElement) else if (pCheckBox && pCheckBox == m_pWin8MouseCheckBox) strText = std::string(_("Mouse fix:")) + " " + std::string(_("Mouse movement fix - May need PC restart")); else if (pCheckBox && pCheckBox == m_pProcessAffinityCheckbox) - strText = std::string(_("CPU affinity:")) + " " + std::string(_("Experimental feature - It may improve performance or worsen it.")); + strText = std::string(_("CPU affinity:")) + " " + std::string(_("Experimental feature - Change only if you experience performance issues")); if (strText != "") m_pAdvancedSettingDescriptionLabel->SetText(strText.c_str());