diff --git a/src/yugecin/opsudance/OpsuDance.java b/src/yugecin/opsudance/OpsuDance.java index c476dad0..293019bd 100644 --- a/src/yugecin/opsudance/OpsuDance.java +++ b/src/yugecin/opsudance/OpsuDance.java @@ -63,7 +63,7 @@ public class OpsuDance { initUpdater(args); sout("database & updater initialized"); - container.switchStateNow(EmptyState.class); + container.demux.switchStateNow(EmptyState.class); while (rungame()); diff --git a/src/yugecin/opsudance/core/Demux.java b/src/yugecin/opsudance/core/Demux.java index 4d3d5c52..17be4f6f 100644 --- a/src/yugecin/opsudance/core/Demux.java +++ b/src/yugecin/opsudance/core/Demux.java @@ -93,6 +93,10 @@ public class Demux implements KeyListener, MouseListener { switchState(newState, FadeOutTransitionState.class, 200, FadeInTransitionState.class, 300); } + public void switchStateNow(Class newState) { + switchState(newState, EmptyTransitionState.class, 0, EmptyTransitionState.class, 0); + } + public void switchState(Class newState, Class outTransition, int outTime, Class inTransition, int inTime) { if (isTransitioning()) { return; diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index c298b392..93d3bc1b 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -30,9 +30,6 @@ import org.newdawn.slick.opengl.InternalTextureLoader; import org.newdawn.slick.opengl.renderer.Renderer; import org.newdawn.slick.opengl.renderer.SGL; import org.newdawn.slick.util.Log; -import yugecin.opsudance.core.state.OpsuState; -import yugecin.opsudance.core.state.transitions.EmptyTransitionState; -import yugecin.opsudance.core.state.transitions.TransitionState; import yugecin.opsudance.errorhandling.ErrorDumpable; import yugecin.opsudance.utils.GLHelper; @@ -49,7 +46,7 @@ public class DisplayContainer implements ErrorDumpable { private static SGL GL = Renderer.get(); - private final Demux demux; + public final Demux demux; private final DisplayMode nativeDisplayMode; private final List resolutionChangeListeners; @@ -86,18 +83,6 @@ public class DisplayContainer implements ErrorDumpable { resolutionChangeListeners.add(listener); } - public void switchState(Class newState) { - demux.switchState(newState); - } - - public void switchStateNow(Class newState) { - demux.switchState(newState, EmptyTransitionState.class, 0, EmptyTransitionState.class, 0); - } - - public void switchState(Class newState, Class outTransition, int outTime, Class inTransition, int inTime) { - demux.switchState(newState, outTransition, outTime, inTransition, inTime); - } - public void run() throws LWJGLException { while(!(Display.isCloseRequested() && demux.onCloseRequest())) { delta = getDelta(); diff --git a/src/yugecin/opsudance/states/EmptyRedState.java b/src/yugecin/opsudance/states/EmptyRedState.java index eb40cdc9..2e8cbc16 100644 --- a/src/yugecin/opsudance/states/EmptyRedState.java +++ b/src/yugecin/opsudance/states/EmptyRedState.java @@ -41,7 +41,7 @@ public class EmptyRedState implements OpsuState { if (counter < 0) { counter = 10000; // to prevent more calls to switch, as this will keep rendering until state transitioned System.out.println(System.currentTimeMillis() - start); - displayContainer.switchState(EmptyState.class); + displayContainer.demux.switchState(EmptyState.class); } } diff --git a/src/yugecin/opsudance/states/EmptyState.java b/src/yugecin/opsudance/states/EmptyState.java index d161f1cb..2f0d6013 100644 --- a/src/yugecin/opsudance/states/EmptyState.java +++ b/src/yugecin/opsudance/states/EmptyState.java @@ -39,7 +39,7 @@ public class EmptyState implements OpsuState { counter -= delta; if (counter < 0) { counter = 10000; // to prevent more calls to switch, as this will keep rending until state transitioned - displayContainer.switchState(EmptyRedState.class); + displayContainer.demux.switchState(EmptyRedState.class); } }