1
0
forked from Clones/Controlify

Finish & fix abstract controller manager + optimize hashmaps in codebase + no SDL screen

This commit is contained in:
Xander
2023-11-05 18:23:28 +00:00
parent b07066e097
commit f527f21fd2
24 changed files with 271 additions and 133 deletions

View File

@ -54,6 +54,11 @@ public class SDL2NativesManager {
attemptedLoad = true;
if (!isSupportedOnThisPlatform()) {
Log.LOGGER.warn("No native library for current platform, skipping SDL2 load");
return initFuture = CompletableFuture.completedFuture(false);
}
Path localLibraryPath = getNativesFolderPath().resolve(Target.CURRENT.getArtifactName());
if (Files.exists(localLibraryPath)) {
@ -178,6 +183,10 @@ public class SDL2NativesManager {
return attemptedLoad;
}
public static boolean isSupportedOnThisPlatform() {
return Target.CURRENT.hasNativeLibrary();
}
private static Path getNativesFolderPath() {
Path nativesFolderPath = FabricLoader.getInstance().getGameDir();
ControlifyConfig config = Controlify.instance().config();