fix log highlighting
This commit is contained in:
@@ -212,7 +212,9 @@ namespace Tools
|
|||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
|
|
||||||
auto& logs = GetLogHistory();
|
auto& logs = GetLogHistory();
|
||||||
for (int32_t i = 0; i < bx::min(100, LogInternal::LogHistorySize); ++i)
|
|
||||||
|
int32_t lineCount = bx::min(100, LogInternal::LogHistorySize);
|
||||||
|
for (int32_t i = 0; i < lineCount; ++i)
|
||||||
{
|
{
|
||||||
int32_t idx = logs.WriteIdx - i - 1;
|
int32_t idx = logs.WriteIdx - i - 1;
|
||||||
if (idx < 0) idx += LogInternal::LogHistorySize;
|
if (idx < 0) idx += LogInternal::LogHistorySize;
|
||||||
@@ -226,20 +228,6 @@ namespace Tools
|
|||||||
const char* filePathRes =
|
const char* filePathRes =
|
||||||
debug.ShortenLogFileNames ? bx::FilePath{filePath}.getFileName().getPtr() : filePath;
|
debug.ShortenLogFileNames ? bx::FilePath{filePath}.getFileName().getPtr() : filePath;
|
||||||
|
|
||||||
// ImVec4 texCol = {1.0f, 1.0f, 1.0f, 1.0f};
|
|
||||||
// if (logs.WriteType[idx] == ELogType::Warn)
|
|
||||||
// texCol = {1.0f, 1.0f, 0.8f, 1.0f};
|
|
||||||
// else if (logs.WriteType[idx] == ELogType::Error)
|
|
||||||
// texCol = {1.0f, 0.8f, 0.8f, 1.0f};
|
|
||||||
// ImGui::PushStyleColor(ImGuiCol_Text, texCol);
|
|
||||||
ImVec4 bgCol = {0.0f, 0.0f, 0.0f, 1.0f};
|
|
||||||
if (logs.WriteType[idx] == ELogType::Warn)
|
|
||||||
bgCol = {0.2f, 0.2f, 0.0f, 1.0f};
|
|
||||||
else if (logs.WriteType[idx] == ELogType::Error)
|
|
||||||
bgCol = {0.2f, 0.0f, 0.0f, 1.0f};
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TableRowBg, bgCol);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TableRowBgAlt, bgCol);
|
|
||||||
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%.01f", writeTime);
|
ImGui::Text("%.01f", writeTime);
|
||||||
@@ -254,10 +242,20 @@ namespace Tools
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", filePathRes);
|
ImGui::Text("%s", filePathRes);
|
||||||
|
|
||||||
ImGui::PopStyleColor(2);
|
if (i > 0) ImGui::PopStyleColor(2);
|
||||||
|
ImVec4 bgCol = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||||
|
if (logs.WriteType[idx] == ELogType::Warn)
|
||||||
|
bgCol = {0.2f, 0.2f, 0.0f, 1.0f};
|
||||||
|
else if (logs.WriteType[idx] == ELogType::Error)
|
||||||
|
bgCol = {0.2f, 0.0f, 0.0f, 1.0f};
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_TableRowBg, bgCol);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_TableRowBgAlt, bgCol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
|
||||||
|
if (lineCount > 0) ImGui::PopStyleColor(2);
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
if (ImGui::Begin("Rendering"))
|
if (ImGui::Begin("Rendering"))
|
||||||
|
|||||||
Reference in New Issue
Block a user