Skip to content

Commit 3992956

Browse files
committed
Revert "Add CPU affinity setting & fix process related settings (#4096)"
This reverts commit 77b8998.
1 parent c451c3f commit 3992956

File tree

4 files changed

+0
-51
lines changed

4 files changed

+0
-51
lines changed

Client/core/CClientVariables.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ void CClientVariables::LoadDefaults()
357357
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
358358
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
359359
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
360-
DEFAULT("process_cpu_affinity", true); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games
361360

362361
if (!Exists("locale"))
363362
{

Client/core/CCore.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,17 +1795,6 @@ void CCore::ApplyCoreInitSettings()
17951795

17961796
SetApplicationSettingInt("reset-settings-revision", 21486);
17971797
}
1798-
1799-
// Set process settings
1800-
HANDLE currProc = GetCurrentProcess();
1801-
1802-
// Process priority
1803-
int PriorityClassList[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS};
1804-
SetPriorityClass(currProc, PriorityClassList[CVARS_GET_VALUE<int>("process_priority") % 3]);
1805-
1806-
// Process CPU affinity
1807-
if (CVARS_GET_VALUE<bool>("process_cpu_affinity"))
1808-
SetProcessAffinityMask(currProc, 1 << 0);
18091798
}
18101799

18111800
//

Client/core/CSettings.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,12 +1207,6 @@ void CSettings::CreateGUI()
12071207
m_pPhotoSavingCheckbox->AutoSize(NULL, 20.0f);
12081208
vecTemp.fY += fLineHeight;
12091209

1210-
// Process affinity
1211-
m_pProcessAffinityCheckbox = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAdvanced, _("Set CPU 0 affinity to improve game performance"), true));
1212-
m_pProcessAffinityCheckbox->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
1213-
m_pProcessAffinityCheckbox->AutoSize(nullptr, 20.0f);
1214-
vecTemp.fY += fLineHeight;
1215-
12161210
// Auto updater section label
12171211
m_pAdvancedUpdaterLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Auto updater")));
12181212
m_pAdvancedUpdaterLabel->SetPosition(CVector2D(vecTemp.fX - 10.0f, vecTemp.fY));
@@ -3234,22 +3228,6 @@ void CSettings::LoadData()
32343228
CVARS_GET("photosaving", bVar);
32353229
m_pPhotoSavingCheckbox->SetSelected(bVar);
32363230

3237-
// Process CPU Affinity
3238-
CVARS_GET("process_cpu_affinity", bVar);
3239-
m_pProcessAffinityCheckbox->SetSelected(bVar);
3240-
3241-
DWORD_PTR affinityMask = 0;
3242-
if (bVar)
3243-
affinityMask = 1 << 0; // CPU 0 only
3244-
else
3245-
{
3246-
SYSTEM_INFO sysInfo;
3247-
GetSystemInfo(&sysInfo);
3248-
3249-
affinityMask = (1 << sysInfo.dwNumberOfProcessors) - 1; // All cores (default)
3250-
}
3251-
SetProcessAffinityMask(GetCurrentProcess(), affinityMask);
3252-
32533231
// Update build type
32543232
CVARS_GET("update_build_type", iVar);
32553233
if (iVar == 0 || iVar == 1)
@@ -3646,22 +3624,6 @@ void CSettings::SaveData()
36463624
CVARS_SET("photosaving", photoSaving);
36473625
CScreenShot::SetPhotoSavingInsideDocuments(photoSaving);
36483626

3649-
// Process CPU Affinity
3650-
bool cpuAffinity = m_pProcessAffinityCheckbox->GetSelected();
3651-
CVARS_SET("process_cpu_affinity", cpuAffinity);
3652-
3653-
DWORD_PTR affinityMask = 0;
3654-
if (cpuAffinity)
3655-
affinityMask = 1 << 0; // CPU 0 only
3656-
else
3657-
{
3658-
SYSTEM_INFO sysInfo;
3659-
GetSystemInfo(&sysInfo);
3660-
3661-
affinityMask = (1 << sysInfo.dwNumberOfProcessors) - 1; // All cores (default)
3662-
}
3663-
SetProcessAffinityMask(GetCurrentProcess(), affinityMask);
3664-
36653627
// Debug setting
36663628
if (CGUIListItem* pSelected = m_pDebugSettingCombo->GetSelectedItem())
36673629
{

Client/core/CSettings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ class CSettings
216216
CGUICheckBox* m_pWin8ColorCheckBox;
217217
CGUICheckBox* m_pWin8MouseCheckBox;
218218
CGUICheckBox* m_pPhotoSavingCheckbox;
219-
CGUICheckBox* m_pProcessAffinityCheckbox;
220219
CGUILabel* m_pUpdateBuildTypeLabel;
221220
CGUIComboBox* m_pUpdateBuildTypeCombo;
222221
CGUILabel* m_pUpdateAutoInstallLabel;

0 commit comments

Comments
 (0)