v3.3.0: fixed deprecated platform checking logic
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.desktop;
|
||||
|
||||
import com.badlogic.gdx.utils.Os;
|
||||
import com.badlogic.gdx.utils.SharedLibraryLoader;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -36,7 +37,7 @@ public class DesktopLaunchValidator {
|
||||
public static boolean verifyValidJVMState(String[] args){
|
||||
|
||||
//mac computers require the -XstartOnFirstThread JVM argument
|
||||
if (SharedLibraryLoader.isMac){
|
||||
if (SharedLibraryLoader.os == Os.MacOsX){
|
||||
|
||||
// If XstartOnFirstThread is present and enabled, we can return true
|
||||
if ("1".equals(System.getenv("JAVA_STARTED_ON_FIRST_THREAD_" +
|
||||
|
||||
@@ -26,6 +26,8 @@ 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.Lwjgl3Preferences;
|
||||
import com.badlogic.gdx.utils.Architecture;
|
||||
import com.badlogic.gdx.utils.Os;
|
||||
import com.badlogic.gdx.utils.SharedLibraryLoader;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
@@ -54,10 +56,11 @@ public class DesktopLauncher {
|
||||
//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;
|
||||
SharedLibraryLoader.os = Os.Linux;
|
||||
//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");
|
||||
if (System.getProperty("os.arch").contains("64") || System.getProperty("os.arch").startsWith("armv8")){
|
||||
SharedLibraryLoader.bitness = Architecture.Bitness._64;
|
||||
}
|
||||
}
|
||||
|
||||
final String title;
|
||||
@@ -145,17 +148,17 @@ public class DesktopLauncher {
|
||||
|
||||
String basePath = "";
|
||||
Files.FileType baseFileType = null;
|
||||
if (SharedLibraryLoader.isWindows) {
|
||||
if (SharedLibraryLoader.os == Os.Windows) {
|
||||
if (System.getProperties().getProperty("os.name").equals("Windows XP")) {
|
||||
basePath = "Application Data/." + vendor + "/" + title + "/";
|
||||
} else {
|
||||
basePath = "AppData/Roaming/." + vendor + "/" + title + "/";
|
||||
}
|
||||
baseFileType = Files.FileType.External;
|
||||
} else if (SharedLibraryLoader.isMac) {
|
||||
} else if (SharedLibraryLoader.os == Os.MacOsX) {
|
||||
basePath = "Library/Application Support/" + title + "/";
|
||||
baseFileType = Files.FileType.External;
|
||||
} else if (SharedLibraryLoader.isLinux) {
|
||||
} else if (SharedLibraryLoader.os == Os.Linux) {
|
||||
String XDGHome = System.getenv("XDG_DATA_HOME");
|
||||
if (XDGHome == null) XDGHome = System.getProperty("user.home") + "/.local/share";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user