Skip to content

Commit 49f4c36

Browse files
JordanTheToasterlightningterror
authored andcommitted
3rdparty: Update ImGui to 1.92.2b
1 parent 4b08672 commit 49f4c36

File tree

9 files changed

+8096
-282
lines changed

9 files changed

+8096
-282
lines changed

3rdparty/imgui/CHANGELOG.txt

Lines changed: 7687 additions & 0 deletions
Large diffs are not rendered by default.

3rdparty/imgui/include/imgui.h

Lines changed: 45 additions & 31 deletions
Large diffs are not rendered by default.

3rdparty/imgui/include/imgui_internal.h

Lines changed: 69 additions & 66 deletions
Large diffs are not rendered by default.

3rdparty/imgui/src/imgui.cpp

Lines changed: 177 additions & 100 deletions
Large diffs are not rendered by default.

3rdparty/imgui/src/imgui_demo.cpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.92.1
1+
// dear imgui, v1.92.2b
22
// (demo code)
33

44
// Help:
@@ -2170,7 +2170,7 @@ static void DemoWindowWidgetsQueryingStatuses()
21702170
);
21712171
ImGui::BulletText(
21722172
"with Hovering Delay or Stationary test:\n"
2173-
"IsItemHovered() = = %d\n"
2173+
"IsItemHovered() = %d\n"
21742174
"IsItemHovered(_Stationary) = %d\n"
21752175
"IsItemHovered(_DelayShort) = %d\n"
21762176
"IsItemHovered(_DelayNormal) = %d\n"
@@ -3379,6 +3379,18 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
33793379
// [SECTION] DemoWindowWidgetsTabs()
33803380
//-----------------------------------------------------------------------------
33813381

3382+
static void EditTabBarFittingPolicyFlags(ImGuiTabBarFlags* p_flags)
3383+
{
3384+
if ((*p_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0)
3385+
*p_flags |= ImGuiTabBarFlags_FittingPolicyDefault_;
3386+
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyMixed", p_flags, ImGuiTabBarFlags_FittingPolicyMixed))
3387+
*p_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyMixed);
3388+
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyShrink", p_flags, ImGuiTabBarFlags_FittingPolicyShrink))
3389+
*p_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyShrink);
3390+
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", p_flags, ImGuiTabBarFlags_FittingPolicyScroll))
3391+
*p_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll);
3392+
}
3393+
33823394
static void DemoWindowWidgetsTabs()
33833395
{
33843396
IMGUI_DEMO_MARKER("Widgets/Tabs");
@@ -3421,12 +3433,7 @@ static void DemoWindowWidgetsTabs()
34213433
ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", &tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton);
34223434
ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", &tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton);
34233435
ImGui::CheckboxFlags("ImGuiTabBarFlags_DrawSelectedOverline", &tab_bar_flags, ImGuiTabBarFlags_DrawSelectedOverline);
3424-
if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0)
3425-
tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_;
3426-
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown))
3427-
tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyResizeDown);
3428-
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyScroll))
3429-
tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll);
3436+
EditTabBarFittingPolicyFlags(&tab_bar_flags);
34303437

34313438
// Tab Bar
34323439
ImGui::AlignTextToFramePadding();
@@ -3475,12 +3482,8 @@ static void DemoWindowWidgetsTabs()
34753482
ImGui::Checkbox("Show Trailing TabItemButton()", &show_trailing_button);
34763483

34773484
// Expose some other flags which are useful to showcase how they interact with Leading/Trailing tabs
3478-
static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_AutoSelectNewTabs | ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_FittingPolicyResizeDown;
3479-
ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", &tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton);
3480-
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown))
3481-
tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyResizeDown);
3482-
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyScroll))
3483-
tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll);
3485+
static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_AutoSelectNewTabs | ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_FittingPolicyShrink;
3486+
EditTabBarFittingPolicyFlags(&tab_bar_flags);
34843487

