diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index cd77d37346..5fcc7062d9 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -78,6 +78,10 @@ void __cpuid(int info[4], int x) CPUInfo cpu_info; +CPUInfo::CPUInfo() { + Detect(); +} + // Detects the various cpu features void CPUInfo::Detect() { diff --git a/Source/Core/Common/Src/CPUDetect.h b/Source/Core/Common/Src/CPUDetect.h index 55a0de93c9..55c6b62b3b 100644 --- a/Source/Core/Common/Src/CPUDetect.h +++ b/Source/Core/Common/Src/CPUDetect.h @@ -52,12 +52,16 @@ struct CPUInfo bool bSSE4A; bool bLAHFSAHF64; bool bLongMode; - - // Detects the various cpu features - void Detect(); + // Call Detect() + explicit CPUInfo(); + // Turn the cpu info into a string we can show std::string Summarize(); + +private: + // Detects the various cpu features + void Detect(); }; extern CPUInfo cpu_info; diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index b871303c50..a663b9e22a 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -106,9 +106,6 @@ bool DolphinApp::OnInit() wxString padPluginFilename; wxString wiimotePluginFilename; - // Detect CPU info and write it to the cpu_info struct - cpu_info.Detect(); - #if defined _DEBUG && defined _WIN32 int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;