mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
..
This commit is contained in:
@@ -20,9 +20,21 @@ import java.util.Optional;
|
||||
public class Main {
|
||||
private static final String versionString = BuildInfo.getVersionString();
|
||||
public static void main(String[] args) {
|
||||
if (!OperatingSystem.isWindows()) {
|
||||
/* Prevents crash on non Windows OS before creating the LWJGL3 window.
|
||||
It seems it defeats the purpose of having a splash image since
|
||||
this is an indicator if the LWJGL3 has booted up succesfully. */
|
||||
closeSplash();
|
||||
}
|
||||
new GameLauncher(versionString);
|
||||
}
|
||||
|
||||
public static void closeSplash() {
|
||||
try {
|
||||
Optional.ofNullable(SplashScreen.getSplashScreen()).ifPresent(SplashScreen::close);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static class DesktopAdapter implements IDeviceAdapter {
|
||||
private final String switchOrientationFile;
|
||||
|
||||
@@ -96,15 +108,7 @@ public class Main {
|
||||
|
||||
@Override
|
||||
public void closeSplashScreen() {
|
||||
// FIXME: on Linux system it can't close splashscreen image or crash with SIGSEGV? How come it works on other OS?
|
||||
if (OperatingSystem.isUnix() || OperatingSystem.isSolaris())
|
||||
return;
|
||||
//could throw exception..
|
||||
try {
|
||||
Optional.ofNullable(SplashScreen.getSplashScreen()).ifPresent(SplashScreen::close);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
closeSplash();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user