Only load image resources when needed.
- Stop loading all images on startup. - Game images are preloaded before the song starts. - Destroy skin images immediately after finishing a beatmap, potentially saving lots of memory. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -859,8 +859,10 @@ public class Game extends BasicGameState {
|
||||
// set images
|
||||
File parent = osu.getFile().getParentFile();
|
||||
for (GameImage img : GameImage.values()) {
|
||||
if (img.isGameImage() && img.setSkinImage(parent))
|
||||
img.process();
|
||||
if (img.isGameImage()) {
|
||||
img.setDefaultImage(); // ensure that default image has been loaded
|
||||
img.setSkinImage(parent);
|
||||
}
|
||||
}
|
||||
|
||||
// skip button
|
||||
|
||||
Reference in New Issue
Block a user