1
0
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:
Dean Herbert 2024-01-15 14:01:03 +09:00
parent 0f521d6daf
commit 0b5cc8fb10
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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);