impr: .0f -> .0F
This commit is contained in:
parent
0505b123a0
commit
859574c014
@ -434,16 +434,16 @@ namespace hex::gl {
|
|||||||
int k = 0;
|
int k = 0;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
for (u32 j = 0; j <= m_slices; ++j) {
|
for (u32 j = 0; j <= m_slices; ++j) {
|
||||||
float z = 2.0f * float(j) / float(m_slices) - 1.0f;
|
float z = 2.0F * float(j) / float(m_slices) - 1.0F;
|
||||||
for (u32 i = 0; i <= m_slices; ++i) {
|
for (u32 i = 0; i <= m_slices; ++i) {
|
||||||
m_vertices[k ] = 2.0f * float(i) / float(m_slices) - 1.0f;
|
m_vertices[k ] = 2.0F * float(i) / float(m_slices) - 1.0F;
|
||||||
m_vertices[k + 1] = 0.0f;
|
m_vertices[k + 1] = 0.0F;
|
||||||
m_vertices[k + 2] = z;
|
m_vertices[k + 2] = z;
|
||||||
k += 3;
|
k += 3;
|
||||||
m_colors[l ] = 0.5f;
|
m_colors[l ] = 0.5F;
|
||||||
m_colors[l + 1] = 0.5f;
|
m_colors[l + 1] = 0.5F;
|
||||||
m_colors[l + 2] = 0.5f;
|
m_colors[l + 2] = 0.5F;
|
||||||
m_colors[l + 3] = 0.3f;
|
m_colors[l + 3] = 0.3F;
|
||||||
l += 4;
|
l += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,10 +540,10 @@ namespace hex::gl {
|
|||||||
m_vertices[n + 2] = m_radius * z;
|
m_vertices[n + 2] = m_radius * z;
|
||||||
|
|
||||||
n = (i * m_resolution + j + 1) * 4;
|
n = (i * m_resolution + j + 1) * 4;
|
||||||
m_colors[n] = 1.0f;
|
m_colors[n] = 1.0F;
|
||||||
m_colors[n + 1] = 1.0f;
|
m_colors[n + 1] = 1.0F;
|
||||||
m_colors[n + 2] = 1.0f;
|
m_colors[n + 2] = 1.0F;
|
||||||
m_colors[n + 3] = 1.0f;
|
m_colors[n + 3] = 1.0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ namespace ImGuiExt {
|
|||||||
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
||||||
|
|
||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
ImVec2 size = CalcItemSize(size_arg, label_size.x, label_size.y) + ImVec2(g.FontSize + style.FramePadding.x * 2, 0.0f);
|
ImVec2 size = CalcItemSize(size_arg, label_size.x, label_size.y) + ImVec2(g.FontSize + style.FramePadding.x * 2, 0.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, 0);
|
ItemSize(size, 0);
|
||||||
@ -241,8 +241,8 @@ namespace ImGuiExt {
|
|||||||
// Render
|
// Render
|
||||||
const ImU32 col = hovered ? GetColorU32(ImGuiCol_ButtonHovered) : GetColorU32(ImGuiCol_ButtonActive);
|
const ImU32 col = hovered ? GetColorU32(ImGuiCol_ButtonHovered) : GetColorU32(ImGuiCol_ButtonActive);
|
||||||
PushStyleColor(ImGuiCol_Text, ImU32(col));
|
PushStyleColor(ImGuiCol_Text, ImU32(col));
|
||||||
RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x, g.FontSize * 0.5f), col);
|
RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x, g.FontSize * 0.5F), col);
|
||||||
RenderText(bb.Min + ImVec2(g.FontSize * 0.5 + style.FramePadding.x, 0.0f), label, nullptr, false);
|
RenderText(bb.Min + ImVec2(g.FontSize * 0.5 + style.FramePadding.x, 0.0F), label, nullptr, false);
|
||||||
GetWindowDrawList()->AddLine(bb.Min + ImVec2(g.FontSize * 0.5 + style.FramePadding.x, size.y), pos + size - ImVec2(g.FontSize * 0.5 + style.FramePadding.x, 0), ImU32(col));
|
GetWindowDrawList()->AddLine(bb.Min + ImVec2(g.FontSize * 0.5 + style.FramePadding.x, size.y), pos + size - ImVec2(g.FontSize * 0.5 + style.FramePadding.x, 0), ImU32(col));
|
||||||
PopStyleColor();
|
PopStyleColor();
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ namespace ImGuiExt {
|
|||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
|
if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
|
||||||
pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y;
|
pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y;
|
||||||
ImVec2 size = CalcItemSize(size_arg, text_size.x + style.FramePadding.x * 4.0f, text_size.y + style.FramePadding.y * 4.0f);
|
ImVec2 size = CalcItemSize(size_arg, text_size.x + style.FramePadding.x * 4.0F, text_size.y + style.FramePadding.y * 4.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, style.FramePadding.y);
|
ItemSize(size, style.FramePadding.y);
|
||||||
@ -317,7 +317,7 @@ namespace ImGuiExt {
|
|||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
|
if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
|
||||||
pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y;
|
pos.y += window->DC.CurrLineTextBaseOffset - style.FramePadding.y;
|
||||||
ImVec2 size = CalcItemSize(size_arg, text_size.x + style.FramePadding.x * 4.0f, text_size.y + style.FramePadding.y * 6.0f);
|
ImVec2 size = CalcItemSize(size_arg, text_size.x + style.FramePadding.x * 4.0F, text_size.y + style.FramePadding.y * 6.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, style.FramePadding.y);
|
ItemSize(size, style.FramePadding.y);
|
||||||
@ -464,7 +464,7 @@ namespace ImGuiExt {
|
|||||||
case ImGuiCustomStyle_WindowBlur:
|
case ImGuiCustomStyle_WindowBlur:
|
||||||
return customData.styles.WindowBlur;
|
return customData.styles.WindowBlur;
|
||||||
default:
|
default:
|
||||||
return 0.0f;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
|
|
||||||
ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
|
ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0F, label_size.y + style.FramePadding.y * 2.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, style.FramePadding.y);
|
ItemSize(size, style.FramePadding.y);
|
||||||
@ -599,7 +599,7 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
|
|
||||||
ImVec2 size = CalcItemSize(ImVec2(1, 1) * GetCurrentWindow()->MenuBarHeight(), label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
|
ImVec2 size = CalcItemSize(ImVec2(1, 1) * GetCurrentWindow()->MenuBarHeight(), label_size.x + style.FramePadding.x * 2.0F, label_size.y + style.FramePadding.y * 2.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, style.FramePadding.y);
|
ItemSize(size, style.FramePadding.y);
|
||||||
@ -642,7 +642,7 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
|
|
||||||
ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
|
ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0F, label_size.y + style.FramePadding.y * 2.0F);
|
||||||
|
|
||||||
const ImRect bb(pos, pos + size);
|
const ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, style.FramePadding.y);
|
ItemSize(size, style.FramePadding.y);
|
||||||
@ -678,7 +678,7 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
|
|
||||||
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
||||||
const ImVec2 frame_size = CalcItemSize(ImVec2(0, 0), CalcTextSize(prefix).x, label_size.y + style.FramePadding.y * 2.0f);
|
const ImVec2 frame_size = CalcItemSize(ImVec2(0, 0), CalcTextSize(prefix).x, label_size.y + style.FramePadding.y * 2.0F);
|
||||||
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
|
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
|
||||||
|
|
||||||
SetCursorPosX(GetCursorPosX() + frame_size.x);
|
SetCursorPosX(GetCursorPosX() + frame_size.x);
|
||||||
@ -687,7 +687,7 @@ namespace ImGuiExt {
|
|||||||
DataTypeFormatString(buf, IM_ARRAYSIZE(buf), type, value, format);
|
DataTypeFormatString(buf, IM_ARRAYSIZE(buf), type, value, format);
|
||||||
|
|
||||||
bool value_changed = false;
|
bool value_changed = false;
|
||||||
if (InputTextEx(label, nullptr, buf, IM_ARRAYSIZE(buf), ImVec2(CalcItemWidth() - frame_size.x, label_size.y + style.FramePadding.y * 2.0f), flags))
|
if (InputTextEx(label, nullptr, buf, IM_ARRAYSIZE(buf), ImVec2(CalcItemWidth() - frame_size.x, label_size.y + style.FramePadding.y * 2.0F), flags))
|
||||||
value_changed = DataTypeApplyFromText(buf, type, value, format);
|
value_changed = DataTypeApplyFromText(buf, type, value, format);
|
||||||
|
|
||||||
if (value_changed)
|
if (value_changed)
|
||||||
@ -720,7 +720,7 @@ namespace ImGuiExt {
|
|||||||
const ImGuiStyle &style = g.Style;
|
const ImGuiStyle &style = g.Style;
|
||||||
|
|
||||||
ImVec2 pos = window->DC.CursorPos + ImVec2(0, yOffset);
|
ImVec2 pos = window->DC.CursorPos + ImVec2(0, yOffset);
|
||||||
ImVec2 size = CalcItemSize(ImVec2(100, 5) * hex::ImHexApi::System::getGlobalScale(), 100, g.FontSize + style.FramePadding.y * 2.0f);
|
ImVec2 size = CalcItemSize(ImVec2(100, 5) * hex::ImHexApi::System::getGlobalScale(), 100, g.FontSize + style.FramePadding.y * 2.0F);
|
||||||
ImRect bb(pos, pos + size);
|
ImRect bb(pos, pos + size);
|
||||||
ItemSize(size, 0);
|
ItemSize(size, 0);
|
||||||
if (!ItemAdd(bb, 0))
|
if (!ItemAdd(bb, 0))
|
||||||
@ -736,7 +736,7 @@ namespace ImGuiExt {
|
|||||||
auto time = (fmod(ImGui::GetTime() * 2, 1.8) - 0.4);
|
auto time = (fmod(ImGui::GetTime() * 2, 1.8) - 0.4);
|
||||||
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), ImSaturate(time), ImSaturate(time + 0.2), style.FrameRounding);
|
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), ImSaturate(time), ImSaturate(time + 0.2), style.FrameRounding);
|
||||||
} else {
|
} else {
|
||||||
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding);
|
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0F, fraction, style.FrameRounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,13 +765,13 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
|
|
||||||
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
||||||
const ImVec2 icon_frame_size = CalcTextSize(icon) + style.FramePadding * 2.0f;
|
const ImVec2 icon_frame_size = CalcTextSize(icon) + style.FramePadding * 2.0F;
|
||||||
const ImVec2 frame_size = CalcItemSize(ImVec2(0, 0), icon_frame_size.x, label_size.y + style.FramePadding.y * 2.0f);
|
const ImVec2 frame_size = CalcItemSize(ImVec2(0, 0), icon_frame_size.x, label_size.y + style.FramePadding.y * 2.0F);
|
||||||
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
|
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
|
||||||
|
|
||||||
SetCursorPosX(GetCursorPosX() + frame_size.x);
|
SetCursorPosX(GetCursorPosX() + frame_size.x);
|
||||||
|
|
||||||
bool value_changed = InputTextEx(label, nullptr, buffer.data(), buffer.size() + 1, ImVec2(CalcItemWidth(), label_size.y + style.FramePadding.y * 2.0f), ImGuiInputTextFlags_CallbackResize | flags, UpdateStringSizeCallback, &buffer);
|
bool value_changed = InputTextEx(label, nullptr, buffer.data(), buffer.size() + 1, ImVec2(CalcItemWidth(), label_size.y + style.FramePadding.y * 2.0F), ImGuiInputTextFlags_CallbackResize | flags, UpdateStringSizeCallback, &buffer);
|
||||||
|
|
||||||
if (value_changed)
|
if (value_changed)
|
||||||
MarkItemEdited(GImGui->LastItemData.ID);
|
MarkItemEdited(GImGui->LastItemData.ID);
|
||||||
@ -858,7 +858,7 @@ namespace ImGuiExt {
|
|||||||
RenderText(check_bb.Min + style.FramePadding, *v ? "1" : "0");
|
RenderText(check_bb.Min + style.FramePadding, *v ? "1" : "0");
|
||||||
|
|
||||||
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
|
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
|
||||||
if (label_size.x > 0.0f)
|
if (label_size.x > 0.0F)
|
||||||
RenderText(label_pos, label);
|
RenderText(label_pos, label);
|
||||||
|
|
||||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
|
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
|
||||||
@ -985,7 +985,7 @@ namespace ImGuiExt {
|
|||||||
void BeginSubWindow(const char *label, ImVec2 size, ImGuiChildFlags flags) {
|
void BeginSubWindow(const char *label, ImVec2 size, ImGuiChildFlags flags) {
|
||||||
const bool hasMenuBar = !std::string_view(label).empty();
|
const bool hasMenuBar = !std::string_view(label).empty();
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0F);
|
||||||
if (ImGui::BeginChild(hex::format("{}##SubWindow", label).c_str(), size, ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY | flags, hasMenuBar ? ImGuiWindowFlags_MenuBar : ImGuiWindowFlags_None)) {
|
if (ImGui::BeginChild(hex::format("{}##SubWindow", label).c_str(), size, ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY | flags, hasMenuBar ? ImGuiWindowFlags_MenuBar : ImGuiWindowFlags_None)) {
|
||||||
if (hasMenuBar && ImGui::BeginMenuBar()) {
|
if (hasMenuBar && ImGui::BeginMenuBar()) {
|
||||||
ImGui::TextUnformatted(label);
|
ImGui::TextUnformatted(label);
|
||||||
@ -1002,9 +1002,9 @@ namespace ImGuiExt {
|
|||||||
bool VSliderAngle(const char* label, const ImVec2& size, float* v_rad, float v_degrees_min, float v_degrees_max, const char* format, ImGuiSliderFlags flags) {
|
bool VSliderAngle(const char* label, const ImVec2& size, float* v_rad, float v_degrees_min, float v_degrees_max, const char* format, ImGuiSliderFlags flags) {
|
||||||
if (format == nullptr)
|
if (format == nullptr)
|
||||||
format = "%.0f deg";
|
format = "%.0f deg";
|
||||||
float v_deg = (*v_rad) * 360.0f / (2 * IM_PI);
|
float v_deg = (*v_rad) * 360.0F / (2 * IM_PI);
|
||||||
bool value_changed = ImGui::VSliderFloat(label, size, &v_deg, v_degrees_min, v_degrees_max, format, flags);
|
bool value_changed = ImGui::VSliderFloat(label, size, &v_deg, v_degrees_min, v_degrees_max, format, flags);
|
||||||
*v_rad = v_deg * (2 * IM_PI) / 360.0f;
|
*v_rad = v_deg * (2 * IM_PI) / 360.0F;
|
||||||
return value_changed;
|
return value_changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,7 +1052,7 @@ namespace ImGuiExt {
|
|||||||
|
|
||||||
const ImVec2 size = ImVec2(GetFrameHeight() * 2.0F, GetFrameHeight());
|
const ImVec2 size = ImVec2(GetFrameHeight() * 2.0F, GetFrameHeight());
|
||||||
const ImVec2 pos = window->DC.CursorPos;
|
const ImVec2 pos = window->DC.CursorPos;
|
||||||
const ImRect total_bb(pos, pos + ImVec2(size.x + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
|
const ImRect total_bb(pos, pos + ImVec2(size.x + (label_size.x > 0.0F ? style.ItemInnerSpacing.x + label_size.x : 0.0F), label_size.y + style.FramePadding.y * 2.0F));
|
||||||
ItemSize(total_bb, style.FramePadding.y);
|
ItemSize(total_bb, style.FramePadding.y);
|
||||||
if (!ItemAdd(total_bb, id))
|
if (!ItemAdd(total_bb, id))
|
||||||
{
|
{
|
||||||
@ -1080,7 +1080,7 @@ namespace ImGuiExt {
|
|||||||
ImVec2 label_pos = ImVec2(knob_bb.Max.x + style.ItemInnerSpacing.x, knob_bb.Min.y + style.FramePadding.y);
|
ImVec2 label_pos = ImVec2(knob_bb.Max.x + style.ItemInnerSpacing.x, knob_bb.Min.y + style.FramePadding.y);
|
||||||
if (g.LogEnabled)
|
if (g.LogEnabled)
|
||||||
LogRenderedText(&label_pos, *v ? "((*) )" : "( (*))");
|
LogRenderedText(&label_pos, *v ? "((*) )" : "( (*))");
|
||||||
if (label_size.x > 0.0f)
|
if (label_size.x > 0.0F)
|
||||||
RenderText(label_pos, label);
|
RenderText(label_pos, label);
|
||||||
|
|
||||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
|
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
|
||||||
|
@ -515,7 +515,7 @@ namespace hex {
|
|||||||
|
|
||||||
// Return the highest entropy value among all of the blocks
|
// Return the highest entropy value among all of the blocks
|
||||||
double getHighestEntropyBlockValue() {
|
double getHighestEntropyBlockValue() {
|
||||||
double result = 0.0f;
|
double result = 0.0F;
|
||||||
if (!m_yBlockEntropy.empty())
|
if (!m_yBlockEntropy.empty())
|
||||||
result = *std::ranges::max_element(m_yBlockEntropy);
|
result = *std::ranges::max_element(m_yBlockEntropy);
|
||||||
return result;
|
return result;
|
||||||
@ -531,7 +531,7 @@ namespace hex {
|
|||||||
|
|
||||||
// Return the highest entropy value among all of the blocks
|
// Return the highest entropy value among all of the blocks
|
||||||
double getLowestEntropyBlockValue() {
|
double getLowestEntropyBlockValue() {
|
||||||
double result = 0.0f;
|
double result = 0.0F;
|
||||||
if (m_yBlockEntropy.size() > 1)
|
if (m_yBlockEntropy.size() > 1)
|
||||||
result = *std::min_element(m_yBlockEntropy.begin(), m_yBlockEntropy.end() - 1);
|
result = *std::min_element(m_yBlockEntropy.begin(), m_yBlockEntropy.end() - 1);
|
||||||
return result;
|
return result;
|
||||||
|
@ -63,10 +63,10 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
static auto drawBitsSlider = [&](BitValue *bitValue) {
|
static auto drawBitsSlider = [&](BitValue *bitValue) {
|
||||||
// Change slider color
|
// Change slider color
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImColor::HSV(bitValue->color, 0.5f * bitValue->saturationMultiplier, 0.5f).Value);
|
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImColor::HSV(bitValue->color, 0.5F * bitValue->saturationMultiplier, 0.5F).Value);
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImColor::HSV(bitValue->color, 0.6f * bitValue->saturationMultiplier, 0.5f).Value);
|
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImColor::HSV(bitValue->color, 0.6F * bitValue->saturationMultiplier, 0.5F).Value);
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImColor::HSV(bitValue->color, 0.7f * bitValue->saturationMultiplier, 0.5f).Value);
|
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImColor::HSV(bitValue->color, 0.7F * bitValue->saturationMultiplier, 0.5F).Value);
|
||||||
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImColor::HSV(bitValue->color, 0.9f * bitValue->saturationMultiplier, 0.9f).Value);
|
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImColor::HSV(bitValue->color, 0.9F * bitValue->saturationMultiplier, 0.9F).Value);
|
||||||
|
|
||||||
// Draw slider
|
// Draw slider
|
||||||
ImGui::PushID(&bitValue->bits);
|
ImGui::PushID(&bitValue->bits);
|
||||||
@ -91,7 +91,7 @@ namespace hex::plugin::builtin {
|
|||||||
ImGui::SetDragDropPayload("BIT_VALUE", &index, sizeof(u32));
|
ImGui::SetDragDropPayload("BIT_VALUE", &index, sizeof(u32));
|
||||||
|
|
||||||
// Draw a color button to show the color being dragged
|
// Draw a color button to show the color being dragged
|
||||||
ImGui::ColorButton("##color_button", ImColor::HSV(bitValue.color, 0.5f * bitValue.saturationMultiplier, 0.5f).Value);
|
ImGui::ColorButton("##color_button", ImColor::HSV(bitValue.color, 0.5F * bitValue.saturationMultiplier, 0.5F).Value);
|
||||||
|
|
||||||
ImGui::EndDragDropSource();
|
ImGui::EndDragDropSource();
|
||||||
}
|
}
|
||||||
|
@ -118,25 +118,25 @@ namespace hex::plugin::builtin {
|
|||||||
ImGuiTableFlags_ScrollX | ImGuiTableFlags_NoPadInnerX;
|
ImGuiTableFlags_ScrollX | ImGuiTableFlags_NoPadInnerX;
|
||||||
|
|
||||||
const static auto IndentBoxOrLabel = [](u32 startBit, u32 bitIndex, u32 count, bool isLabel) {
|
const static auto IndentBoxOrLabel = [](u32 startBit, u32 bitIndex, u32 count, bool isLabel) {
|
||||||
auto checkBoxWidth = ImGui::CalcTextSize("0").x + ImGui::GetStyle().FramePadding.x * 2.0f;
|
auto checkBoxWidth = ImGui::CalcTextSize("0").x + ImGui::GetStyle().FramePadding.x * 2.0F;
|
||||||
auto columnWidth = ImGui::GetColumnWidth();
|
auto columnWidth = ImGui::GetColumnWidth();
|
||||||
float boxesPerColumn=columnWidth/checkBoxWidth;
|
float boxesPerColumn=columnWidth/checkBoxWidth;
|
||||||
float result;
|
float result;
|
||||||
if (isLabel) {
|
if (isLabel) {
|
||||||
std::string labelString = fmt::format("{}", bitIndex);
|
std::string labelString = fmt::format("{}", bitIndex);
|
||||||
auto labelWidth = ImGui::CalcTextSize(labelString.c_str()).x;
|
auto labelWidth = ImGui::CalcTextSize(labelString.c_str()).x;
|
||||||
auto leadingBoxes = (boxesPerColumn-count)/2.0f;
|
auto leadingBoxes = (boxesPerColumn-count) / 2.0F;
|
||||||
if (leadingBoxes < 0.0f)
|
if (leadingBoxes < 0.0F)
|
||||||
leadingBoxes = 0.0f;
|
leadingBoxes = 0.0F;
|
||||||
result = checkBoxWidth*(leadingBoxes + startBit - bitIndex + 0.5f)-labelWidth/2.0f;
|
result = checkBoxWidth*(leadingBoxes + startBit - bitIndex + 0.5F) - labelWidth / 2.0F;
|
||||||
} else {
|
} else {
|
||||||
if (count < boxesPerColumn)
|
if (count < boxesPerColumn)
|
||||||
result = (columnWidth - count * checkBoxWidth) / 2.0f;
|
result = (columnWidth - count * checkBoxWidth) / 2.0F;
|
||||||
else
|
else
|
||||||
result = 0.0;
|
result = 0.0F;
|
||||||
}
|
}
|
||||||
if (result <= 0.0f)
|
if (result <= 0.0F)
|
||||||
result = 0.05;
|
result = 0.05F;
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
const static auto BitCheckbox = [](u8 bit) {
|
const static auto BitCheckbox = [](u8 bit) {
|
||||||
bool checkbox = false;
|
bool checkbox = false;
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0F);
|
||||||
checkbox = (ieee754statics.value & (u128(1) << bit)) != 0;
|
checkbox = (ieee754statics.value & (u128(1) << bit)) != 0;
|
||||||
ImGuiExt::BitCheckbox("##checkbox", &checkbox);
|
ImGuiExt::BitCheckbox("##checkbox", &checkbox);
|
||||||
ieee754statics.value = (ieee754statics.value & ~(u128(1) << bit)) | (u128(checkbox) << bit);
|
ieee754statics.value = (ieee754statics.value & ~(u128(1) << bit)) | (u128(checkbox) << bit);
|
||||||
@ -642,7 +642,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
auto style = ImGui::GetStyle();
|
auto style = ImGui::GetStyle();
|
||||||
inputFieldWidth = std::fmax(inputFieldWidth,
|
inputFieldWidth = std::fmax(inputFieldWidth,
|
||||||
ImGui::CalcTextSize(maskString.c_str()).x + style.FramePadding.x * 2.0f);
|
ImGui::CalcTextSize(maskString.c_str()).x + style.FramePadding.x * 2.0F);
|
||||||
ImGui::PushItemWidth(inputFieldWidth);
|
ImGui::PushItemWidth(inputFieldWidth);
|
||||||
|
|
||||||
u64 newValue = ieee754statics.value & mask;
|
u64 newValue = ieee754statics.value & mask;
|
||||||
|
@ -158,7 +158,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
bool enabled = section->isEnabled();
|
bool enabled = section->isEnabled();
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0F);
|
||||||
if (ImGui::BeginChild(Lang(section->getUnlocalizedName()), ImVec2(0, 0), ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY, ImGuiWindowFlags_MenuBar)) {
|
if (ImGui::BeginChild(Lang(section->getUnlocalizedName()), ImVec2(0, 0), ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY, ImGuiWindowFlags_MenuBar)) {
|
||||||
if (ImGui::BeginMenuBar()) {
|
if (ImGui::BeginMenuBar()) {
|
||||||
|
|
||||||
|
@ -326,13 +326,13 @@ namespace hex::plugin::builtin {
|
|||||||
labelSize.y + style.FramePadding.y * 2.0F + style.WindowPadding.y + 3 });
|
labelSize.y + style.FramePadding.y * 2.0F + style.WindowPadding.y + 3 });
|
||||||
|
|
||||||
// 2 * 11 spacings in between elements
|
// 2 * 11 spacings in between elements
|
||||||
popupSize.x += style.FramePadding.x * 22.0f;
|
popupSize.x += style.FramePadding.x * 22.0F;
|
||||||
|
|
||||||
// Text input fields are set to 12 characters wide
|
// Text input fields are set to 12 characters wide
|
||||||
popupSize.x += ImGui::GetFontSize() * 12.0f;
|
popupSize.x += ImGui::GetFontSize() * 12.0F;
|
||||||
|
|
||||||
// IndexOfCount text
|
// IndexOfCount text
|
||||||
popupSize.x += ImGui::CalcTextSize("2000 of 2000").x + 2.0f;
|
popupSize.x += ImGui::CalcTextSize("2000 of 2000").x + 2.0F;
|
||||||
popupSize.x += scrollbarSize;
|
popupSize.x += scrollbarSize;
|
||||||
|
|
||||||
// Position of popup relative to parent window
|
// Position of popup relative to parent window
|
||||||
|
@ -807,7 +807,7 @@ namespace hex::ui {
|
|||||||
|
|
||||||
if (ImGui::BeginChild("##footer", size, false, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
|
if (ImGui::BeginChild("##footer", size, false, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
|
||||||
if (ImGui::BeginTable("##footer_table", 3, ImGuiTableFlags_SizingFixedFit)) {
|
if (ImGui::BeginTable("##footer_table", 3, ImGuiTableFlags_SizingFixedFit)) {
|
||||||
ImGui::TableSetupColumn("Left", ImGuiTableColumnFlags_WidthStretch, 0.5f);
|
ImGui::TableSetupColumn("Left", ImGuiTableColumnFlags_WidthStretch, 0.5F);
|
||||||
ImGui::TableSetupColumn("Center", ImGuiTableColumnFlags_WidthFixed, 20_scaled);
|
ImGui::TableSetupColumn("Center", ImGuiTableColumnFlags_WidthFixed, 20_scaled);
|
||||||
ImGui::TableSetupColumn("Right", ImGuiTableColumnFlags_WidthStretch, 0.5F);
|
ImGui::TableSetupColumn("Right", ImGuiTableColumnFlags_WidthStretch, 0.5F);
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
|
@ -33,7 +33,7 @@ void main() {
|
|||||||
float specular = vertexData.lightBrightness.z * reflectionIntensity;
|
float specular = vertexData.lightBrightness.z * reflectionIntensity;
|
||||||
|
|
||||||
float dst = distance(vertexData.lightPosition, vertexData.fragPosition);
|
float dst = distance(vertexData.lightPosition, vertexData.fragPosition);
|
||||||
float attn = 1./(1.0f + 0.1f*dst + 0.01f*dst*dst) ;
|
float attn = 1./(1.0F + 0.1F*dst + 0.01f*dst*dst) ;
|
||||||
vec3 color = ((diffuse + specular)*attn + ambient) * vertexData.lightColor;
|
vec3 color = ((diffuse + specular)*attn + ambient) * vertexData.lightColor;
|
||||||
outColor = (texture(modelTexture, vertexData.texCoord) + vertexData.fragColor) * vec4(color, 1.0);
|
outColor = (texture(modelTexture, vertexData.texCoord) + vertexData.fragColor) * vec4(color, 1.0);
|
||||||
}
|
}
|
||||||
|
@ -18,5 +18,5 @@ void main() {
|
|||||||
float diffuse = dotLN * 0.5;
|
float diffuse = dotLN * 0.5;
|
||||||
|
|
||||||
vec3 color = (diffuse+0.7)*vertexData.color.xyz;
|
vec3 color = (diffuse+0.7)*vertexData.color.xyz;
|
||||||
outColor = vec4(color, 1.0f);
|
outColor = vec4(color, 1.0F);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ namespace hex::plugin::visualizers {
|
|||||||
gl::Vector<float, 3> s_rotation = { { 0.0F, 0.0F, 0.0F } };
|
gl::Vector<float, 3> s_rotation = { { 0.0F, 0.0F, 0.0F } };
|
||||||
gl::Vector<float, 3> s_lightPosition = { { -0.7F, 0.0F, 0.0F } };
|
gl::Vector<float, 3> s_lightPosition = { { -0.7F, 0.0F, 0.0F } };
|
||||||
gl::Vector<float, 4> s_lightBrightness = { { 0.5F, 0.5F, 0.5F, 32.0F } };
|
gl::Vector<float, 4> s_lightBrightness = { { 0.5F, 0.5F, 0.5F, 32.0F } };
|
||||||
gl::Vector<float, 3> s_lightColor = { { 1.0F, 1.0F, 1.0f } };
|
gl::Vector<float, 3> s_lightColor = { { 1.0F, 1.0F, 1.0F } };
|
||||||
gl::Matrix<float, 4, 4> s_rotate = gl::Matrix<float, 4, 4>::identity();
|
gl::Matrix<float, 4, 4> s_rotate = gl::Matrix<float, 4, 4>::identity();
|
||||||
|
|
||||||
ImGuiExt::Texture s_texture;
|
ImGuiExt::Texture s_texture;
|
||||||
@ -140,10 +140,10 @@ namespace hex::plugin::visualizers {
|
|||||||
gl::Vector<float, 4> minCamera = minWorld, maxCamera = maxWorld;
|
gl::Vector<float, 4> minCamera = minWorld, maxCamera = maxWorld;
|
||||||
|
|
||||||
if (maxCamera[3] != 0)
|
if (maxCamera[3] != 0)
|
||||||
maxCamera = maxCamera * (1.0f / maxCamera[3]);
|
maxCamera = maxCamera * (1.0F / maxCamera[3]);
|
||||||
|
|
||||||
if (minCamera[3] != 0)
|
if (minCamera[3] != 0)
|
||||||
minCamera = minCamera * (1.0f / minCamera[3]);
|
minCamera = minCamera * (1.0F / minCamera[3]);
|
||||||
|
|
||||||
float maxx = std::max(std::fabs(minCamera[0]), std::fabs(maxCamera[0]));
|
float maxx = std::max(std::fabs(minCamera[0]), std::fabs(maxCamera[0]));
|
||||||
float maxy = std::max(std::fabs(minCamera[1]), std::fabs(maxCamera[1]));
|
float maxy = std::max(std::fabs(minCamera[1]), std::fabs(maxCamera[1]));
|
||||||
@ -445,21 +445,21 @@ namespace hex::plugin::visualizers {
|
|||||||
|
|
||||||
if (s_drawAxes) {
|
if (s_drawAxes) {
|
||||||
gl::Matrix<float, 4, 4> axes = gl::Matrix<float, 4, 4>::identity();
|
gl::Matrix<float, 4, 4> axes = gl::Matrix<float, 4, 4>::identity();
|
||||||
axes(0, 3) = 1.0f;
|
axes(0, 3) = 1.0F;
|
||||||
axes(1, 3) = 1.0f;
|
axes(1, 3) = 1.0F;
|
||||||
axes(2, 3) = 1.0f;
|
axes(2, 3) = 1.0F;
|
||||||
|
|
||||||
axes = axes * mvp;
|
axes = axes * mvp;
|
||||||
bool showX = axes(0, 3) > 0.0f;
|
bool showX = axes(0, 3) > 0.0F;
|
||||||
bool showY = axes(1, 3) > 0.0f;
|
bool showY = axes(1, 3) > 0.0F;
|
||||||
bool showZ = axes(2, 3) > 0.0f;
|
bool showZ = axes(2, 3) > 0.0F;
|
||||||
|
|
||||||
axes.updateRow(0, axes.getRow(0) * (1.0f / axes(0, 3)));
|
axes.updateRow(0, axes.getRow(0) * (1.0F / axes(0, 3)));
|
||||||
axes.updateRow(1, axes.getRow(1) * (1.0f / axes(1, 3)));
|
axes.updateRow(1, axes.getRow(1) * (1.0F / axes(1, 3)));
|
||||||
axes.updateRow(2, axes.getRow(2) * (1.0f / axes(2, 3)));
|
axes.updateRow(2, axes.getRow(2) * (1.0F / axes(2, 3)));
|
||||||
|
|
||||||
auto axesPosx = (axes.getColumn(0) + 1.0f) * (textureWidth / 2.0f);
|
auto axesPosx = (axes.getColumn(0) + 1.0F) * (textureWidth / 2.0F);
|
||||||
auto axesPosy = (axes.getColumn(1) + 1.0f) * (-textureHeight / 2.0f) + textureHeight;
|
auto axesPosy = (axes.getColumn(1) + 1.0F) * (-textureHeight / 2.0F) + textureHeight;
|
||||||
|
|
||||||
ImDrawList *drawList = ImGui::GetWindowDrawList();
|
ImDrawList *drawList = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
@ -727,8 +727,8 @@ namespace hex::plugin::visualizers {
|
|||||||
gl::Matrix<float, 4, 4> translate = gl::Matrix<float, 4, 4>::identity();
|
gl::Matrix<float, 4, 4> translate = gl::Matrix<float, 4, 4>::identity();
|
||||||
|
|
||||||
float totalScale;
|
float totalScale;
|
||||||
float viewWidth = s_renderingWindowSize.x / 500.0f;
|
float viewWidth = s_renderingWindowSize.x / 500.0F;
|
||||||
float viewHeight = s_renderingWindowSize.y / 500.0f;
|
float viewHeight = s_renderingWindowSize.y / 500.0F;
|
||||||
glViewport(0,0 , GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
|
glViewport(0,0 , GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
|
||||||
glDepthRangef(s_nearLimit, s_farLimit);
|
glDepthRangef(s_nearLimit, s_farLimit);
|
||||||
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
|
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
|
||||||
@ -757,7 +757,7 @@ namespace hex::plugin::visualizers {
|
|||||||
translate(3, 1) = s_translation[1];
|
translate(3, 1) = s_translation[1];
|
||||||
translate(3, 2) = s_translation[2];
|
translate(3, 2) = s_translation[2];
|
||||||
}
|
}
|
||||||
totalScale /= (3.0f * s_max);
|
totalScale /= (3.0F * s_max);
|
||||||
scaleForVertices(0, 0) = totalScale;
|
scaleForVertices(0, 0) = totalScale;
|
||||||
scaleForVertices(1, 1) = totalScale;
|
scaleForVertices(1, 1) = totalScale;
|
||||||
scaleForVertices(2, 2) = totalScale;
|
scaleForVertices(2, 2) = totalScale;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user