diff --git a/test-prj/assets/BladeEngine.properties b/test-prj/assets/BladeEngine.properties index 01ad06b..103dc16 100644 --- a/test-prj/assets/BladeEngine.properties +++ b/test-prj/assets/BladeEngine.properties @@ -1,12 +1,12 @@ -bladeEngineVersion=4.1.1-SNAPSHOT +bladeEngineVersion=4.3.0 character_icon_atlas=char-icons debug=false fast_leave=true -gdxVersion=1.11.1-SNAPSHOT +gdxVersion=1.12.0 inventory_pos=down pie_mode.desktop=false resolutions=1 -roboVMVersion=2.3.18 +roboVMVersion=2.3.20 title=Blade Engine Adventure ui_mode=PIE version=19 diff --git a/test-prj/core/build.gradle b/test-prj/core/build.gradle index 5c933b6..1fa06d0 100644 --- a/test-prj/core/build.gradle +++ b/test-prj/core/build.gradle @@ -23,21 +23,19 @@ dependencies { task setVersion(type: WriteProperties) { - def props = new Properties() - def propFile = project.file("../assets/BladeEngine.properties"); - props.load(new FileReader(propFile)) + def props = new Properties() + def propFile = project.file("../assets/BladeEngine.properties"); + props.load(new FileReader(propFile)) props."version" = version - props."bladeEngineVersion" = bladeEngineVersion - props."gdxVersion" = gdxVersion - props."roboVMVersion" = roboVMVersion - - setProperties(props); - setOutputFile(propFile); - - doLast { - println "Set version info in versions.properties" - } -} + props."bladeEngineVersion" = bladeEngineVersion + props."gdxVersion" = gdxVersion + props."roboVMVersion" = roboVMVersion + + setProperties(props); + setOutputFile(propFile); -processResources.finalizedBy(setVersion) + doLast { + println "Set version info in versions.properties" + } +} diff --git a/test-prj/desktop/build.gradle b/test-prj/desktop/build.gradle index da0386e..f2044ce 100644 --- a/test-prj/desktop/build.gradle +++ b/test-prj/desktop/build.gradle @@ -16,6 +16,8 @@ dependencies { implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" } +def os = System.properties['os.name'].toLowerCase() + run { standardInput = System.in ignoreExitValue = true @@ -23,6 +25,34 @@ run { if (project.hasProperty("appArgs")) { args Eval.me(appArgs) } + + if (os.contains('mac')) { + jvmArgs = ["-XstartOnFirstThread"] + } +} + +jar { +// sets the name of the .jar file this produces to the name of the game or app. + archiveBaseName.set(appName) +// using 'lib' instead of the default 'libs' appears to be needed by jpackageimage. + destinationDirectory = file("$project.buildDir/lib") +// the duplicatesStrategy matters starting in Gradle 7.0; this setting works. + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) + dependsOn configurations.runtimeClasspath + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +// these "exclude" lines remove some unnecessary duplicate files in the output JAR. + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } +// setting the manifest makes the JAR runnable. + manifest { + attributes 'Main-Class': project.mainClassName + } +// this last step may help on some OSes that need extra instruction to make runnable JARs. + doLast { + file(archiveFile).setExecutable(true, false) + } } @@ -40,3 +70,4 @@ task dist(type: Jar) { dist.dependsOn classes dist.dependsOn ':core:jar' +processResources.dependsOn ':core:setVersion' diff --git a/test-prj/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java b/test-prj/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java index 7ce9b35..7573974 100644 --- a/test-prj/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java +++ b/test-prj/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java @@ -172,8 +172,8 @@ private void hideCursor() { } public static void main(String[] args) { - if(System.getProperty("os.name").contains("Mac")) - Configuration.GLFW_LIBRARY_NAME.set("glfw_async"); + // if(System.getProperty("os.name").contains("Mac")) + // Configuration.GLFW_LIBRARY_NAME.set("glfw_async"); DesktopLauncher game = new DesktopLauncher(); game.parseParams(args); diff --git a/test-prj/gradle.properties b/test-prj/gradle.properties index db0f512..2540be4 100644 --- a/test-prj/gradle.properties +++ b/test-prj/gradle.properties @@ -1,13 +1,13 @@ +android.injected.testOnly=false +androidGradlePluginVersion=8.1.0 appName=test-prj -bladeEngineVersion=4.1.1-SNAPSHOT -gdxVersion=1.11.1-SNAPSHOT -roboVMVersion=2.3.18 -androidGradlePluginVersion=7.2.2 +bladeEngineVersion=4.3.0 bladeInkVersion=1.1.2 -spinePlugin=false -gdxControllersVersion=2.2.2 +gdxControllersVersion=2.2.3 +gdxVersion=1.12.0 +org.gradle.configureondemand=false org.gradle.daemon=true org.gradle.jvmargs=-Xms128m -Xmx1536m -org.gradle.configureondemand=false -android.injected.testOnly=false +roboVMVersion=2.3.20 +spinePlugin=false version=19 diff --git a/test-prj/gradle/wrapper/gradle-wrapper.properties b/test-prj/gradle/wrapper/gradle-wrapper.properties index 8049c68..e411586 100644 --- a/test-prj/gradle/wrapper/gradle-wrapper.properties +++ b/test-prj/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/test-spine/assets/BladeEngine.properties b/test-spine/assets/BladeEngine.properties index 812ada3..5b639b8 100644 --- a/test-spine/assets/BladeEngine.properties +++ b/test-spine/assets/BladeEngine.properties @@ -1,10 +1,10 @@ -bladeEngineVersion=4.1.0 +bladeEngineVersion=4.3.0 debug=true -gdxVersion=1.10.0 +gdxVersion=1.12.0 inventory_pos=down pie_mode.desktop=false resolutions=1 -roboVMVersion=2.3.12 +roboVMVersion=2.3.20 scene_screen=com.bladecoder.engine.ui.retro.RetroSceneScreen title=Spine Animation Test version=unspecified diff --git a/test-spine/assets/spine/john_back.skel b/test-spine/assets/spine/john_back.skel index 8ba2a6c..0d140ac 100644 Binary files a/test-spine/assets/spine/john_back.skel and b/test-spine/assets/spine/john_back.skel differ diff --git a/test-spine/assets/spine/john_front.skel b/test-spine/assets/spine/john_front.skel index 2e64c52..06e76b4 100644 Binary files a/test-spine/assets/spine/john_front.skel and b/test-spine/assets/spine/john_front.skel differ diff --git a/test-spine/assets/spine/john_left.skel b/test-spine/assets/spine/john_left.skel index 6776455..64bd5a4 100644 Binary files a/test-spine/assets/spine/john_left.skel and b/test-spine/assets/spine/john_left.skel differ diff --git a/test-spine/core/build.gradle b/test-spine/core/build.gradle index 88e888e..3a8198a 100644 --- a/test-spine/core/build.gradle +++ b/test-spine/core/build.gradle @@ -1,46 +1,38 @@ apply plugin: 'java' apply plugin: 'java-library' -sourceCompatibility = 1.7 -targetCompatibility=1.7 +sourceCompatibility = 1.8 +targetCompatibility = 1.8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' eclipse.project.name = appName + '-core' dependencies { - api "com.badlogicgames.gdx:gdx:$gdxVersion" - api fileTree(dir: '../libs', include: '*.jar') - api "com.bladecoder.engine:blade-engine:$bladeEngineVersion" - api "com.bladecoder.ink:blade-ink:$bladeInkVersion" - api "org.minimalcode:minimalcode-beans:0.5.1" - api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" - implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion" - - - if(project.hasProperty("spinePlugin") && project.spinePlugin.equals("true")) { - println "Using Spine Plugin..." - api "com.bladecoder.engine:blade-engine-spine-plugin:$bladeEngineVersion" - } + api "com.badlogicgames.gdx:gdx:$gdxVersion" + api "com.bladecoder.engine:blade-engine:$bladeEngineVersion" + implementation "com.bladecoder.ink:blade-ink:$bladeInkVersion" + implementation "org.minimalcode:minimalcode-beans:0.5.1" + implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" + implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion" + + implementation "com.bladecoder.engine:blade-engine-spine-plugin:$bladeEngineVersion" } task setVersion(type: WriteProperties) { - - def props = new Properties() - def propFile = project.file("../assets/BladeEngine.properties"); - props.load(new FileReader(propFile)) + def props = new Properties() + def propFile = project.file("../assets/BladeEngine.properties"); + props.load(new FileReader(propFile)) props."version" = version - props."bladeEngineVersion" = bladeEngineVersion - props."gdxVersion" = gdxVersion - props."roboVMVersion" = roboVMVersion - - setProperties(props); - setOutputFile(propFile); - - doLast { - println "Set version info in versions.properties" - } -} + props."bladeEngineVersion" = bladeEngineVersion + props."gdxVersion" = gdxVersion + props."roboVMVersion" = roboVMVersion -processResources.finalizedBy(setVersion) + setProperties(props); + setOutputFile(propFile); + + doLast { + println "Set version info in versions.properties" + } +} diff --git a/test-spine/desktop/build.gradle b/test-spine/desktop/build.gradle index 971e3e2..6221abf 100644 --- a/test-spine/desktop/build.gradle +++ b/test-spine/desktop/build.gradle @@ -2,51 +2,75 @@ apply plugin: 'java' apply plugin: 'java-library' apply plugin: 'application' -sourceCompatibility = 1.7 -targetCompatibility=1.7 +sourceCompatibility = 1.8 +targetCompatibility=1.8 sourceSets.main.resources.srcDirs += [ rootProject.file('assets').absolutePath ] -mainClassName = "com.bladecoder.advtestspine.desktop.DesktopLauncher" +mainClassName = "com.bladecoder.engine.DesktopLauncher" eclipse.project.name = appName + '-desktop' dependencies { - api project(":core") - api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" - api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" - api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" + implementation project(":core") + implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" + implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" + implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" + implementation "com.badlogicgames.gdx:gdx-lwjgl3-angle:$gdxVersion" implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" } jar { - archiveName "${appName}-${version}.jar" - from { configurations.compile.collect { zipTree(it) } } - manifest { - attributes 'Main-Class': project.mainClassName - } +// sets the name of the .jar file this produces to the name of the game or app. + archiveBaseName.set(appName) +// using 'lib' instead of the default 'libs' appears to be needed by jpackageimage. + destinationDirectory = file("$project.buildDir/lib") +// the duplicatesStrategy matters starting in Gradle 7.0; this setting works. + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) + dependsOn configurations.runtimeClasspath + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +// these "exclude" lines remove some unnecessary duplicate files in the output JAR. + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } +// setting the manifest makes the JAR runnable. + manifest { + attributes 'Main-Class': project.mainClassName + } +// this last step may help on some OSes that need extra instruction to make runnable JARs. + doLast { + file(archiveFile).setExecutable(true, false) + } } +def os = System.properties['os.name'].toLowerCase() run { standardInput = System.in ignoreExitValue = true - - if (project.hasProperty("appArgs") ) { - args Eval.me(appArgs) - } + + if (project.hasProperty("appArgs")) { + args Eval.me(appArgs) + } + + if (os.contains('mac')) { + jvmArgs = ["-XstartOnFirstThread"] + } } task dist(type: Jar) { - baseName = appName + "-desktop" - - from files(sourceSets.main.output.classesDirs) - from files(sourceSets.main.output.resourcesDir) - from {configurations.runtimeClasspath.collect {zipTree(it)}} - + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) manifest { attributes 'Main-Class': project.mainClassName } + dependsOn configurations.runtimeClasspath + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } + with jar } dist.dependsOn classes +dist.dependsOn ':core:jar' +processResources.dependsOn ':core:setVersion' diff --git a/test-spine/desktop/src/main/java/com/bladecoder/advtestspine/desktop/DesktopLauncher.java b/test-spine/desktop/src/main/java/com/bladecoder/advtestspine/desktop/DesktopLauncher.java deleted file mode 100644 index bbac93a..0000000 --- a/test-spine/desktop/src/main/java/com/bladecoder/advtestspine/desktop/DesktopLauncher.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.bladecoder.advtestspine.desktop; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.IntBuffer; -import java.util.Properties; - -import com.bladecoder.engine.BladeEngine; -import com.bladecoder.engine.util.Config; -import org.lwjgl.BufferUtils; -import org.lwjgl.LWJGLException; -import org.lwjgl.input.Cursor; -import org.lwjgl.input.Mouse; - -import com.badlogic.gdx.Files.FileType; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.lwjgl.LwjglApplication; -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; - -public class DesktopLauncher extends BladeEngine { - - private boolean fullscreen = true; - private LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); - - DesktopLauncher() { - Properties p = new Properties(); - - try { - InputStream s = DesktopLauncher.class.getResourceAsStream(Config.PROPERTIES_FILENAME); - if(s!=null) - p.load(s); - } catch (IOException e) { - } - - cfg.title = p.getProperty(Config.TITLE_PROP, "Blade Engine Adventure"); -// cfg.useGL30 = true; - - // cfg.width = World.getInstance().getWidth(); - // cfg.height = World.getInstance().getHeight(); - - cfg.width = 1920 / 2; - cfg.height = 1080 / 2; - - cfg.resizable = true; - cfg.samples = 2; - } - - public void run() { - if(DesktopLauncher.class.getResource("/icons/icon128.png")!=null) - cfg.addIcon("icons/icon128.png", FileType.Internal); - - if(DesktopLauncher.class.getResource("/icons/icon32.png")!=null) - cfg.addIcon("icons/icon32.png", FileType.Internal); - - if(DesktopLauncher.class.getResource("/icons/icon16.png")!=null) - cfg.addIcon("icons/icon16.png", FileType.Internal); - - new LwjglApplication(this, cfg); - } - - public void parseParams(String[] args) { - for (int i = 0; i < args.length; i++) { - String s = args[i]; - if (s.equals("-t")) { - if (i + 1 < args.length) { - i++; - setTestMode(args[i]); - } - } else if (s.equals("-p")) { - if (i + 1 < args.length) { - i++; - setPlayMode(args[i]); - } - } else if (s.equals("-chapter")) { - if (i + 1 < args.length) { - i++; - setChapter(args[i]); - } - } else if (s.equals("-f")) { - fullscreen = true; - - //cfg.fullscreen = true; - } else if (s.equals("-d")) { - setDebugMode(); - } else if (s.equals("-r")) { - setRestart(); - } else if (s.equals("-res")) { - if (i + 1 < args.length) { - i++; - forceResolution(args[i]); - } - } else if (s.equals("-w")) { - fullscreen = false; - } else if (s.equals("-l")) { - if (i + 1 < args.length) { - i++; - loadGameState(args[i]); - } - } else if (s.equals("-h")) { - usage(); - } else { - if(i == 0 && !s.startsWith("-")) continue; // When embeded JRE the 0 parameter is the app name - System.out.println("Unrecognized parameter: " + s); - usage(); - } - } - } - - - public void usage() { - System.out.println( - "Usage:\n" + - "-chapter chapter\tLoads the selected chapter\n" + - "-t scene_name\tStart test mode for the scene\n" + - "-p record_name\tPlay previusly recorded games\n" + - "-f\tSet fullscreen mode\n" + - "-w\tSet windowed mode\n" + - "-d\tShow debug messages\n" + - "-res width\tForce the resolution width\n" + - "-l game_state\tLoad the previusly saved game state\n" + - "-r\tRun the game from the begining\n" - ); - - System.exit(0); - } - - @Override - public void create() { - // Gdx.input.setCursorCatched(false); - if (fullscreen) - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); - - hideCursor(); - - super.create(); - } - - private void hideCursor() { - Cursor emptyCursor; - - int min = org.lwjgl.input.Cursor.getMinCursorSize(); - IntBuffer tmp = BufferUtils.createIntBuffer(min * min); - try { - emptyCursor = new org.lwjgl.input.Cursor(min, min, min / 2, - min / 2, 1, tmp, null); - - Mouse.setNativeCursor(emptyCursor); - } catch (LWJGLException e) { - e.printStackTrace(); - } - - } - - public static void main(String[] args) { - DesktopLauncher game = new DesktopLauncher(); - game.parseParams(args); - game.run(); - } -} diff --git a/test-spine/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java b/test-spine/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java new file mode 100644 index 0000000..5d204bc --- /dev/null +++ b/test-spine/desktop/src/main/java/com/bladecoder/engine/DesktopLauncher.java @@ -0,0 +1,185 @@ +package com.bladecoder.engine; + +import com.badlogic.gdx.Files.FileType; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window; +import com.bladecoder.engine.ui.SceneScreen; +import com.bladecoder.engine.ui.UI.Screens; +import com.bladecoder.engine.util.Config; +import org.lwjgl.glfw.GLFW; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +public class DesktopLauncher extends BladeEngine { + + private static final int WINDOW_WIDTH = 1920 / 2; + private static final int WINDOW_HEIGHT = 1080 / 2; + + private boolean fullscreen = true; + private final Lwjgl3ApplicationConfiguration cfg = new Lwjgl3ApplicationConfiguration(); + + private float speed = 1.0f; + + DesktopLauncher() { + Properties p = new Properties(); + + try { + InputStream s = DesktopLauncher.class.getResourceAsStream("/" + Config.PROPERTIES_FILENAME); + if (s != null) + p.load(s); + } catch (IOException e) { + System.out.println("Could not load properties file."); + } + + cfg.setTitle(p.getProperty(Config.TITLE_PROP, "Blade Engine Adventure") + " " + + p.getProperty(Config.VERSION_PROP, "")); + + cfg.setResizable(true); + cfg.useVsync(true); + } + + public void run() { + List iconList = new ArrayList<>(); + + if (DesktopLauncher.class.getResource("/icons/icon128.png") != null) + iconList.add("icons/icon128.png"); + + if (DesktopLauncher.class.getResource("/icons/icon32.png") != null) + iconList.add("icons/icon32.png"); + + if (DesktopLauncher.class.getResource("/icons/icon16.png") != null) + iconList.add("icons/icon16.png"); + + cfg.setWindowIcon(FileType.Internal, iconList.toArray(new String[0])); + cfg.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL20, 0, 0); + + new Lwjgl3Application(this, cfg); + } + + public void parseParams(String[] args) { + for (int i = 0; i < args.length; i++) { + String s = args[i]; + if (s.equals("-t")) { + if (i + 1 < args.length) { + i++; + setTestMode(args[i]); + } + } else if (s.equals("-p")) { + if (i + 1 < args.length) { + i++; + setPlayMode(args[i]); + } + } else if (s.equals("-s")) { + if (i + 1 < args.length) { + i++; + speed = Float.parseFloat(args[i]); + } + } else if (s.equals("-chapter")) { + if (i + 1 < args.length) { + i++; + setChapter(args[i]); + } + } else if (s.equals("-f")) { + fullscreen = true; + } else if (s.equals("-d")) { + setDebugMode(); + } else if (s.equals("-r")) { + setRestart(); + } else if (s.equals("-res")) { + if (i + 1 < args.length) { + i++; + forceResolution(args[i]); + } + } else if (s.equals("-aspect")) { + if (i + 1 < args.length) { + i++; + String aspect = args[i]; + + if (aspect.equals("16:9")) { + cfg.setWindowedMode(WINDOW_WIDTH, WINDOW_WIDTH * 9 / 16); + } else if (aspect.equals("4:3")) { + cfg.setWindowedMode(WINDOW_WIDTH, WINDOW_WIDTH * 3 / 4); + } else if (aspect.equals("16:10") || aspect.equals("8:5")) { + cfg.setWindowedMode(WINDOW_WIDTH, WINDOW_WIDTH * 10 / 16); + } + } + } else if (s.equals("-w")) { + fullscreen = false; + } else if (s.equals("-l")) { + if (i + 1 < args.length) { + i++; + loadGameState(args[i]); + } + } else if (s.equals("-h")) { + usage(); + } else if (s.equals("-opengl")) { + cfg.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL20, 0, 0); + } else if (s.equals("-angle")) { + cfg.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.ANGLE_GLES20, 0, 0); + } else { + if (i == 0 && !s.startsWith("-")) + continue; // When embeded JRE the 0 parameter is the app name + System.out.println("Unrecognized parameter: " + s); + usage(); + } + } + + if (!fullscreen) + cfg.setWindowedMode(WINDOW_WIDTH, WINDOW_HEIGHT); + + } + + public void usage() { + System.out.println( + "Usage:\n" + + "-chapter chapter\tLoads the selected chapter\n" + + "-t scene_name\tStart test mode for the scene\n" + + "-p record_name\tPlay previusly recorded games\n" + + "-f\tSet fullscreen mode\n" + + "-w\tSet windowed mode\n" + + "-d\tShow debug messages\n" + + "-res width\tForce the resolution width\n" + + "-l game_state\tLoad the previusly saved game state\n" + + "-r\tRun the game from the begining\n" + + "-s speed\tSets the game speed\n" + + "-aspect aspect_ratio\tSets the specified screen aspect (16:9, 4:3, 16:10)\n"); + + System.exit(0); + } + + @Override + public void create() { + if (fullscreen) + Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + + hideCursor(); + + super.create(); + + if (getUI().getScreen(Screens.SCENE_SCREEN) instanceof SceneScreen) + ((SceneScreen) getUI().getScreen(Screens.SCENE_SCREEN)).setSpeed(speed); + } + + private void hideCursor() { + Lwjgl3Window window = ((Lwjgl3Graphics) Gdx.graphics).getWindow(); + GLFW.glfwSetInputMode(window.getWindowHandle(), GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_HIDDEN); + } + + public static void main(String[] args) { +// if (SharedLibraryLoader.isMac && !"1".equals(System.getenv("JAVA_STARTED_ON_FIRST_THREAD_" + LibC.getpid()))) { +// System.out.println("MacOs detected. Running in async mode."); +// Configuration.GLFW_LIBRARY_NAME.set("glfw_async"); +// } + + DesktopLauncher game = new DesktopLauncher(); + game.parseParams(args); + game.run(); + } +} diff --git a/test-spine/gradle.properties b/test-spine/gradle.properties index 7c27a94..7a41eba 100644 --- a/test-spine/gradle.properties +++ b/test-spine/gradle.properties @@ -1,13 +1,13 @@ android.injected.testOnly=false -androidGradlePluginVersion=4.1.3 +androidGradlePluginVersion=8.1.0 appName=adventure-test-spine -bladeEngineVersion=4.1.0 -bladeInkVersion=1.0.0 -gdxControllersVersion=2.0.1 -gdxVersion=1.10.0 +bladeEngineVersion=4.3.0 +bladeInkVersion=1.1.2 +gdxControllersVersion=2.2.3 +gdxVersion=1.12.0 org.gradle.configureondemand=false org.gradle.daemon=true org.gradle.jvmargs=-Xms128m -Xmx1500m roboVMGradlePluginVersion=2.3.12 -roboVMVersion=2.3.12 +roboVMVersion=2.3.20 spinePlugin=true diff --git a/test-spine/gradle/wrapper/gradle-wrapper.properties b/test-spine/gradle/wrapper/gradle-wrapper.properties index 4d9ca16..e411586 100644 --- a/test-spine/gradle/wrapper/gradle-wrapper.properties +++ b/test-spine/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/test-spine/images-raw/spine/john.spine b/test-spine/images-raw/spine/john.spine index bc49043..2cde3b2 100644 Binary files a/test-spine/images-raw/spine/john.spine and b/test-spine/images-raw/spine/john.spine differ diff --git a/venus/assets/BladeEngine.properties b/venus/assets/BladeEngine.properties index 8c3e356..7ac61bd 100644 --- a/venus/assets/BladeEngine.properties +++ b/venus/assets/BladeEngine.properties @@ -1,6 +1,6 @@ INIT_SCREEN=org.bladecoder.venus.InitScreen MENU_SCREEN=org.bladecoder.venus.VenusMenuScreen -bladeEngineVersion=4.2.0 +bladeEngineVersion=4.3.0 bonasera_android_url=https\://play.google.com/store/apps/details?id\=com.bladecoder.lj bonasera_desktop_url=https\://bladecoder.itch.io/johnny-bonasera bonasera_ios_url=https\://itunes.apple.com/us/app/revenge-johnny-bonasera/id1151361813 @@ -9,7 +9,7 @@ gdxVersion=1.12.0 inventory_pos=down languages=en,es,de,ru,it,fr resolutions=0.5,1 -roboVMVersion=2.3.18 +roboVMVersion=2.3.20 show_desc=true single_action_inventory=true title=The Goddess Robbery diff --git a/venus/core/build.gradle b/venus/core/build.gradle index a0af75e..d60c8be 100644 --- a/venus/core/build.gradle +++ b/venus/core/build.gradle @@ -17,21 +17,19 @@ dependencies { task setVersion(type: WriteProperties) { - def props = new Properties() - def propFile = project.file("../assets/BladeEngine.properties"); - props.load(new FileReader(propFile)) - - props."version" = version - props."bladeEngineVersion" = bladeEngineVersion - props."gdxVersion" = gdxVersion - props."roboVMVersion" = roboVMVersion - - setProperties(props); - setOutputFile(propFile); - - doLast { - println "Set version info in versions.properties" - } -} - -processResources.finalizedBy(setVersion) \ No newline at end of file + def props = new Properties() + def propFile = project.file("../assets/BladeEngine.properties"); + props.load(new FileReader(propFile)) + + props."version" = version + props."bladeEngineVersion" = bladeEngineVersion + props."gdxVersion" = gdxVersion + props."roboVMVersion" = roboVMVersion + + setProperties(props); + setOutputFile(propFile); + + doLast { + println "Set version info in versions.properties" + } +} \ No newline at end of file diff --git a/venus/desktop/build.gradle b/venus/desktop/build.gradle index 5c7ca2e..51bbd43 100644 --- a/venus/desktop/build.gradle +++ b/venus/desktop/build.gradle @@ -16,6 +16,8 @@ dependencies { implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" } +def os = System.properties['os.name'].toLowerCase() + run { standardInput = System.in ignoreExitValue = true @@ -23,6 +25,10 @@ run { if (project.hasProperty("appArgs")) { args Eval.me(appArgs) } + + if (os.contains('mac')) { + jvmArgs = ["-XstartOnFirstThread"] + } } jar { @@ -64,3 +70,4 @@ task dist(type: Jar) { dist.dependsOn classes dist.dependsOn ':core:jar' +processResources.dependsOn ':core:setVersion' diff --git a/venus/desktop/src/main/java/com/bladecoder/engine/desktop/DesktopLauncher.java b/venus/desktop/src/main/java/com/bladecoder/engine/desktop/DesktopLauncher.java index ec8d521..ffc16be 100644 --- a/venus/desktop/src/main/java/com/bladecoder/engine/desktop/DesktopLauncher.java +++ b/venus/desktop/src/main/java/com/bladecoder/engine/desktop/DesktopLauncher.java @@ -161,8 +161,8 @@ private void hideCursor() { } public static void main(String[] args) { - if(System.getProperty("os.name").contains("Mac")) - Configuration.GLFW_LIBRARY_NAME.set("glfw_async"); + // if(System.getProperty("os.name").contains("Mac")) + // Configuration.GLFW_LIBRARY_NAME.set("glfw_async"); DesktopLauncher game = new DesktopLauncher(); game.parseParams(args); diff --git a/venus/gradle.properties b/venus/gradle.properties index e89e739..144612d 100644 --- a/venus/gradle.properties +++ b/venus/gradle.properties @@ -1,14 +1,17 @@ android.injected.testOnly=false android.useAndroidX=true -androidGradlePluginVersion=7.2.0 +androidGradlePluginVersion=8.1.0 appName=venus -bladeEngineVersion=4.2.0 -bladeInkVersion=1.0.0 -gdxControllersVersion=2.2.2 +bladeEngineVersion=4.3.0 +bladeInkVersion=1.1.2 +gdxControllersVersion=2.2.3 gdxVersion=1.12.0 org.gradle.configureondemand=false org.gradle.daemon=true -org.gradle.jvmargs=-Xms1024m -Xmx2048m -roboVMVersion=2.3.18 +org.gradle.jvmargs=-Xms128m -Xmx1536m +roboVMVersion=2.3.20 version=1.9 +android.enableJetifier=true + + diff --git a/venus/gradle/wrapper/gradle-wrapper.properties b/venus/gradle/wrapper/gradle-wrapper.properties index 8049c68..e411586 100644 --- a/venus/gradle/wrapper/gradle-wrapper.properties +++ b/venus/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists