mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:05:37 +08:00
Merge pull request #26536 from peppy/cache-fonts
Fix gameplay counter textures not being cached ahead of time
This commit is contained in:
commit
cd9b6656ba
@ -137,6 +137,12 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Spacing = new Vector2(-2f, 0f);
|
||||
Font = new FontUsage(font_name, 1);
|
||||
glyphStore = new GlyphStore(font_name, textures, getLookup);
|
||||
|
||||
// cache common lookups ahead of time.
|
||||
foreach (char c in new[] { '.', '%', 'x' })
|
||||
glyphStore.Get(font_name, c);
|
||||
for (int i = 0; i < 10; i++)
|
||||
glyphStore.Get(font_name, (char)('0' + i));
|
||||
}
|
||||
|
||||
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore);
|
||||
|
@ -50,6 +50,12 @@ namespace osu.Game.Skinning
|
||||
Spacing = new Vector2(-skin.GetFontOverlap(font), 0);
|
||||
|
||||
glyphStore = new LegacyGlyphStore(fontPrefix, skin, MaxSizePerGlyph);
|
||||
|
||||
// cache common lookups ahead of time.
|
||||
foreach (char c in FixedWidthExcludeCharacters)
|
||||
glyphStore.Get(fontPrefix, c);
|
||||
for (int i = 0; i < 10; i++)
|
||||
glyphStore.Get(fontPrefix, (char)('0' + i));
|
||||
}
|
||||
|
||||
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore);
|
||||
|
Loading…
Reference in New Issue
Block a user