From d7c96304d41ed91c3d237fd3d025eee5ff5d2613 Mon Sep 17 00:00:00 2001 From: Tommy Ettinger Date: Sat, 9 Nov 2024 21:17:26 -0800 Subject: [PATCH] Drop NFD to 3.3.1, lowering LWJGL version. LWJGL should be at 3.3.3 now. VirusTotal agrees with me now! No mysterious signs of malware! https://www.virustotal.com/gui/file/018ff85b777c5c70297c5ad4d1879edfc2683e826ccb77d910068354e3cda716?nocache=1 --- build.gradle | 26 +++++++++---------- gradle.properties | 3 +-- src/main/java/gdx/liftoff/Main.java | 6 ++--- src/main/kotlin/gdx/liftoff/views/MainView.kt | 6 ++--- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 8d83e9be..ce8cd325 100644 --- a/build.gradle +++ b/build.gradle @@ -138,19 +138,19 @@ dependencies { // implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-windows" // implementation "org.lwjgl:lwjgl:$lwjgl3Version:natives-windows-x86" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos" - implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64" - -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion"){ exclude group: 'org.lwjgl', module: 'lwjgl' } -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows"){ exclude group: 'org.lwjgl', module: 'lwjgl' } -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86"){ exclude group: 'org.lwjgl', module: 'lwjgl' } -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux"){ exclude group: 'org.lwjgl', module: 'lwjgl' } -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos"){ exclude group: 'org.lwjgl', module: 'lwjgl' } -// implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64"){ exclude group: 'org.lwjgl', module: 'lwjgl' } +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion" +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows" +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86" +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux" +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos" +// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64" + + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion"){ exclude group: 'org.lwjgl', module: 'lwjgl' } + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows"){ exclude group: 'org.lwjgl', module: 'lwjgl' } + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-windows-x86"){ exclude group: 'org.lwjgl', module: 'lwjgl' } + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux"){ exclude group: 'org.lwjgl', module: 'lwjgl' } + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos"){ exclude group: 'org.lwjgl', module: 'lwjgl' } + implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-macos-arm64"){ exclude group: 'org.lwjgl', module: 'lwjgl' } // necessary because the current gdx-autumn-desktop-fcs has an implementation dep on this, and we need it here. diff --git a/gradle.properties b/gradle.properties index 9b45b038..1d3262f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,6 @@ org.gradle.daemon=false org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 liftoffVersion=1.13.0.1-SNAPSHOT -#kotlinVersion=1.9.25 kotlinVersion=2.0.21 gdxVersion=1.12.1 lmlVersion=1.10.1.12.1 @@ -9,5 +8,5 @@ lmlVersion=1.10.1.12.1 visUiVersion=1aef382077 commonsExecVersion=1.3 lwjgl3Version=3.3.3 -nfdVersion=3.3.4 +nfdVersion=3.3.1 iconizerVersion=0.1.0 diff --git a/src/main/java/gdx/liftoff/Main.java b/src/main/java/gdx/liftoff/Main.java index e9fb1505..8a6c6d3d 100644 --- a/src/main/java/gdx/liftoff/Main.java +++ b/src/main/java/gdx/liftoff/Main.java @@ -431,11 +431,10 @@ public static void pickDirectory(FileHandle initialFolder, FileChooserAdapter ca initialPath = initialPath.replace("/", "\\"); } - NativeFileDialog.NFD_Init(); PointerBuffer pathPointer = memAllocPointer(1); try { - int status = NativeFileDialog.NFD_PickFolder(pathPointer, initialPath); + int status = NativeFileDialog.NFD_PickFolder(initialPath, pathPointer); if (status == NativeFileDialog.NFD_CANCEL) { callback.canceled(); @@ -448,7 +447,7 @@ public static void pickDirectory(FileHandle initialFolder, FileChooserAdapter ca } String folder = pathPointer.getStringUTF8(0); - NativeFileDialog.nNFD_FreePath(pathPointer.get(0)); + NativeFileDialog.nNFD_Free(pathPointer.get(0)); Array array = new Array<>(); array.add(Gdx.files.absolute(folder)); @@ -469,7 +468,6 @@ public static void pickDirectory(FileHandle initialFolder, FileChooserAdapter ca stage.addActor(fileChooser.fadeIn()); } finally { - NativeFileDialog.NFD_Quit(); memFree(pathPointer); } } diff --git a/src/main/kotlin/gdx/liftoff/views/MainView.kt b/src/main/kotlin/gdx/liftoff/views/MainView.kt index fff77652..0eef1749 100644 --- a/src/main/kotlin/gdx/liftoff/views/MainView.kt +++ b/src/main/kotlin/gdx/liftoff/views/MainView.kt @@ -125,11 +125,10 @@ class MainView : ActionContainer { initialPath = initialPath.replace("/", "\\") } - NativeFileDialog.NFD_Init() val pathPointer = memAllocPointer(1) try { - val status = NativeFileDialog.NFD_PickFolder(pathPointer, initialPath) + val status = NativeFileDialog.NFD_PickFolder(initialPath, pathPointer) if (status == NativeFileDialog.NFD_CANCEL) { callback.canceled() @@ -142,7 +141,7 @@ class MainView : ActionContainer { } val folder = pathPointer.getStringUTF8(0) - NativeFileDialog.nNFD_FreePath(pathPointer.get(0)) + NativeFileDialog.nNFD_Free(pathPointer.get(0)) val array = GdxArray() array.add(Gdx.files.absolute(folder)) @@ -163,7 +162,6 @@ class MainView : ActionContainer { form.stage.addActor(fileChooser.fadeIn()) } finally { - NativeFileDialog.NFD_Quit() memFree(pathPointer) } }