|
|
@ -1726,38 +1726,6 @@ void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float&
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
ImVec4 c = style.Colors[idx];
|
|
|
|
|
|
|
|
c.w *= style.Alpha * alpha_mul;
|
|
|
|
|
|
|
|
return ColorConvertFloat4ToU32(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(const ImVec4& col)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
ImVec4 c = col;
|
|
|
|
|
|
|
|
c.w *= style.Alpha;
|
|
|
|
|
|
|
|
return ColorConvertFloat4ToU32(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
return style.Colors[idx];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(ImU32 col)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float style_alpha = GImGui->Style.Alpha;
|
|
|
|
|
|
|
|
if (style_alpha >= 1.0f)
|
|
|
|
|
|
|
|
return col;
|
|
|
|
|
|
|
|
ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT;
|
|
|
|
|
|
|
|
a = (ImU32)(a * style_alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range.
|
|
|
|
|
|
|
|
return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// [SECTION] ImGuiStorage
|
|
|
|
// [SECTION] ImGuiStorage
|
|
|
|
// Helper: Key->value storage
|
|
|
|
// Helper: Key->value storage
|
|
|
@ -2215,10 +2183,42 @@ bool ImGuiListClipper::Step()
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// [SECTION] RENDER HELPERS
|
|
|
|
// [SECTION] RENDER HELPERS
|
|
|
|
// Those (internal) functions are currently quite a legacy mess - their signature and behavior will change.
|
|
|
|
// Some of those (internal) functions are currently quite a legacy mess - their signature and behavior will change.
|
|
|
|
// Also see imgui_draw.cpp for some more which have been reworked to not rely on ImGui:: state.
|
|
|
|
// Also see imgui_draw.cpp for some more which have been reworked to not rely on ImGui:: state.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
ImVec4 c = style.Colors[idx];
|
|
|
|
|
|
|
|
c.w *= style.Alpha * alpha_mul;
|
|
|
|
|
|
|
|
return ColorConvertFloat4ToU32(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(const ImVec4& col)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
ImVec4 c = col;
|
|
|
|
|
|
|
|
c.w *= style.Alpha;
|
|
|
|
|
|
|
|
return ColorConvertFloat4ToU32(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
return style.Colors[idx];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImU32 ImGui::GetColorU32(ImU32 col)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGuiStyle& style = GImGui->Style;
|
|
|
|
|
|
|
|
if (style.Alpha >= 1.0f)
|
|
|
|
|
|
|
|
return col;
|
|
|
|
|
|
|
|
ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT;
|
|
|
|
|
|
|
|
a = (ImU32)(a * style.Alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range.
|
|
|
|
|
|
|
|
return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end)
|
|
|
|
const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const char* text_display_end = text;
|
|
|
|
const char* text_display_end = text;
|
|
|
|