Mac stuff even if it doesn't work

This commit is contained in:
fgnm
2020-08-06 13:26:37 +02:00
parent 8db26d34ac
commit 7f7fb989ab
3 changed files with 8 additions and 2 deletions
+1
View File
@@ -139,6 +139,7 @@ runtime {
resourceDir = file("resources-linux")
} else if (osName.contains('mac')) {
imageOptions += ["--icon", file("icons/icon.icns")]
jvmArgs = ['-XstartOnFirstThread', '-Djava.awt.headless=true']
installerType = 'dmg'
}
}
BIN
View File
Binary file not shown.
@@ -23,6 +23,7 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
@@ -48,7 +49,7 @@ public class Main {
new Lwjgl3Application(HyperLap2DApp.initInstance(dm.width, dm.height), config);
}
public static String getJarContainingFolder(Class aclass){
public static String getJarContainingFolder(Class aclass) {
CodeSource codeSource = aclass.getProtectionDomain().getCodeSource();
File jarFile;
@@ -64,7 +65,11 @@ public class Main {
else {
String path = aclass.getResource(aclass.getSimpleName() + ".class").getPath();
String jarFilePath = path.substring(path.indexOf(":") + 1, path.indexOf("!"));
jarFilePath = URLDecoder.decode(jarFilePath, StandardCharsets.UTF_8);
try {
jarFilePath = URLDecoder.decode(jarFilePath, String.valueOf(StandardCharsets.UTF_8));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
jarFile = new File(jarFilePath);
}
return jarFile.getParentFile().getAbsolutePath();