Call System.gc() on track changes and game resets.

This causes a noticeable drop in memory usage in most cases.

Also renamed the "crash" popup since the game doesn't necessarily crash.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-15 16:47:55 -05:00
parent 9db9c2f3ad
commit 516e6280c7
5 changed files with 48 additions and 33 deletions

View File

@@ -174,11 +174,13 @@ public class GameRanking extends BasicGameState {
} else if (exitButton.contains(x, y)) {
SoundController.playSound(SoundEffect.MENUBACK);
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
((Game) game.getState(Opsu.STATE_GAME)).resetGameData();
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
} else if (Utils.getBackButton().contains(x, y)) {
MusicController.pause();
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
SoundController.playSound(SoundEffect.MENUBACK);
((Game) game.getState(Opsu.STATE_GAME)).resetGameData();
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}