mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 03:42:57 +08:00
Fix gameplay counter textures not being cached ahead of time
Part of https://github.com/ppy/osu/issues/26535.
This commit is contained in:
parent
0f521d6daf
commit
0b5cc8fb10
@ -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