Preload game images when program initializes.

Reverted earlier change to load images immediately before a game begins, since there is a noticeable lag in some cases.

Other changes:
- Added 'preload' field to GameImage.
- Changed 'gameImage' field in GameImage to 'skinnable' (more suitable name).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-18 17:01:13 -05:00
parent 53158fd310
commit 95775d8e73
3 changed files with 59 additions and 42 deletions

View File

@@ -188,8 +188,10 @@ public class Utils {
// initialize game images
GameImage.init(width, height);
GameImage.MENU_LOGO.setDefaultImage();
GameImage.MENU_BG.setDefaultImage();
for (GameImage img : GameImage.values()) {
if (img.isPreload())
img.setDefaultImage();
}
// initialize game mods
for (GameMod mod : GameMod.values())