2018-04-03 12:33:08 +02:00
|
|
|
#include "dxvk_hud_config.h"
|
|
|
|
|
2018-04-03 16:27:16 +02:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2018-04-03 14:49:13 +02:00
|
|
|
namespace dxvk::hud {
|
2018-04-03 12:33:08 +02:00
|
|
|
|
|
|
|
const std::unordered_map<std::string, HudElement> g_hudElements = {{
|
2018-04-03 14:49:13 +02:00
|
|
|
{ "devinfo", HudElement::DeviceInfo },
|
|
|
|
{ "fps", HudElement::Framerate },
|
2018-04-17 12:03:03 +02:00
|
|
|
{ "frametimes", HudElement::Frametimes },
|
2018-04-03 14:49:13 +02:00
|
|
|
{ "drawcalls", HudElement::StatDrawCalls },
|
|
|
|
{ "submissions", HudElement::StatSubmissions },
|
|
|
|
{ "pipelines", HudElement::StatPipelines },
|
|
|
|
{ "memory", HudElement::StatMemory },
|
2019-07-18 23:23:36 +02:00
|
|
|
{ "gpuload", HudElement::StatGpuLoad },
|
2018-07-11 17:40:07 +02:00
|
|
|
{ "version", HudElement::DxvkVersion },
|
2019-02-15 18:05:44 +01:00
|
|
|
{ "api", HudElement::DxvkClientApi },
|
2019-04-14 13:28:03 +02:00
|
|
|
{ "compiler", HudElement::CompilerActivity },
|
2018-04-03 12:33:08 +02:00
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
|
|
HudConfig::HudConfig() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HudConfig::HudConfig(const std::string& configStr) {
|
|
|
|
if (configStr == "1") {
|
|
|
|
this->elements.set(
|
|
|
|
HudElement::DeviceInfo,
|
|
|
|
HudElement::Framerate);
|
2019-01-07 19:23:00 +01:00
|
|
|
} else if (configStr == "full") {
|
|
|
|
for (auto pair : g_hudElements)
|
|
|
|
this->elements.set(pair.second);
|
2018-04-03 12:33:08 +02:00
|
|
|
} else {
|
|
|
|
std::string::size_type pos = 0;
|
|
|
|
std::string::size_type end = 0;
|
|
|
|
|
|
|
|
while (pos < configStr.size()) {
|
|
|
|
end = configStr.find(',', pos);
|
|
|
|
|
|
|
|
if (end == std::string::npos)
|
|
|
|
end = configStr.size();
|
|
|
|
|
|
|
|
std::string configPart = configStr.substr(pos, end - pos);
|
|
|
|
|
|
|
|
auto element = g_hudElements.find(configPart);
|
|
|
|
|
|
|
|
if (element != g_hudElements.cend()) {
|
|
|
|
this->elements.set(element->second);
|
|
|
|
Logger::debug(str::format("Hud: Enabled ", configPart));
|
|
|
|
}
|
|
|
|
|
|
|
|
pos = end + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|