mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-07-07 06:52:15 +08:00
Moved colored implementation to their own functions
To minimise source code modifications, colored input text has been moved to their own functions. The ImFont is still modified tho.
This commit is contained in:
@ -2816,8 +2816,6 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
|
||||
void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
|
||||
{
|
||||
ImU32 color_bkp = col;
|
||||
|
||||
if (!text_end)
|
||||
text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
|
||||
|
||||
@ -2876,10 +2874,10 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
if (*s == 1)
|
||||
{
|
||||
++s;
|
||||
|
||||
|
||||
unsigned char color[4];
|
||||
|
||||
for (int i = 0; i < 4; ++i, s+=2)
|
||||
for (int i = 0; i < 4; ++i, s += 2)
|
||||
{
|
||||
if (s[0] >= '0' && s[0] <= '9')
|
||||
color[i] = (s[0] - '0') * 16;
|
||||
|
Reference in New Issue
Block a user