From 6cd6938ea542fef05a9510d2a52e9742632e7879 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Fri, 6 Mar 2015 14:39:49 -0500 Subject: [PATCH] Preload game images directly before a game. (undo 95775d8) Not noticing any bad effects from this anymore. The application should load faster again. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/GameImage.java | 6 +++--- src/itdelatrisu/opsu/states/Game.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index f996f6c1..2740c8c1 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -135,7 +135,7 @@ public enum GameImage { SPINNER_SPIN ("spinner-spin", "png"), SPINNER_CLEAR ("spinner-clear", "png"), SPINNER_OSU ("spinner-osu", "png"), - SPINNER_RPM ("spinner-rpm", "png", false, true) { + SPINNER_RPM ("spinner-rpm", "png") { @Override protected Image process_sub(Image img, int w, int h) { return img.getScaledCopy((SCORE_0.getImage().getHeight() * 1.05f) / img.getHeight()); @@ -581,7 +581,7 @@ public enum GameImage { * @param type the file types (separated by '|') */ GameImage(String filename, String type) { - this(filename, type, true, true); + this(filename, type, true, false); } /** @@ -591,7 +591,7 @@ public enum GameImage { * @param type the file types (separated by '|') */ GameImage(String filename, String filenameFormat, String type) { - this(filename, type, true, true); + this(filename, type, true, false); this.filenameFormat = filenameFormat; } diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 4ae66795..34aefe75 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -839,8 +839,10 @@ public class Game extends BasicGameState { // set images File parent = osu.getFile().getParentFile(); for (GameImage img : GameImage.values()) { - if (img.isSkinnable()) + if (img.isSkinnable()) { + img.setDefaultImage(); img.setSkinImage(parent); + } } // skip button