mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Begin loading fonts earlier in startup
Should result in a considerably faster font load, as they can be concurrently loaded alongside EF.
This commit is contained in:
parent
b0f9c0f6f0
commit
d9e9c61731
@ -114,31 +114,8 @@ namespace osu.Game
|
|||||||
dependencies.CacheAs(this);
|
dependencies.CacheAs(this);
|
||||||
dependencies.Cache(LocalConfig);
|
dependencies.Cache(LocalConfig);
|
||||||
|
|
||||||
runMigrations();
|
|
||||||
|
|
||||||
dependencies.Cache(SkinManager = new SkinManager(Host.Storage, contextFactory, Host, Audio));
|
|
||||||
dependencies.CacheAs<ISkinSource>(SkinManager);
|
|
||||||
|
|
||||||
var api = new APIAccess(LocalConfig);
|
|
||||||
|
|
||||||
dependencies.Cache(api);
|
|
||||||
dependencies.CacheAs<IAPIProvider>(api);
|
|
||||||
|
|
||||||
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
|
|
||||||
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
|
|
||||||
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host));
|
|
||||||
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory, Host, BeatmapManager, RulesetStore));
|
|
||||||
dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
|
|
||||||
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
|
|
||||||
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
|
|
||||||
dependencies.Cache(new OsuColour());
|
|
||||||
|
|
||||||
fileImporters.Add(BeatmapManager);
|
|
||||||
fileImporters.Add(ScoreStore);
|
|
||||||
fileImporters.Add(SkinManager);
|
|
||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 });
|
dependencies.Cache(Fonts = new FontStore());
|
||||||
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||||
@ -164,6 +141,29 @@ namespace osu.Game
|
|||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera-Light"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera-Light"));
|
||||||
|
|
||||||
|
runMigrations();
|
||||||
|
|
||||||
|
dependencies.Cache(SkinManager = new SkinManager(Host.Storage, contextFactory, Host, Audio));
|
||||||
|
dependencies.CacheAs<ISkinSource>(SkinManager);
|
||||||
|
|
||||||
|
var api = new APIAccess(LocalConfig);
|
||||||
|
|
||||||
|
dependencies.Cache(api);
|
||||||
|
dependencies.CacheAs<IAPIProvider>(api);
|
||||||
|
|
||||||
|
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
|
||||||
|
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
|
||||||
|
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host));
|
||||||
|
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory, Host, BeatmapManager, RulesetStore));
|
||||||
|
dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
|
||||||
|
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
|
||||||
|
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
|
||||||
|
dependencies.Cache(new OsuColour());
|
||||||
|
|
||||||
|
fileImporters.Add(BeatmapManager);
|
||||||
|
fileImporters.Add(ScoreStore);
|
||||||
|
fileImporters.Add(SkinManager);
|
||||||
|
|
||||||
var defaultBeatmap = new DummyWorkingBeatmap(this);
|
var defaultBeatmap = new DummyWorkingBeatmap(this);
|
||||||
beatmap = new OsuBindableBeatmap(defaultBeatmap, Audio);
|
beatmap = new OsuBindableBeatmap(defaultBeatmap, Audio);
|
||||||
BeatmapManager.DefaultBeatmap = defaultBeatmap;
|
BeatmapManager.DefaultBeatmap = defaultBeatmap;
|
||||||
|
Loading…
Reference in New Issue
Block a user