From 740127b89d01d9822778e742ddc1e3ac94a8e69b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 16 Oct 2021 14:34:00 -0400 Subject: [PATCH] v1.1.0: fixed natives loading issues with FreeBSD --- .../desktop/DesktopLauncher.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/desktop/src/main/java/com/shatteredpixel/shatteredpixeldungeon/desktop/DesktopLauncher.java b/desktop/src/main/java/com/shatteredpixel/shatteredpixeldungeon/desktop/DesktopLauncher.java index 667ed6118..243402c75 100644 --- a/desktop/src/main/java/com/shatteredpixel/shatteredpixeldungeon/desktop/DesktopLauncher.java +++ b/desktop/src/main/java/com/shatteredpixel/shatteredpixeldungeon/desktop/DesktopLauncher.java @@ -26,8 +26,10 @@ 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.Lwjgl3FileHandle; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3NativesLoader; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Preferences; import com.badlogic.gdx.files.FileHandle; +import com.badlogic.gdx.utils.GdxNativesLoader; import com.badlogic.gdx.utils.SharedLibraryLoader; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; @@ -51,6 +53,15 @@ public class DesktopLauncher { if (!DesktopLaunchValidator.verifyValidJVMState(args)){ return; } + + //detection for FreeBSD (which is equivalent to linux for us) + //TODO might want to merge request this to libGDX + if (System.getProperty("os.name").contains("FreeBSD")) { + SharedLibraryLoader.isLinux = true; + //this overrides incorrect values set in SharedLibraryLoader's static initializer + SharedLibraryLoader.isIos = false; + SharedLibraryLoader.is64Bit = System.getProperty("os.arch").contains("64") || System.getProperty("os.arch").startsWith("armv8"); + } final String title; if (DesktopLauncher.class.getPackage().getSpecificationTitle() == null){