More optimizations: don't load OsuFile array fields until needed.
When cached, defer loading of timing points, breaks, and combo colors until directly before a game. Potentially cuts loading time by 50%, and saves a bit of memory. Other changes: - Don't store the default combo colors in the cache. - Removed some PreparedStatements that only get executed once. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -1284,8 +1284,13 @@ public class SongMenu extends BasicGameState {
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
OsuFile osu = MusicController.getOsuFile();
|
||||
Display.setTitle(String.format("%s - %s", game.getTitle(), osu.toString()));
|
||||
|
||||
// load any missing data
|
||||
if (osu.timingPoints == null || osu.combo == null)
|
||||
OsuDB.load(osu, OsuDB.LOAD_ARRAY);
|
||||
OsuParser.parseHitObjects(osu);
|
||||
HitSound.setDefaultSampleSet(osu.sampleSet);
|
||||
|
||||
MultiClip.destroyExtraClips();
|
||||
((Game) game.getState(Opsu.STATE_GAME)).setRestart(Game.Restart.NEW);
|
||||
game.enterState(Opsu.STATE_GAME, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
|
||||
Reference in New Issue
Block a user