34853488
if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags))
34863489
{
@@ -8096,6 +8099,9 @@ void ImGui::ShowAboutWindow(bool* p_open)
80968099
ImGui::Separator();
80978100
ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert));
80988101
ImGui::Text("define: __cplusplus=%d", (int)__cplusplus);
8102+
#ifdef IMGUI_ENABLE_TEST_ENGINE
8103+
ImGui::Text("define: IMGUI_ENABLE_TEST_ENGINE");
8104+
#endif
80998105
#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
81008106
ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
81018107
#endif
@@ -8341,8 +8347,10 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
83418347
SliderFloat("TabBarBorderSize", &style.TabBarBorderSize, 0.0f, 2.0f, "%.0f");
83428348
SliderFloat("TabBarOverlineSize", &style.TabBarOverlineSize, 0.0f, 3.0f, "%.0f");
83438349
SameLine(); HelpMarker("Overline is only drawn over the selected tab when ImGuiTabBarFlags_DrawSelectedOverline is set.");
8344-
DragFloat("TabCloseButtonMinWidthSelected", &style.TabCloseButtonMinWidthSelected, 0.1f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthSelected < 0.0f) ? "%.0f (Always)" : "%.0f");
8345-
DragFloat("TabCloseButtonMinWidthUnselected", &style.TabCloseButtonMinWidthUnselected, 0.1f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthUnselected < 0.0f) ? "%.0f (Always)" : "%.0f");
8350+
DragFloat("TabMinWidthBase", &style.TabMinWidthBase, 0.5f, 1.0f, 500.0f, "%.0f");
8351+
DragFloat("TabMinWidthShrink", &style.TabMinWidthShrink, 0.5f, 1.0f, 500.0f, "%0.f");
8352+
DragFloat("TabCloseButtonMinWidthSelected", &style.TabCloseButtonMinWidthSelected, 0.5f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthSelected < 0.0f) ? "%.0f (Always)" : "%.0f");
8353+
DragFloat("TabCloseButtonMinWidthUnselected", &style.TabCloseButtonMinWidthUnselected, 0.5f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthUnselected < 0.0f) ? "%.0f (Always)" : "%.0f");
83468354
SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f");
83478355

83488356
SeparatorText("Tables");

3rdparty/imgui/src/imgui_draw.cpp

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.92.1
1+
// dear imgui, v1.92.2b
22
// (drawing and font code)
33

