From 92435707306a0feebf02f0c46eacb7ca3d701ba5 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 29 Jan 2017 18:22:00 +0100 Subject: [PATCH] pre-revalidate songmenu state to prevent first time entering lag --- src/itdelatrisu/opsu/states/Splash.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/itdelatrisu/opsu/states/Splash.java b/src/itdelatrisu/opsu/states/Splash.java index c832408f..a5cb0155 100644 --- a/src/itdelatrisu/opsu/states/Splash.java +++ b/src/itdelatrisu/opsu/states/Splash.java @@ -84,6 +84,7 @@ public class Splash extends BaseOpsuState { protected void revalidate() { super.revalidate(); + // TODO d check if below is needed // check if skin changed if (Options.getSkin() != null) this.newSkin = (Options.getSkin().getDirectory() != Options.getSkinDir()); @@ -97,6 +98,9 @@ public class Splash extends BaseOpsuState { // fade in logo this.logoAlpha = new AnimatedValue(MIN_SPLASH_TIME, 0f, 1f, AnimationEquation.LINEAR); GameImage.MENU_LOGO.getImage().setAlpha(0f); + + // pre-revalidate some states to reduce lag between switching + instanceContainer.provide(SongMenu.class).revalidate(); } @Override