Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/GameSetup/HWDetect.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#include <freetype/freetype.h> | #include <freetype/freetype.h> | ||||
#if OS_LINUX | #if OS_LINUX | ||||
#include <fstream> | #include <fstream> | ||||
#endif | #endif | ||||
#include <sstream> | #include <sstream> | ||||
#include <string> | #include <string> | ||||
#include <thread> | |||||
static void ReportSDL(const ScriptRequest& rq, JS::HandleValue settings); | static void ReportSDL(const ScriptRequest& rq, JS::HandleValue settings); | ||||
static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings); | static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings); | ||||
void SetDisableAudio(bool disabled) | void SetDisableAudio(bool disabled) | ||||
{ | { | ||||
g_DisableAudio = disabled; | g_DisableAudio = disabled; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | #if ARCH_X86_X64 | ||||
Script::SetProperty(rq, settings, "x86_caps[0]", caps0); | Script::SetProperty(rq, settings, "x86_caps[0]", caps0); | ||||
Script::SetProperty(rq, settings, "x86_caps[1]", caps1); | Script::SetProperty(rq, settings, "x86_caps[1]", caps1); | ||||
Script::SetProperty(rq, settings, "x86_caps[2]", caps2); | Script::SetProperty(rq, settings, "x86_caps[2]", caps2); | ||||
Script::SetProperty(rq, settings, "x86_caps[3]", caps3); | Script::SetProperty(rq, settings, "x86_caps[3]", caps3); | ||||
#endif | #endif | ||||
Script::SetProperty(rq, settings, "timer_resolution", timer_Resolution()); | Script::SetProperty(rq, settings, "timer_resolution", timer_Resolution()); | ||||
Script::SetProperty(rq, settings, "hardware_concurrency", std::thread::hardware_concurrency()); | |||||
// The version should be increased for every meaningful change. | // The version should be increased for every meaningful change. | ||||
const int reportVersion = 19; | const int reportVersion = 20; | ||||
// Send the same data to the reporting system | // Send the same data to the reporting system | ||||
g_UserReporter.SubmitReport( | g_UserReporter.SubmitReport( | ||||
"hwdetect", | "hwdetect", | ||||
reportVersion, | reportVersion, | ||||
Script::StringifyJSON(rq, &settings, false), | Script::StringifyJSON(rq, &settings, false), | ||||
Script::StringifyJSON(rq, &settings, true)); | Script::StringifyJSON(rq, &settings, true)); | ||||
Show All 13 Lines | static void ReportSDL(const ScriptRequest& rq, JS::HandleValue settings) | ||||
SDL_GetVersion(&runtime); | SDL_GetVersion(&runtime); | ||||
snprintf(version, ARRAY_SIZE(version), "%d.%d.%d", runtime.major, runtime.minor, runtime.patch); | snprintf(version, ARRAY_SIZE(version), "%d.%d.%d", runtime.major, runtime.minor, runtime.patch); | ||||
Script::SetProperty(rq, settings, "sdl_runtime_version", version); | Script::SetProperty(rq, settings, "sdl_runtime_version", version); | ||||
// This is null in atlas (and further the call triggers an assertion). | // This is null in atlas (and further the call triggers an assertion). | ||||
const char* backend = g_VideoMode.GetWindow() ? GetSDLSubsystem(g_VideoMode.GetWindow()) : "none"; | const char* backend = g_VideoMode.GetWindow() ? GetSDLSubsystem(g_VideoMode.GetWindow()) : "none"; | ||||
Script::SetProperty(rq, settings, "sdl_video_backend", backend ? backend : "unknown"); | Script::SetProperty(rq, settings, "sdl_video_backend", backend ? backend : "unknown"); | ||||
Script::SetProperty(rq, settings, "sdl_display_count", SDL_GetNumVideoDisplays()); | |||||
Script::SetProperty(rq, settings, "sdl_cpu_count", SDL_GetCPUCount()); | |||||
Script::SetProperty(rq, settings, "sdl_system_ram", SDL_GetSystemRAM()); | |||||
} | } | ||||
static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings) | static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings) | ||||
{ | { | ||||
FT_Library FTLibrary; | FT_Library FTLibrary; | ||||
std::string FTSupport = "unsupported"; | std::string FTSupport = "unsupported"; | ||||
if (!FT_Init_FreeType(&FTLibrary)) | if (!FT_Init_FreeType(&FTLibrary)) | ||||
{ | { | ||||
Show All 14 Lines |
Wildfire Games · Phabricator