Changeset View
Changeset View
Standalone View
Standalone View
source/ps/Util.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | static std::string SplitExts(const char *exts) | ||||
return ret; | return ret; | ||||
} | } | ||||
void WriteSystemInfo() | void WriteSystemInfo() | ||||
{ | { | ||||
TIMER(L"write_sys_info"); | TIMER(L"write_sys_info"); | ||||
// get_cpu_info and gfx_detect already called during init - see call site | |||||
snd_detect(); | |||||
struct utsname un; | struct utsname un; | ||||
uname(&un); | uname(&un); | ||||
OsPath pathname = psLogDir()/"system_info.txt"; | OsPath pathname = psLogDir()/"system_info.txt"; | ||||
FILE* f = sys_OpenFile(pathname, "w"); | FILE* f = sys_OpenFile(pathname, "w"); | ||||
if(!f) | if(!f) | ||||
return; | return; | ||||
Show All 37 Lines | #endif | ||||
// graphics | // graphics | ||||
const std::wstring cardName = gfx::CardName(); | const std::wstring cardName = gfx::CardName(); | ||||
const std::wstring driverInfo = gfx::DriverInfo(); | const std::wstring driverInfo = gfx::DriverInfo(); | ||||
fprintf(f, "Graphics Card : %ls\n", cardName.c_str()); | fprintf(f, "Graphics Card : %ls\n", cardName.c_str()); | ||||
fprintf(f, "OpenGL Drivers : %s; %ls\n", glGetString(GL_VERSION), driverInfo.c_str()); | fprintf(f, "OpenGL Drivers : %s; %ls\n", glGetString(GL_VERSION), driverInfo.c_str()); | ||||
fprintf(f, "Video Mode : %dx%d:%d\n", g_VideoMode.GetXRes(), g_VideoMode.GetYRes(), g_VideoMode.GetBPP()); | fprintf(f, "Video Mode : %dx%d:%d\n", g_VideoMode.GetXRes(), g_VideoMode.GetYRes(), g_VideoMode.GetBPP()); | ||||
// sound | #if CONFIG2_AUDIO | ||||
snd_detect(); | |||||
fprintf(f, "Sound Card : %s\n", snd_card.c_str()); | fprintf(f, "Sound Card : %s\n", snd_card.c_str()); | ||||
fprintf(f, "Sound Drivers : %s\n", snd_drv_ver.c_str()); | fprintf(f, "Sound Drivers : %s\n", snd_drv_ver.c_str()); | ||||
#else | |||||
fprintf(f, "Sound : Game was compiled without audio\n"); | |||||
#endif | |||||
// OpenGL extensions (write them last, since it's a lot of text) | // OpenGL extensions (write them last, since it's a lot of text) | ||||
const char* exts = ogl_ExtensionString(); | const char* exts = ogl_ExtensionString(); | ||||
if (!exts) exts = "{unknown}"; | if (!exts) exts = "{unknown}"; | ||||
fprintf(f, "\nOpenGL Extensions: \n%s\n", SplitExts(exts).c_str()); | fprintf(f, "\nOpenGL Extensions: \n%s\n", SplitExts(exts).c_str()); | ||||
// System Management BIOS (even more text than OpenGL extensions) | // System Management BIOS (even more text than OpenGL extensions) | ||||
std::string smbios = SMBIOS::StringizeStructures(SMBIOS::GetStructures()); | std::string smbios = SMBIOS::StringizeStructures(SMBIOS::GetStructures()); | ||||
▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator