Small memory optimization: reuse audio File objects in song groups.

Each song group references the same audio file probably 100% of the time, so don't create duplicate objects.

Also, follow-up to 3b13cc7: the up/down arrow keys now change global volume in the main menu and game states (in addition to the scroll wheel).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-20 22:19:14 -05:00
parent 2bc45bec0a
commit e2c1f2f937
3 changed files with 20 additions and 1 deletions

View File

@@ -644,6 +644,12 @@ public class Game extends BasicGameState {
}
}
break;
case Input.KEY_UP:
Utils.changeVolume(1);
break;
case Input.KEY_DOWN:
Utils.changeVolume(-1);
break;
case Input.KEY_F12:
Utils.takeScreenShot();
break;

View File

@@ -428,6 +428,12 @@ public class MainMenu extends BasicGameState {
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
break;
case Input.KEY_UP:
Utils.changeVolume(1);
break;
case Input.KEY_DOWN:
Utils.changeVolume(-1);
break;
case Input.KEY_F12:
Utils.takeScreenShot();
break;