44
/*
@@ -2312,17 +2312,16 @@ void ImDrawData::DeIndexAllBuffers()
23122312
{
23132313
ImVector<ImDrawVert> new_vtx_buffer;
23142314
TotalVtxCount = TotalIdxCount = 0;
2315-
for (int i = 0; i < CmdListsCount; i++)
2315+
for (ImDrawList* draw_list : CmdLists)
23162316
{
2317-
ImDrawList* cmd_list = CmdLists[i];
2318-
if (cmd_list->IdxBuffer.empty())
2317+
if (draw_list->IdxBuffer.empty())
23192318
continue;
2320-
new_vtx_buffer.resize(cmd_list->IdxBuffer.Size);
2321-
for (int j = 0; j < cmd_list->IdxBuffer.Size; j++)
2322-
new_vtx_buffer[j] = cmd_list->VtxBuffer[cmd_list->IdxBuffer[j]];
2323-
cmd_list->VtxBuffer.swap(new_vtx_buffer);
2324-
cmd_list->IdxBuffer.resize(0);
2325-
TotalVtxCount += cmd_list->VtxBuffer.Size;
2319+
new_vtx_buffer.resize(draw_list->IdxBuffer.Size);
2320+
for (int j = 0; j < draw_list->IdxBuffer.Size; j++)
2321+
new_vtx_buffer[j] = draw_list->VtxBuffer[draw_list->IdxBuffer[j]];
2322+
draw_list->VtxBuffer.swap(new_vtx_buffer);
2323+
draw_list->IdxBuffer.resize(0);
2324+
TotalVtxCount += draw_list->VtxBuffer.Size;
23262325
}
23272326
}
23282327

@@ -2457,8 +2456,10 @@ const char* ImTextureDataGetFormatName(ImTextureFormat format)
24572456

24582457
void ImTextureData::Create(ImTextureFormat format, int w, int h)
24592458
{
2459+
IM_ASSERT(Status == ImTextureStatus_Destroyed);
24602460
DestroyPixels();
24612461
Format = format;
2462+
Status = ImTextureStatus_WantCreate;
24622463
Width = w;
24632464
Height = h;
24642465
BytesPerPixel = ImTextureDataGetFormatBytesPerPixel(format);
@@ -2630,6 +2631,7 @@ ImFontAtlas::ImFontAtlas()
26302631
TexMinHeight = 128;
26312632
TexMaxWidth = 8192;
26322633
TexMaxHeight = 8192;
2634+
TexRef._TexID = ImTextureID_Invalid;
26332635
RendererHasTextures = false; // Assumed false by default, as apps can call e.g Atlas::Build() after backend init and before ImGui can update.
26342636
TexNextUniqueID = 1;
26352637
FontNextUniqueID = 1;
@@ -2739,10 +2741,9 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool rendere
27392741
if (atlas->Builder == NULL) // This will only happen if fonts were not already loaded.
27402742
ImFontAtlasBuildMain(atlas);
27412743
}
2742-
else // Legacy backend
2743-
{
2744+
// Legacy backend
2745+
if (!atlas->RendererHasTextures)
27442746
IM_ASSERT_USER_ERROR(atlas->TexIsBuilt, "Backend does not support ImGuiBackendFlags_RendererHasTextures, and font atlas is not built! Update backend OR make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8().");
2745-
}
27462747
if (atlas->TexIsBuilt && atlas->Builder->PreloadedAllGlyphsRanges)
27472748
IM_ASSERT_USER_ERROR(atlas->RendererHasTextures == false, "Called ImFontAtlas::Build() before ImGuiBackendFlags_RendererHasTextures got set! With new backends: you don't need to call Build().");
27482749

@@ -2797,8 +2798,9 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool rendere
27972798
}
27982799
else if (tex->WantDestroyNextFrame && tex->Status != ImTextureStatus_WantDestroy)
27992800
{
2800-
// Request destroy. Keep bool as it allows us to keep track of things.
2801-
// We don't destroy pixels right away, as backend may have an in-flight copy from RAM.
2801+
// Request destroy.
2802+
// - Keep bool to true in order to differentiate a planned destroy vs a destroy decided by the backend.
2803+
// - We don't destroy pixels right away, as backend may have an in-flight copy from RAM.
28022804
IM_ASSERT(tex->Status == ImTextureStatus_OK || tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates);
28032805
tex->Status = ImTextureStatus_WantDestroy;
28042806
}
@@ -2954,7 +2956,7 @@ void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex,
29542956
tex->UsedRect.h = (unsigned short)(ImMax(tex->UsedRect.y + tex->UsedRect.h, req.y + req.h) - tex->UsedRect.y);
29552957
atlas->TexIsBuilt = false;
29562958

2957-
// No need to queue if status is _WantCreate
2959+
// No need to queue if status is == ImTextureStatus_WantCreate
29582960
if (tex->Status == ImTextureStatus_OK || tex->Status == ImTextureStatus_WantUpdates)
29592961
{
29602962
tex->Status = ImTextureStatus_WantUpdates;
@@ -3361,11 +3363,7 @@ void ImFontAtlasBuildMain(ImFontAtlas* atlas)
33613363
{
33623364
IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!");
33633365
if (atlas->TexData && atlas->TexData->Format != atlas->TexDesiredFormat)
3364-
{
3365-
ImVec2i new_tex_size = ImFontAtlasTextureGetSizeEstimate(atlas);
3366-
ImFontAtlasBuildDestroy(atlas);
3367-
ImFontAtlasTextureAdd(atlas, new_tex_size.x, new_tex_size.y);
3368-
}
3366+
ImFontAtlasBuildClear(atlas);
33693367

33703368
if (atlas->Builder == NULL)
33713369
ImFontAtlasBuildInit(atlas);
@@ -3971,7 +3969,6 @@ ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h)
39713969
}
39723970

39733971
new_tex->Create(atlas->TexDesiredFormat, w, h);
3974-
new_tex->Status = ImTextureStatus_WantCreate;
39753972
atlas->TexIsBuilt = false;
39763973

39773974
ImFontAtlasBuildSetTexture(atlas, new_tex);
@@ -4375,6 +4372,7 @@ ImTextureRect* ImFontAtlasPackGetRectSafe(ImFontAtlas* atlas, ImFontAtlasRectId
43754372
if (atlas->Builder == NULL)
43764373
ImFontAtlasBuildInit(atlas);
43774374
ImFontAtlasBuilder* builder = (ImFontAtlasBuilder*)atlas->Builder;
4375+
IM_MSVC_WARNING_SUPPRESS(28182); // Static Analysis false positive "warning C28182: Dereferencing NULL pointer 'builder'"
43784376
if (index_idx >= builder->RectsIndex.Size)
43794377
return NULL;
43804378
ImFontAtlasRectEntry* index_entry = &builder->RectsIndex[index_idx];
@@ -4417,7 +4415,7 @@ static ImFontGlyph* ImFontBaked_BuildLoadGlyph(ImFontBaked* baked, ImWchar codep
44174415
if (atlas->Locked || (font->Flags & ImFontFlags_NoLoadGlyphs))
44184416
{
44194417
// Lazily load fallback glyph
4420-
if (baked->FallbackGlyphIndex == -1 && baked->LockLoadingFallback == 0)
4418+
if (baked->FallbackGlyphIndex == -1 && baked->LoadNoFallback == 0)
44214419
ImFontAtlasBuildSetupFontBakedFallback(baked);
44224420
return NULL;
44234421
}
@@ -4469,7 +4467,7 @@ static ImFontGlyph* ImFontBaked_BuildLoadGlyph(ImFontBaked* baked, ImWchar codep
44694467
}
44704468

44714469
// Lazily load fallback glyph
4472-
if (baked->LockLoadingFallback)
4470+
if (baked->LoadNoFallback)
44734471
return NULL;
44744472
if (baked->FallbackGlyphIndex == -1)
44754473
ImFontAtlasBuildSetupFontBakedFallback(baked);
@@ -4483,7 +4481,7 @@ static ImFontGlyph* ImFontBaked_BuildLoadGlyph(ImFontBaked* baked, ImWchar codep
44834481

44844482
static float ImFontBaked_BuildLoadGlyphAdvanceX(ImFontBaked* baked, ImWchar codepoint)
44854483
{
4486-
if (baked->Size >= IMGUI_FONT_SIZE_THRESHOLD_FOR_LOADADVANCEXONLYMODE)
4484+
if (baked->Size >= IMGUI_FONT_SIZE_THRESHOLD_FOR_LOADADVANCEXONLYMODE || baked->LoadNoRenderOnLayout)
44874485
{
44884486
// First load AdvanceX value used by CalcTextSize() API then load the rest when loaded by drawing API.
44894487
float only_advance_x = 0.0f;
@@ -4572,15 +4570,16 @@ static bool ImGui_ImplStbTrueType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig*
45724570
}
45734571
src->FontLoaderData = bd_font_data;
45744572

4573+
const float ref_size = src->DstFont->Sources[0]->SizePixels;
45754574
if (src->MergeMode && src->SizePixels == 0.0f)
4576-
src->SizePixels = src->DstFont->Sources[0]->SizePixels;
4575+
src->SizePixels = ref_size;
45774576

45784577
if (src->SizePixels >= 0.0f)
45794578
bd_font_data->ScaleFactor = stbtt_ScaleForPixelHeight(&bd_font_data->FontInfo, 1.0f);
45804579
else
45814580
bd_font_data->ScaleFactor = stbtt_ScaleForMappingEmToPixels(&bd_font_data->FontInfo, 1.0f);
4582-
if (src->MergeMode && src->SizePixels != 0.0f)
4583-
bd_font_data->ScaleFactor *= src->SizePixels / src->DstFont->Sources[0]->SizePixels; // FIXME-NEWATLAS: Should tidy up that a bit
4581+
if (src->MergeMode && src->SizePixels != 0.0f && ref_size != 0.0f)
4582+
bd_font_data->ScaleFactor *= src->SizePixels / ref_size; // FIXME-NEWATLAS: Should tidy up that a bit
45844583

45854584
return true;
45864585
}
@@ -4679,15 +4678,12 @@ static bool ImGui_ImplStbTrueType_FontBakedLoadGlyph(ImFontAtlas* atlas, ImFontC
46794678
builder->TempBuffer.resize(w * h * 1);
46804679
unsigned char* bitmap_pixels = builder->TempBuffer.Data;
46814680
memset(bitmap_pixels, 0, w * h * 1);
4682-
stbtt_MakeGlyphBitmapSubpixel(&bd_font_data->FontInfo, bitmap_pixels, r->w - oversample_h + 1, r->h - oversample_v + 1, w,
4683-
scale_for_raster_x, scale_for_raster_y, 0, 0, glyph_index);
46844681

4685-
// Oversampling
4682+
// Render with oversampling
46864683
// (those functions conveniently assert if pixels are not cleared, which is another safety layer)
4687-
if (oversample_h > 1)
4688-
stbtt__h_prefilter(bitmap_pixels, r->w, r->h, r->w, oversample_h);
4689-
if (oversample_v > 1)
4690-
stbtt__v_prefilter(bitmap_pixels, r->w, r->h, r->w, oversample_v);
4684+
float sub_x, sub_y;
4685+
stbtt_MakeGlyphBitmapSubpixelPrefilter(&bd_font_data->FontInfo, bitmap_pixels, w, h, w,
4686+
scale_for_raster_x, scale_for_raster_y, 0, 0, oversample_h, oversample_v, &sub_x, &sub_y, glyph_index);
46914687

46924688
const float ref_size = baked->ContainerFont->Sources[0]->SizePixels;
46934689
const float offsets_scale = (ref_size != 0.0f) ? (baked->Size / ref_size) : 1.0f;
@@ -4697,8 +4693,8 @@ static bool ImGui_ImplStbTrueType_FontBakedLoadGlyph(ImFontAtlas* atlas, ImFontC
46974693
font_off_x = IM_ROUND(font_off_x);
46984694
if (src->PixelSnapV)
46994695
font_off_y = IM_ROUND(font_off_y);
4700-
font_off_x += stbtt__oversample_shift(oversample_h);
4701-
font_off_y += stbtt__oversample_shift(oversample_v) + IM_ROUND(baked->Ascent);
4696+
font_off_x += sub_x;
4697+
font_off_y += sub_y + IM_ROUND(baked->Ascent);
47024698
float recip_h = 1.0f / (oversample_h * rasterizer_density);
47034699
float recip_v = 1.0f / (oversample_v * rasterizer_density);
47044700

@@ -5225,9 +5221,9 @@ ImFontGlyph* ImFontBaked::FindGlyphNoFallback(ImWchar c)
52255221
if (i != IM_FONTGLYPH_INDEX_UNUSED)
52265222
return &Glyphs.Data[i];
52275223
}
5228-
LockLoadingFallback = true; // This is actually a rare call, not done in hot-loop, so we prioritize not adding extra cruft to ImFontBaked_BuildLoadGlyph() call sites.
5224+
LoadNoFallback = true; // This is actually a rare call, not done in hot-loop, so we prioritize not adding extra cruft to ImFontBaked_BuildLoadGlyph() call sites.
52295225
ImFontGlyph* glyph = ImFontBaked_BuildLoadGlyph(this, c, NULL);
5230-
LockLoadingFallback = false;
5226+
LoadNoFallback = false;
52315227
return glyph;
52325228
}
52335229

3rdparty/imgui/src/imgui_freetype.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ static void* FreeType_Realloc(FT_Memory /*memory*/, long cur_size, long new_size
344344
return block;
345345
}
346346

