- made some changes to the survey code to give clearer output and removed a few obsolete things that are no longer relevant.

This commit is contained in:
Christoph Oelckers 2019-08-09 10:18:15 +02:00
parent c3e3fda94a
commit 14a21c2a7e

View file

@ -173,49 +173,40 @@ bool I_HTTPRequest(const char* request)
static int GetOSVersion() static int GetOSVersion()
{ {
#ifdef _WIN32 #ifdef _WIN32
if (sys_ostype == 1) return 1;
if (sizeof(void*) == 4) // 32 bit if (sizeof(void*) == 4) // 32 bit
{ {
BOOL res; BOOL res;
if (IsWow64Process(GetCurrentProcess(), &res) && res) if (IsWow64Process(GetCurrentProcess(), &res) && res)
{ {
return 6; return 2;
} }
if (sys_ostype == 2) return 2; return 1;
else return 4;
} }
else else
{ {
if (sys_ostype == 2) return 3; if (sys_ostype == 2) return 3;
else return 5; else return 4;
} }
#elif defined __APPLE__ #elif defined __APPLE__
if (sizeof(void*) == 4) // 32 bit return 5;
{
return 7;
}
else
{
return 8;
}
#else #else
// fall-through linux stuff here // fall-through linux stuff here
#ifdef __arm__ #ifdef __arm__
return 10; return 8;
#elif __ppc__ #elif __ppc__
return 9; return 9;
#else #else
if (sizeof(void*) == 4) // 32 bit if (sizeof(void*) == 4) // 32 bit
{ {
return 11; return 6;
} }
else else
{ {
return 12; return 7;
} }
#endif #endif
@ -255,28 +246,29 @@ static int GetCoreInfo()
ptr++; ptr++;
} }
free(buffer); free(buffer);
return cores < 2 ? 0 : cores < 4 ? 1 : cores < 6 ? 2 : cores < 8 ? 3 : 4; return cores;
} }
#else #else
static int GetCoreInfo() static int GetCoreInfo()
{ {
int cores = std::thread::hardware_concurrency(); int cores = std::thread::hardware_concurrency();
if (CPU.HyperThreading) cores /= 2; return cores;
return cores < 2? 0 : cores < 4? 1 : cores < 6? 2 : cores < 8? 3 : 4;
} }
#endif #endif
EXTERN_CVAR(Int, vid_enablevulkan)
static int GetRenderInfo() static int GetRenderInfo()
{ {
if (vid_enablevulkan == 1) return 4;
auto info = gl_getInfo(); auto info = gl_getInfo();
if (info.first < 3.3) return 0;
if (!info.second) if (!info.second)
{ {
if ((screen->hwcaps & (RFL_SHADER_STORAGE_BUFFER | RFL_BUFFER_STORAGE)) == (RFL_SHADER_STORAGE_BUFFER | RFL_BUFFER_STORAGE)) return 3; if ((screen->hwcaps & (RFL_SHADER_STORAGE_BUFFER | RFL_BUFFER_STORAGE)) == (RFL_SHADER_STORAGE_BUFFER | RFL_BUFFER_STORAGE)) return 3;
return 4; return 1;
} }
return 5; return 2;
} }
static int GetGLVersion() static int GetGLVersion()
@ -343,7 +335,7 @@ void D_ConfirmSendStats()
#ifdef _WIN32 #ifdef _WIN32
extern HWND Window; extern HWND Window;
enabled.Int = MessageBox(Window, MESSAGE_TEXT, TITLE_TEXT, MB_ICONQUESTION | MB_YESNO) == IDYES; enabled.Int = MessageBoxA(Window, MESSAGE_TEXT, TITLE_TEXT, MB_ICONQUESTION | MB_YESNO) == IDYES;
#elif defined __APPLE__ #elif defined __APPLE__
const CFStringRef messageString = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, MESSAGE_TEXT, kCFStringEncodingASCII, kCFAllocatorNull); const CFStringRef messageString = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, MESSAGE_TEXT, kCFStringEncodingASCII, kCFAllocatorNull);
const CFStringRef titleString = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, TITLE_TEXT, kCFStringEncodingASCII, kCFAllocatorNull); const CFStringRef titleString = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, TITLE_TEXT, kCFStringEncodingASCII, kCFAllocatorNull);