Tweaked the description and setting name for the GPU statistics overlay.

This commit is contained in:
Leon Styhre 2020-08-15 09:33:08 +02:00
parent 7b76aa005f
commit 885bf61df0
5 changed files with 11 additions and 8 deletions

Binary file not shown.

View file

@ -678,9 +678,9 @@ void GuiMenu::openOtherSettings()
// GPU statistics.
auto gpu_statistics = std::make_shared<SwitchComponent>(mWindow);
gpu_statistics->setState(Settings::getInstance()->getBool("DrawGPUStatistics"));
s->addWithLabel("GPU STATISTICS OVERLAY", gpu_statistics);
s->addSaveFunc([gpu_statistics] { Settings::getInstance()->setBool("DrawGPUStatistics",
gpu_statistics->setState(Settings::getInstance()->getBool("DisplayGPUStatistics"));
s->addWithLabel("DISPLAY GPU STATISTICS OVERLAY", gpu_statistics);
s->addSaveFunc([gpu_statistics] { Settings::getInstance()->setBool("DisplayGPUStatistics",
gpu_statistics->getState()); });
// Hide Reboot System option in the quit menu.

View file

@ -271,7 +271,7 @@ bool parseArgs(int argc, char* argv[])
i++; // Skip vsync value.
}
else if (strcmp(argv[i], "--gpu-statistics") == 0) {
Settings::getInstance()->setBool("DrawGPUStatistics", "true");
Settings::getInstance()->setBool("DisplayGPUStatistics", "true");
}
else if (strcmp(argv[i], "--force-full") == 0) {
Settings::getInstance()->setString("UIMode", "full");
@ -313,7 +313,7 @@ bool parseArgs(int argc, char* argv[])
#endif
" --vsync [1/on or 0/off] Turn vsync on or off (default is on)\n"
" --max-vram [size] Max VRAM to use (in mebibytes) before swapping\n"
" --gpu-statistics Draw framerate and VRAM usage overlay\n"
" --gpu-statistics Display framerate and VRAM usage overlay\n"
" --force-full Force the UI mode to Full\n"
" --force-kid Force the UI mode to Kid\n"
" --force-kiosk Force the UI mode to Kiosk\n"

View file

@ -204,7 +204,7 @@ void Settings::setDefaults()
mBoolMap["LocalArt"] = false;
mBoolMap["ShowHiddenFiles"] = true;
mBoolMap["ShowHiddenGames"] = true;
mBoolMap["DrawGPUStatistics"] = false;
mBoolMap["DisplayGPUStatistics"] = false;
mBoolMap["ShowRebootSystem"] = true;
mBoolMap["ShowPoweroffSystem"] = true;

View file

@ -207,7 +207,7 @@ void Window::update(int deltaTime)
if (mFrameTimeElapsed > 500) {
mAverageDeltaTime = mFrameTimeElapsed / mFrameCountElapsed;
if (Settings::getInstance()->getBool("DrawGPUStatistics")) {
if (Settings::getInstance()->getBool("DisplayGPUStatistics")) {
std::stringstream ss;
// FPS.
@ -216,6 +216,9 @@ void Window::update(int deltaTime)
ss << std::fixed << std::setprecision(2) <<
((float)mFrameTimeElapsed / (float)mFrameCountElapsed) << " ms)";
// The following calculations are not accurate, and the font calculation is completely
// broken. For now, still report the figures as it's somehow useful to locate memory
// leaks and similar. But this needs to be completely overhauled later on.
// VRAM.
float textureVramUsageMiB = TextureResource::getTotalMemUsage() / 1024.0f / 1024.0f;
float textureTotalUsageMiB = TextureResource::getTotalTextureSize() / 1024.0f / 1024.0f;
@ -263,7 +266,7 @@ void Window::render()
if (!mRenderedHelpPrompts)
mHelp->render(transform);
if (Settings::getInstance()->getBool("DrawGPUStatistics") && mFrameDataText) {
if (Settings::getInstance()->getBool("DisplayGPUStatistics") && mFrameDataText) {
Renderer::setMatrix(Transform4x4f::Identity());
mDefaultFonts.at(1)->renderTextCache(mFrameDataText.get());
}