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

@@ -130,6 +130,7 @@ public class GamePauseMenu extends BasicGameState {
MusicController.stop();
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
SoundController.playSound(SoundEffect.MENUBACK);
gameState.resetGameData();
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
} else {
SoundController.playSound(SoundEffect.MENUBACK);
@@ -173,6 +174,7 @@ public class GamePauseMenu extends BasicGameState {
MusicController.pause(); // lose state
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
SoundController.playSound(SoundEffect.MENUBACK);
gameState.resetGameData();
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}