Skip to content

Commit

Permalink
Downgrade to LWJGL 3.3.3, NFD 3.3.1 again.
Browse files Browse the repository at this point in the history
This means libGDX 1.12.1, again, but you can still select 1.13.0 as a GDX version. If you do, now the x86 Windows DLLs will not be distributed in JARs you build, saving your skin if antivirus gets angry. Liftoff itself is still, for some reason, x86 Windows compatible.
  • Loading branch information
tommyettinger committed Dec 7, 2024
1 parent ef686a4 commit a4b1f7b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
37 changes: 19 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ jar {
archiveFileName.set(jarName)
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA',
'gdx.dll')
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**', 'windows/x86/**')
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
doLast {
file(archiveFile).setExecutable(true, false)
Expand Down Expand Up @@ -148,22 +147,24 @@ dependencies {
//// implementation "org.lwjgl:lwjgl-stb:$lwjgl3Version:natives-windows-x86"
//// 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"
// 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-linux-arm32"
implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm64"
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:natives-linux"
// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm32"
// implementation "org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm64"
// 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-linux-arm32"){ exclude group: 'org.lwjgl', module: 'lwjgl' }
implementation("org.lwjgl:lwjgl-nfd:$nfdVersion:natives-linux-arm64"){ 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
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ org.gradle.daemon=false
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
liftoffVersion=1.13.0.2-SNAPSHOT
kotlinVersion=2.0.21
gdxVersion=1.13.0
gdxVersion=1.12.1
lmlVersion=1.10.1.12.1
#visUiVersion=1.5.3
visUiVersion=1aef382077
commonsExecVersion=1.3
lwjgl3Version=3.3.4
nfdVersion=3.3.4
lwjgl3Version=3.3.3
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
2 changes: 1 addition & 1 deletion src/main/kotlin/gdx/liftoff/data/platforms/Lwjgl3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jar {
// 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/**')
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**'${if(project.advanced.gdxVersion == "1.13.0") ", 'windows/x86/**'" else ""})
}
// setting the manifest makes the JAR runnable.
manifest {
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 a4b1f7b

Please sign in to comment.