diff --git a/src/pigui/PerfInfo.cpp b/src/pigui/PerfInfo.cpp index de2fbcc51b..6cf427d317 100644 --- a/src/pigui/PerfInfo.cpp +++ b/src/pigui/PerfInfo.cpp @@ -4,6 +4,7 @@ #include "PerfInfo.h" #include "Frame.h" #include "Game.h" +#include "GameConfig.h" #include "Input.h" #include "LuaPiGui.h" #include "Pi.h" @@ -349,12 +350,16 @@ void PerfInfo::DrawPerfWindow() if (Pi::game && Pi::player->GetFlightState() != Ship::HYPERSPACE) { if (BeginDebugTab(s_worldIcon, "WorldView Stats")) { - DrawWorldViewStats(); EndDebugTab(); } } + if (ImGui::BeginTabItem("Terrain")) { + DrawTerrainDebug(); + ImGui::EndTabItem(); + } + PiGui::RunHandler(Pi::GetFrameTime(), "debug-tabs"); ImGui::EndTabBar(); @@ -622,6 +627,14 @@ void PerfInfo::DrawInputDebug() } } +void PiGui::PerfInfo::DrawTerrainDebug() +{ + bool sortGeoPatches = Pi::config->Int("SortGeoPatches") == 1; + if (ImGui::Checkbox("Distance Sort GeoPatches", &sortGeoPatches)) { + Pi::config->SetInt("SortGeoPatches", sortGeoPatches ? 1 : 0); + } +} + void PerfInfo::DrawImGuiStats() { ImGui::SeparatorText("ImGui Stats"); diff --git a/src/pigui/PerfInfo.h b/src/pigui/PerfInfo.h index c72c9334b2..9534e7abab 100644 --- a/src/pigui/PerfInfo.h +++ b/src/pigui/PerfInfo.h @@ -67,6 +67,7 @@ namespace PiGui { void DrawWorldViewStats(); void DrawImGuiStats(); void DrawInputDebug(); + void DrawTerrainDebug(); void DrawStatList(const Perf::Stats::FrameInfo &fi); void DrawCounter(CounterInfo &counter, const char *label, float min, float max, float height, bool drawStats = false);