Skip to content

Commit

Permalink
Merge branch 'terrain-perf-ui' of https://github.com/fluffyfreak/pioneer
Browse files Browse the repository at this point in the history
 into reduce-geopatch-size
  • Loading branch information
fluffyfreak committed Nov 20, 2024
2 parents 79a8e4d + bc65297 commit 7a9bff7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/pigui/PerfInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions src/pigui/PerfInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7a9bff7

Please sign in to comment.