Resolve GCC Warnings

This commit is contained in:
Minty-Meeo
2022-05-01 03:12:28 -05:00
parent e50e45f400
commit 69e32dea52
10 changed files with 40 additions and 29 deletions

View File

@ -336,12 +336,12 @@ void Statistics::DisplayScissor()
// Visualization of where things are updated on screen with this specific scissor
ImGui::TableNextColumn();
float scale = ImGui::GetTextLineHeight() / EFB_HEIGHT;
float scale_height = ImGui::GetTextLineHeight() / EFB_HEIGHT;
if (show_raw_scissors)
scale += ImGui::GetTextLineHeightWithSpacing() / EFB_HEIGHT;
scale_height += ImGui::GetTextLineHeightWithSpacing() / EFB_HEIGHT;
ImVec2 p2 = ImGui::GetCursorScreenPos();
// Use a height of 1 since we want this to span two table rows (if possible)
ImGui::Dummy(ImVec2(EFB_WIDTH * scale, 1));
ImGui::Dummy(ImVec2(EFB_WIDTH * scale_height, 1));
for (size_t i = 0; i < info.m_result.size(); i++)
{
// The last entry in the sorted list of results is the one that is used by hardware backends
@ -350,11 +350,12 @@ void Statistics::DisplayScissor()
const ImU32 new_col = (col & ~IM_COL32_A_MASK) | (new_alpha << IM_COL32_A_SHIFT);
const auto& r = info.m_result[i];
draw_list->AddRectFilled(ImVec2(p2.x + r.rect.left * scale, p2.y + r.rect.top * scale),
ImVec2(p2.x + r.rect.right * scale, p2.y + r.rect.bottom * scale),
new_col);
draw_list->AddRectFilled(
ImVec2(p2.x + r.rect.left * scale_height, p2.y + r.rect.top * scale_height),
ImVec2(p2.x + r.rect.right * scale_height, p2.y + r.rect.bottom * scale_height), new_col);
}
draw_list->AddRect(p2, ImVec2(p2.x + EFB_WIDTH * scale, p2.y + EFB_HEIGHT * scale), light_grey);
draw_list->AddRect(
p2, ImVec2(p2.x + EFB_WIDTH * scale_height, p2.y + EFB_HEIGHT * scale_height), light_grey);
ImGui::SameLine();
ImGui::Text("%d", int(info.m_result.size()));
@ -428,7 +429,7 @@ void Statistics::DisplayScissor()
draw_scissor_table_header();
for (size_t i = 0; i < scissors.size(); i++)
draw_scissor_table_row(i);
for (size_t i = scissors.size(); i < scissor_expected_count; i++)
for (size_t i = scissors.size(); i < static_cast<size_t>(scissor_expected_count); i++)
scissor_table_skip_row(i);
ImGui::EndTable();
}
@ -440,7 +441,7 @@ void Statistics::DisplayScissor()
draw_viewport_table_header();
for (size_t i = 0; i < scissors.size(); i++)
draw_viewport_table_row(i);
for (size_t i = scissors.size(); i < scissor_expected_count; i++)
for (size_t i = scissors.size(); i < static_cast<size_t>(scissor_expected_count); i++)
viewport_table_skip_row(i);
ImGui::EndTable();
}