From 98217661b876dde65f7bfb52176671d6ac49b8c1 Mon Sep 17 00:00:00 2001 From: Robert Vokac Date: Sun, 15 Sep 2024 20:03:30 +0200 Subject: [PATCH] Bug 20: Fixed the html module - GwtLauncher. Initialization of the Pixel Backend was at the wrong place --- html/src/main/java/com/openeggbert/gwt/GwtLauncher.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/html/src/main/java/com/openeggbert/gwt/GwtLauncher.java b/html/src/main/java/com/openeggbert/gwt/GwtLauncher.java index 05d71ae..06d8b90 100644 --- a/html/src/main/java/com/openeggbert/gwt/GwtLauncher.java +++ b/html/src/main/java/com/openeggbert/gwt/GwtLauncher.java @@ -4,8 +4,6 @@ import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.backends.gwt.GwtApplication; import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; import com.openeggbert.core.configuration.ScreenResolution; -import com.openeggbert.core.main.OpenEggbertGame; -import com.badlogic.gdx.ai.GdxLogger; import com.openeggbert.core.main.OpenEggbertApplication; import com.pixelgamelibrary.api.Pixel; import com.pixelgamelibrary.backend.libgdx.PixelBackendLibGDX; @@ -22,12 +20,13 @@ public class GwtLauncher extends GwtApplication { //return cfg; // If you want a fixed size application, comment out the above resizable section, // and uncomment below: - Pixel.initBackend(new PixelBackendLibGDX()); + return new GwtApplicationConfiguration(ScreenResolution.VGA.getWidth(), ScreenResolution.VGA.getHeight()); } @Override public ApplicationListener createApplicationListener () { + if(!Pixel.isBackendSet()) {Pixel.initBackend(new PixelBackendLibGDX());} return new LibGdxGame(new OpenEggbertApplication().createGame()); } }