From 885bf61df09d7fb670823c74d59a9f8e14accfdc Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 15 Aug 2020 09:33:08 +0200 Subject: [PATCH] Tweaked the description and setting name for the GPU statistics overlay. --- es-app/src/emulationstation.6.gz | Bin 1102 -> 1099 bytes es-app/src/guis/GuiMenu.cpp | 6 +++--- es-app/src/main.cpp | 4 ++-- es-core/src/Settings.cpp | 2 +- es-core/src/Window.cpp | 7 +++++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/es-app/src/emulationstation.6.gz b/es-app/src/emulationstation.6.gz index df4045bf61dba8ca4be48f4689c904ccf7ca6329..1ef348f52ba2cb6bd6597fbda37aa40c8a611aa7 100644 GIT binary patch literal 1099 zcmV-R1ho4fiwFoFayDN817&S>Y+-b1Z*FsRVRUJ4ZZ0+eg;h;&<2Dez>sL&DSqF&a zBwciYMNz<6JB`seHY}&bBFcf1D2a_ksv>E}{q_4uIUC#SvKV#`F*tVf7JV>N4=3PtTuFYadm+cuWiMQP*NNJN9)V*BD@$R+%R1K&T6iEK^WcA z{b)7`eo!CKjcRC;33v9!(bxO=BAP})cumI`!DF0H<8#$`Sv-vM<&!rW zPogi&>B5B`{GS&Rni%B_nK7ABUhx-^RGjiwNi*P1q*_W^wb4QrUZ-MKrlmU-E=#9c z(^lD*;LC_X1BWoGspY0sUWrmwRXlYL!yuTN51NEDKt~&lqJ)#x_!JU~@^8TV&^E%9 zyR22KN!zp}bkLNXmJWKH$pEnA&S_E-^9S`CG6jWs$BuYe&8q7KKDIdkz3S^)jFHtC(_8q3nH>EVq^K4~k*YHC-xY z(3rD*R0ucmpcGlgWjye@x&I+V9|nGxDhf_8=g7! zzjohLtBjvJN4ClwB~w)=LgK>n@D!K!A<>Ge3(6$`pOsU%_h0mO>Ak#Xm#7xiM=yMZ zufLy;?WxbI4clrE3(Rc}+P&6WnR=dI4si`~Tnts7gXXrymU6e$$swhF#&d?Lb!$M$ z1E89{0Ig-U2h-wT{uIpE3;nqq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n<;q0*uh5@%}X`z#3jW3Ut)zNn^gQrHfL-(?usGwR%N^cvf)!paYi-@smn zoDbsJ3?_H+Vh|9MAXk~g^|X6C>8;!_QB#Y7+0XE6Wo>IdkH@93C=GFCjB8FWG&vd{ Uzu35=#=iyM09^s)iKhqv0JQog>Hq)$ diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 80fc5669a..8d7f1afb7 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -678,9 +678,9 @@ void GuiMenu::openOtherSettings() // GPU statistics. auto gpu_statistics = std::make_shared(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. diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 042759026..7a12e5a28 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -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" diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 7fbf2d3e5..12800c293 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -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; diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index e9a895105..84ec5a624 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -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()); }