Skip to content

Commit

Permalink
Drop NFD to 3.3.1, lowering LWJGL version.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tommyettinger committed Nov 10, 2024
1 parent 850316c commit d7c9630
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
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
#visUiVersion=1.5.3
visUiVersion=1aef382077
commonsExecVersion=1.3
lwjgl3Version=3.3.3
nfdVersion=3.3.4
nfdVersion=3.3.1
iconizerVersion=0.1.0
6 changes: 2 additions & 4 deletions src/main/java/gdx/liftoff/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<FileHandle> array = new Array<>();
array.add(Gdx.files.absolute(folder));
Expand All @@ -469,7 +468,6 @@ public static void pickDirectory(FileHandle initialFolder, FileChooserAdapter ca

stage.addActor(fileChooser.fadeIn());
} finally {
NativeFileDialog.NFD_Quit();
memFree(pathPointer);
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/kotlin/gdx/liftoff/views/MainView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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<FileHandle>()
array.add(Gdx.files.absolute(folder))
Expand All @@ -163,7 +162,6 @@ class MainView : ActionContainer {

form.stage.addActor(fileChooser.fadeIn())
} finally {
NativeFileDialog.NFD_Quit()
memFree(pathPointer)
}
}
Expand Down

0 comments on commit d7c9630

Please sign in to comment.