more logging stuff
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "bgfx/platform.h"
|
||||
#include "bx/bx.h"
|
||||
#include "bx/constants.h"
|
||||
#include "bx/debug.h"
|
||||
#include "bx/filepath.h"
|
||||
#include "bx/math.h"
|
||||
#include "bx/string.h"
|
||||
@@ -468,14 +469,39 @@ namespace Game
|
||||
auto& shared = GetShared();
|
||||
auto& debug = GetInstance().DebugData;
|
||||
auto& level = GetInstance().GameLevel;
|
||||
auto& time = GetInstance().Time;
|
||||
|
||||
if (ImGui::IsMouseClicked(ImGuiMouseButton_Right))
|
||||
{
|
||||
debug.DebugCardRotation++;
|
||||
if (debug.DebugCardRotation >= 4) debug.DebugCardRotation = 0;
|
||||
}
|
||||
ImGui::SetNextWindowPos({0, 0});
|
||||
if (ImGui::Begin("Stats",
|
||||
nullptr,
|
||||
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoInputs |
|
||||
ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
if (GetInstance().Player.CameraM == CameraMode::Freefly)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, {0.8f, 0.1f, 0.1f, 1.0f});
|
||||
ImGui::Text("NOCLIP");
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
ImGui::Text("Delta: %.01fms", time.Delta * 1000);
|
||||
ImGui::Text("FPS: %.0f", 1.0 / time.Delta);
|
||||
}
|
||||
ImGui::End();
|
||||
if (ImGui::Begin("Log"))
|
||||
{
|
||||
ImGui::Checkbox("Shorten File Names", &GetInstance().DebugData.ShortenLogFileNames);
|
||||
ImGui::BeginTable(
|
||||
"tbl", 4, ImGuiTableFlags_Resizable | ImGuiTableFlags_Hideable | ImGuiTableFlags_SizingFixedFit);
|
||||
ImGui::TableSetupColumn("Time", ImGuiTableColumnFlags_NoResize);
|
||||
ImGui::TableSetupColumn("Log");
|
||||
ImGui::TableSetupColumn("Line", ImGuiTableColumnFlags_NoResize);
|
||||
ImGui::TableSetupColumn("File", ImGuiTableColumnFlags_NoResize);
|
||||
ImGui::TableHeadersRow();
|
||||
for (int32_t i = 0; i < bx::min(100, LogInternal::LogHistorySize); ++i)
|
||||
{
|
||||
int32_t idx = GetLogHistory().WriteIdx - i - 1;
|
||||
@@ -485,9 +511,28 @@ namespace Game
|
||||
{
|
||||
int64_t timeOffset = GetLogHistory().WriteTime[idx] - GetInstance().Time.StartTime;
|
||||
double writeTime = (double)timeOffset / bx::getHPFrequency();
|
||||
ImGui::Text("%.04f: %s", writeTime, line);
|
||||
uint32_t fileLine = GetLogHistory().LineBuffer[idx];
|
||||
const char* filePath = &GetLogHistory().FileBuffer[idx * LogInternal::MaxLineSize];
|
||||
const char* filePathRes = GetInstance().DebugData.ShortenLogFileNames
|
||||
? bx::FilePath{filePath}.getFileName().getPtr()
|
||||
: filePath;
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%.01f", writeTime);
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", line);
|
||||
ImGui::SetItemTooltip("%f\n%s%s:%u", writeTime, line, filePath, fileLine);
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%u", fileLine);
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", filePathRes);
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::End();
|
||||
if (ImGui::Begin("Rendering"))
|
||||
|
||||
Reference in New Issue
Block a user