Browse Source

Fonts: (Internal) rename ImFontBaked::LockLoadingFallback to ImFontBaked::LoadNoFallback.

ocornut 3 weeks ago
parent
commit
10dc1882c8
2 changed files with 7 additions and 7 deletions
  1. 3 3
      imgui.h
  2. 4 4
      imgui_draw.cpp

+ 3 - 3
imgui.h

@@ -3745,10 +3745,10 @@ struct ImFontBaked
     // [Internal] Members: Cold
     // [Internal] Members: Cold
     float                       Ascent, Descent;    // 4+4   // out // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
     float                       Ascent, Descent;    // 4+4   // out // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
     unsigned int                MetricsTotalSurface:26;// 3  // out // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
     unsigned int                MetricsTotalSurface:26;// 3  // out // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
-    unsigned int                WantDestroy:1;         // 0  //     // Queued for destroy
-    unsigned int                LockLoadingFallback:1; // 0  //     //
+    unsigned int                WantDestroy:1;      // 0     //     // Queued for destroy
+    unsigned int                LoadNoFallback:1;   // 0     //     // Disable loading fallback in lower-level calls.
     int                         LastUsedFrame;      // 4     //     // Record of that time this was bounds
     int                         LastUsedFrame;      // 4     //     // Record of that time this was bounds
-    ImGuiID                     BakedId;            // 4     //
+    ImGuiID                     BakedId;            // 4     //     // Unique ID for this baked storage
     ImFont*                     ContainerFont;      // 4-8   // in  // Parent font
     ImFont*                     ContainerFont;      // 4-8   // in  // Parent font
     void*                       FontLoaderDatas;    // 4-8   //     // Font loader opaque storage (per baked font * sources): single contiguous buffer allocated by imgui, passed to loader.
     void*                       FontLoaderDatas;    // 4-8   //     // Font loader opaque storage (per baked font * sources): single contiguous buffer allocated by imgui, passed to loader.
 
 

+ 4 - 4
imgui_draw.cpp

@@ -4417,7 +4417,7 @@ static ImFontGlyph* ImFontBaked_BuildLoadGlyph(ImFontBaked* baked, ImWchar codep
     if (atlas->Locked || (font->Flags & ImFontFlags_NoLoadGlyphs))
     if (atlas->Locked || (font->Flags & ImFontFlags_NoLoadGlyphs))
     {
     {
         // Lazily load fallback glyph
         // Lazily load fallback glyph
-        if (baked->FallbackGlyphIndex == -1 && baked->LockLoadingFallback == 0)
+        if (baked->FallbackGlyphIndex == -1 && baked->LoadNoFallback == 0)
             ImFontAtlasBuildSetupFontBakedFallback(baked);
             ImFontAtlasBuildSetupFontBakedFallback(baked);
         return NULL;
         return NULL;
     }
     }
@@ -4469,7 +4469,7 @@ static ImFontGlyph* ImFontBaked_BuildLoadGlyph(ImFontBaked* baked, ImWchar codep
     }
     }
 
 
     // Lazily load fallback glyph
     // Lazily load fallback glyph
-    if (baked->LockLoadingFallback)
+    if (baked->LoadNoFallback)
         return NULL;
         return NULL;
     if (baked->FallbackGlyphIndex == -1)
     if (baked->FallbackGlyphIndex == -1)
         ImFontAtlasBuildSetupFontBakedFallback(baked);
         ImFontAtlasBuildSetupFontBakedFallback(baked);
@@ -5222,9 +5222,9 @@ ImFontGlyph* ImFontBaked::FindGlyphNoFallback(ImWchar c)
         if (i != IM_FONTGLYPH_INDEX_UNUSED)
         if (i != IM_FONTGLYPH_INDEX_UNUSED)
             return &Glyphs.Data[i];
             return &Glyphs.Data[i];
     }
     }
-    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.
+    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.
     ImFontGlyph* glyph = ImFontBaked_BuildLoadGlyph(this, c, NULL);
     ImFontGlyph* glyph = ImFontBaked_BuildLoadGlyph(this, c, NULL);
-    LockLoadingFallback = false;
+    LoadNoFallback = false;
     return glyph;
     return glyph;
 }
 }