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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user