| 2327 | #endif |
| 2328 | |
| 2329 | static bool CheckCPURequirements(CCpuFeatures* pCpu, CSystem* pSystem) |
| 2330 | { |
| 2331 | #if !defined(DEDICATED_SERVER) |
| 2332 | #if CRY_PLATFORM_WINDOWS |
| 2333 | if (!gEnv->IsEditor() && !gEnv->IsDedicated()) |
| 2334 | { |
| 2335 | if (!(pCpu->hasSSE() && pCpu->hasSSE2() && pCpu->hasSSE3())) |
| 2336 | { |
| 2337 | CryLogAlways("Unsupported CPU! Need SSE, SSE2 and SSE3 instructions to be available."); |
| 2338 | |
| 2339 | #if !defined(_RELEASE) |
| 2340 | const bool allowPrompts = pSystem->GetICmdLine()->FindArg(eCLAT_Pre, "noprompt") == 0; |
| 2341 | #else |
| 2342 | const bool allowPrompts = true; |
| 2343 | #endif // !defined(_RELEASE) |
| 2344 | if (allowPrompts) |
| 2345 | { |
| 2346 | CryLogAlways("Asking user if they wish to continue..."); |
| 2347 | const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedCPU().c_str(), L"CRYENGINE", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY); |
| 2348 | if (mbRes == IDCANCEL) |
| 2349 | { |
| 2350 | CryLogAlways("User chose to cancel."); |
| 2351 | return false; |
| 2352 | } |
| 2353 | } |
| 2354 | else |
| 2355 | { |
| 2356 | #if !defined(_RELEASE) |
| 2357 | const bool obeyCPUCheck = pSystem->GetICmdLine()->FindArg(eCLAT_Pre, "anycpu") == 0; |
| 2358 | #else |
| 2359 | const bool obeyCPUCheck = true; |
| 2360 | #endif // !defined(_RELEASE) |
| 2361 | if (obeyCPUCheck) |
| 2362 | { |
| 2363 | CryLogAlways("No prompts allowed and unsupported CPU check active. Treating unsupported CPU as error and exiting."); |
| 2364 | return false; |
| 2365 | } |
| 2366 | } |
| 2367 | |
| 2368 | CryLogAlways("User chose to continue despite unsupported CPU!"); |
| 2369 | } |
| 2370 | } |
| 2371 | #endif |
| 2372 | #endif // !defined(DEDICATED_SERVER) |
| 2373 | return true; |
| 2374 | } |
| 2375 | |
| 2376 | // System initialization |
| 2377 | ///////////////////////////////////////////////////////////////////////////////// |
no test coverage detected