From 83df73fc04aa135f3cce1b9eee5d16deb597d258 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 21 Jan 2017 14:23:34 +0100 Subject: [PATCH] on the fly resolution changing --- src/itdelatrisu/opsu/Options.java | 2 ++ src/yugecin/opsudance/core/DisplayContainer.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index 553c54cb..8f1f7f3e 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -63,6 +63,7 @@ import yugecin.opsudance.core.DisplayContainer; import yugecin.opsudance.core.errorhandling.ErrorHandler; import yugecin.opsudance.core.events.EventBus; import yugecin.opsudance.events.BubbleNotificationEvent; +import yugecin.opsudance.events.ResolutionChangedEvent; import yugecin.opsudance.movers.factories.ExgonMoverFactory; import yugecin.opsudance.movers.factories.QuadraticBezierMoverFactory; import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController; @@ -346,6 +347,7 @@ public class Options { @Override public void clickListItem(int index) { resolutionIdx = index; + setDisplayMode(DisplayContainer.instance); } @Override diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index 35a47aba..ba782b9a 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -59,6 +59,9 @@ import static yugecin.opsudance.core.Entrypoint.sout; */ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListener { + @Deprecated + public static DisplayContainer instance; // TODO d remove this + private static SGL GL = Renderer.get(); public final EventBus eventBus; @@ -117,6 +120,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen this.eventBus = eventBus; this.cursor = new Cursor(); drawCursor = true; + instance = this; outTransitionListener = new TransitionFinishedListener() { @Override @@ -317,6 +321,11 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen } private void initGL() throws Exception { + InternalTextureLoader.get().clear(); + GameImage.destroyImages(); + GameData.Grade.destroyImages(); + Beatmap.destroyBackgroundImageCache(); + GL.initDisplay(width, height); GL.enterOrtho(width, height);