diff --git a/Platform/Apple/tools/jace/pom.xml b/Platform/Apple/tools/jace/pom.xml index f4cf1609..fcec0158 100644 --- a/Platform/Apple/tools/jace/pom.xml +++ b/Platform/Apple/tools/jace/pom.xml @@ -46,9 +46,16 @@ com.gluonhq gluonfx-maven-plugin - 1.0.21 + 1.0.22 jace.LawlessLegends + + .* + + + The 8-Bit Bunch + true + diff --git a/Platform/Apple/tools/jace/src/main/java/jace/lawless/Media.java b/Platform/Apple/tools/jace/src/main/java/jace/lawless/Media.java index f62f6fcb..8b1fcdc2 100644 --- a/Platform/Apple/tools/jace/src/main/java/jace/lawless/Media.java +++ b/Platform/Apple/tools/jace/src/main/java/jace/lawless/Media.java @@ -1,7 +1,7 @@ package jace.lawless; +import java.io.File; import java.io.IOException; -import java.net.URLDecoder; import java.nio.IntBuffer; import java.nio.ShortBuffer; @@ -18,10 +18,17 @@ public class Media { long sampleRate = 0; boolean isStereo = true; ShortBuffer sampleBuffer; + File tempFile; public Media(String resourcePath) throws IOException { + // Copy resource to temp file because STBVorbis can't read from jar + tempFile = File.createTempFile("temp", ".ogg"); + tempFile.deleteOnExit(); + getClass().getResource(resourcePath).openStream().transferTo(new java.io.FileOutputStream(tempFile)); + String canonicalPath = tempFile.getAbsolutePath(); + // Get caononical file path from relative resource path - String canonicalPath = URLDecoder.decode(getClass().getResource(resourcePath).getPath(), "UTF-8"); + // String canonicalPath = URLDecoder.decode(getClass().getResource(resourcePath).getPath(), "UTF-8"); System.out.println("Loading media: " + canonicalPath); try (MemoryStack stack = MemoryStack.stackPush()) { @@ -97,6 +104,8 @@ public class Media { public void close() { MemoryUtil.memFree(sampleBuffer); + if (tempFile != null && tempFile.exists()) + tempFile.delete(); } public void seekToTime(Duration millis) { diff --git a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/jni-config.json b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/jni-config.json index 43715d50..8e66ee29 100644 --- a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/jni-config.json +++ b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/jni-config.json @@ -381,66 +381,11 @@ {"name":"skip","parameterTypes":["long"] } ] }, -{ - "name":"com.sun.media.sound.DirectAudioDevice", - "methods":[ - { - "name":"addFormat", - "parameterTypes":[ - "java.util.Vector", - "int", - "int", - "int", - "float", - "int", - "boolean", - "boolean" - ] - } - ] -}, -{ - "name":"com.sun.media.sound.DirectAudioDeviceProvider$DirectAudioDeviceInfo", - "methods":[ - { - "name":"", - "parameterTypes":[ - "int", - "int", - "int", - "java.lang.String", - "java.lang.String", - "java.lang.String", - "java.lang.String" - ] - } - ] -}, -{ - "name":"com.sun.media.sound.PortMixerProvider$PortMixerInfo", - "methods":[ - { - "name":"", - "parameterTypes":[ - "int", - "java.lang.String", - "java.lang.String", - "java.lang.String", - "java.lang.String" - ] - } - ] -}, { "name":"java.lang.Boolean", "methods":[ - { - "name":"getBoolean", - "parameterTypes":[ - "java.lang.String" - ] - }, - {"name":"booleanValue","parameterTypes":[] } + {"name":"booleanValue","parameterTypes":[] }, + {"name":"getBoolean","parameterTypes":["java.lang.String"] } ] }, { diff --git a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/reflect-config.json b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/reflect-config.json index 214d5b09..ad3e9926 100644 --- a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/reflect-config.json +++ b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/reflect-config.json @@ -410,6 +410,7 @@ "queryAllDeclaredMethods":true, "methods":[ {"name":"","parameterTypes":[] }, + {"name":"executeClicked","parameterTypes":["javafx.event.ActionEvent"] }, {"name":"initialize","parameterTypes":[] }, {"name":"newApplesoftBasicClicked","parameterTypes":["javafx.event.ActionEvent"] }, {"name":"newApplesoftBasicFromMemoryClicked","parameterTypes":["javafx.event.ActionEvent"] }, @@ -509,14 +510,54 @@ "name":"java.net.URLConnection", "methods":[{"name":"getContentLengthLong","parameterTypes":[] }] }, +{ + "name":"java.nio.Buffer", + "allDeclaredFields":true +}, { "name":"java.nio.ByteBuffer", + "allDeclaredFields":true, "methods":[{"name":"order","parameterTypes":["java.nio.ByteOrder"] }] }, { "name":"java.nio.ByteOrder", "methods":[{"name":"nativeOrder","parameterTypes":[] }] }, +{ + "name":"java.nio.DirectByteBuffer", + "allDeclaredFields":true, + "unsafeAllocated":true +}, +{ + "name":"java.nio.DirectCharBufferU", + "allDeclaredFields":true +}, +{ + "name":"java.nio.DirectDoubleBufferU", + "allDeclaredFields":true +}, +{ + "name":"java.nio.DirectFloatBufferU", + "allDeclaredFields":true +}, +{ + "name":"java.nio.DirectIntBufferU", + "allDeclaredFields":true, + "unsafeAllocated":true +}, +{ + "name":"java.nio.DirectLongBufferU", + "allDeclaredFields":true +}, +{ + "name":"java.nio.DirectShortBufferU", + "allDeclaredFields":true, + "unsafeAllocated":true +}, +{ + "name":"java.nio.MappedByteBuffer", + "allDeclaredFields":true +}, { "name":"java.security.AlgorithmParametersSpi" }, @@ -1006,9 +1047,23 @@ { "name":"org.ibex.nestedvm.util.Seekable" }, +{ + "name":"org.lwjgl.system.CustomBuffer", + "fields":[ + {"name":"capacity"}, + {"name":"container"}, + {"name":"limit"}, + {"name":"mark"}, + {"name":"position"} + ] +}, +{ + "name":"org.lwjgl.system.Pointer$Default", + "fields":[{"name":"address"}] +}, { "name":"sun.misc.Unsafe", - "fields":[{"name":"theUnsafe"}] + "allDeclaredFields":true }, { "name":"sun.security.pkcs12.PKCS12KeyStore", diff --git a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/resource-config.json b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/resource-config.json index 48381a13..dfeaf7e3 100644 --- a/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/resource-config.json +++ b/Platform/Apple/tools/jace/src/main/resources/META-INF/native-image/resource-config.json @@ -1,30 +1,105 @@ { "resources":{ - "includes":[ - {"pattern": ".*\\.bin$"}, - {"pattern": ".*\\.rom$"}, - {"pattern": ".*\\.mp3$"}, - {"pattern": ".*\\.png$"}, - {"pattern": ".*\\.jpg$"}, - {"pattern": ".*\\.jpeg$"}, - {"pattern": ".*\\.gif$"}, - {"pattern": ".*\\.bmp$"}, - {"pattern": ".*\\.ttf$"}, - {"pattern": ".*\\.raw$"}, - {"pattern": ".*\\.xml$"}, - {"pattern": ".*\\.fxml$"}, - {"pattern": ".*\\.css$"}, - {"pattern": ".*\\.gls$"}, - {"pattern": ".*\\.json$"}, - {"pattern": ".*\\.dat$"}, - {"pattern": ".*\\.license$"}, - {"pattern": ".*\\.frag$"}, - {"pattern": ".*\\.vert$"}, - {"pattern": ".*\\.obj$"}, - {"pattern": ".*\\.mtl$"}, - {"pattern": ".*\\.js$"}, - {"pattern": ".*\\.html$"}, - {"pattern": ".*\\.txt$"} - ] - } -} \ No newline at end of file + "includes":[ + { + "pattern":".*\\.bin$" + }, + { + "pattern":".*\\.bmp$" + }, + { + "pattern":".*\\.css$" + }, + { + "pattern":".*\\.dat$" + }, + { + "pattern":".*\\.frag$" + }, + { + "pattern":".*\\.fxml$" + }, + { + "pattern":".*\\.gif$" + }, + { + "pattern":".*\\.gls$" + }, + { + "pattern":".*\\.html$" + }, + { + "pattern":".*\\.jpeg$" + }, + { + "pattern":".*\\.jpg$" + }, + { + "pattern":".*\\.js$" + }, + { + "pattern":".*\\.json$" + }, + { + "pattern":".*\\.license$" + }, + { + "pattern":".*\\.ogg$" + }, + { + "pattern":".*\\.mtl$" + }, + { + "pattern":".*\\.obj$" + }, + { + "pattern":".*\\.png$" + }, + { + "pattern":".*\\.raw$" + }, + { + "pattern":".*\\.rom$" + }, + { + "pattern":".*\\.ttf$" + }, + { + "pattern":".*\\.txt$" + }, + { + "pattern":".*\\.vert$" + }, + { + "pattern":".*\\.xml$" + }, + { + "pattern":"\\QMETA-INF/macos/x64/org/lwjgl/liblwjgl.dylib.sha1\\E" + }, + { + "pattern":"\\QMETA-INF/macos/x64/org/lwjgl/openal/libopenal.dylib.sha1\\E" + }, + { + "pattern":"\\QMETA-INF/macos/x64/org/lwjgl/stb/liblwjgl_stb.dylib.sha1\\E" + }, + { + "pattern":"\\Qmacos/x64/org/lwjgl/liblwjgl.dylib\\E" + }, + { + "pattern":"\\Qmacos/x64/org/lwjgl/openal/libopenal.dylib\\E" + }, + { + "pattern":"\\Qmacos/x64/org/lwjgl/stb/liblwjgl_stb.dylib\\E" + } + ]}, + "bundles":[ + { + "name":"com.sun.javafx.tk.quantum.QuantumMessagesBundle", + "locales":[""] + }, + { + "name":"com/sun/javafx/scene/control/skin/resources/controls", + "locales":[""] + } + ] +}