347-
bool ImGui_ImplFreeType_LoaderInit(ImFontAtlas* atlas)
347+
static bool ImGui_ImplFreeType_LoaderInit(ImFontAtlas* atlas)
348348
{
349349
IM_ASSERT(atlas->FontLoaderData == nullptr);
350350
ImGui_ImplFreeType_Data* bd = IM_NEW(ImGui_ImplFreeType_Data)();
@@ -384,7 +384,7 @@ bool ImGui_ImplFreeType_LoaderInit(ImFontAtlas* atlas)
384384
return true;
385385
}
386386

387-
void ImGui_ImplFreeType_LoaderShutdown(ImFontAtlas* atlas)
387+
static void ImGui_ImplFreeType_LoaderShutdown(ImFontAtlas* atlas)
388388
{
389389
ImGui_ImplFreeType_Data* bd = (ImGui_ImplFreeType_Data*)atlas->FontLoaderData;
390390
IM_ASSERT(bd != nullptr);
@@ -393,7 +393,7 @@ void ImGui_ImplFreeType_LoaderShutdown(ImFontAtlas* atlas)
393393
atlas->FontLoaderData = nullptr;
394394
}
395395

396-
bool ImGui_ImplFreeType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig* src)
396+
static bool ImGui_ImplFreeType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig* src)
397397
{
398398
ImGui_ImplFreeType_Data* bd = (ImGui_ImplFreeType_Data*)atlas->FontLoaderData;
399399
ImGui_ImplFreeType_FontSrcData* bd_font_data = IM_NEW(ImGui_ImplFreeType_FontSrcData);
@@ -410,15 +410,15 @@ bool ImGui_ImplFreeType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig* src)
410410
return true;
411411
}
412412

413-
void ImGui_ImplFreeType_FontSrcDestroy(ImFontAtlas* atlas, ImFontConfig* src)
413+
static void ImGui_ImplFreeType_FontSrcDestroy(ImFontAtlas* atlas, ImFontConfig* src)
414414
{
415415
IM_UNUSED(atlas);
416416
ImGui_ImplFreeType_FontSrcData* bd_font_data = (ImGui_ImplFreeType_FontSrcData*)src->FontLoaderData;
417417
IM_DELETE(bd_font_data);
418418
src->FontLoaderData = nullptr;
419419
}
420420

421-
bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src)
421+
static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src)
422422
{
423423
IM_UNUSED(atlas);
424424
float size = baked->Size;
@@ -464,7 +464,7 @@ bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* src, ImF
464464
return true;
465465
}
466466

467-
void ImGui_ImplFreeType_FontBakedDestroy(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src)
467+
static void ImGui_ImplFreeType_FontBakedDestroy(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src)
468468
{
469469
IM_UNUSED(atlas);
470470
IM_UNUSED(baked);
@@ -475,7 +475,7 @@ void ImGui_ImplFreeType_FontBakedDestroy(ImFontAtlas* atlas, ImFontConfig* src,
475475
bd_baked_data->~ImGui_ImplFreeType_FontSrcBakedData(); // ~IM_PLACEMENT_DELETE()
476476
}
477477

478-
bool ImGui_ImplFreeType_FontBakedLoadGlyph(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src, ImWchar codepoint, ImFontGlyph* out_glyph, float* out_advance_x)
478+
static bool ImGui_ImplFreeType_FontBakedLoadGlyph(ImFontAtlas* atlas, ImFontConfig* src, ImFontBaked* baked, void* loader_data_for_baked_src, ImWchar codepoint, ImFontGlyph* out_glyph, float* out_advance_x)
479479
{
480480
ImGui_ImplFreeType_FontSrcData* bd_font_data = (ImGui_ImplFreeType_FontSrcData*)src->FontLoaderData;
481481
uint32_t glyph_index = FT_Get_Char_Index(bd_font_data->FtFace, codepoint);
@@ -566,7 +566,7 @@ bool ImGui_ImplFreeType_FontBakedLoadGlyph(ImFontAtlas* atlas, ImFontConfig* src
566566
return true;
567567
}
568568

569-
bool ImGui_ImplFreetype_FontSrcContainsGlyph(ImFontAtlas* atlas, ImFontConfig* src, ImWchar codepoint)
569+
static bool ImGui_ImplFreetype_FontSrcContainsGlyph(ImFontAtlas* atlas, ImFontConfig* src, ImWchar codepoint)
570570
{
571571
IM_UNUSED(atlas);
572572
ImGui_ImplFreeType_FontSrcData* bd_font_data = (ImGui_ImplFreeType_FontSrcData*)src->FontLoaderData;

0 commit comments

Comments
 (0)