Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-freetype.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-glfw.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-nanovg.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-openal.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-opengl.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-shaderc.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-spvc.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-stb.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-tinyfd.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-vma.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl-vulkan.jar
Binary file not shown.
Binary file added JavaApp/libs/lwjgl-3.4.1/lwjgl.jar
Binary file not shown.
13 changes: 11 additions & 2 deletions Natives/JavaLauncher.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ int launchJVM(NSString *username, id launchTarget, int width, int height, int mi
BOOL launchJar = NO;
NSString *gameDir;
NSString *defaultJRETag;
NSString *lwjglFolder = @"lwjgl-3.3.3";
NSCAssert(launchTarget, @"Unexpected nil launchTarget");
if ([launchTarget isKindOfClass:NSDictionary.class]) {
// Get preferred Java version from current profile
Expand All @@ -167,6 +168,13 @@ int launchJVM(NSString *username, id launchTarget, int width, int height, int mi
defaultJRETag = @"1_17_newer";
}

// Use LWJGL 3.4.1 for 26.1+, 3.3.3 for 1.21.11 and below
int mcMajorVersion = [launchTarget[@"id"] intValue];
if (mcMajorVersion >= 26) {
lwjglFolder = @"lwjgl-3.4.1";
}
NSLog(@"[JavaLauncher] Using LWJGL from %@", lwjglFolder);

// Setup POJAV_RENDERER
NSString *renderer = [PLProfiles resolveKeyForCurrentProfile:@"renderer"];
NSLog(@"[JavaLauncher] RENDERER is set to %@\n", renderer);
Expand Down Expand Up @@ -232,7 +240,8 @@ int launchJVM(NSString *username, id launchTarget, int width, int height, int mi
}
margv[++margc] = "-Xms128M";
margv[++margc] = [NSString stringWithFormat:@"-Xmx%dM", allocmem].UTF8String;
margv[++margc] = [NSString stringWithFormat:@"-Djava.library.path=%@/Frameworks", NSBundle.mainBundle.bundlePath].UTF8String;
NSString *lwjglNativesFolder = [lwjglFolder isEqualToString:@"lwjgl-3.4.1"] ? @"lwjgl34" : @"lwjgl33";
margv[++margc] = [NSString stringWithFormat:@"-Djava.library.path=%@/Frameworks:%@/Frameworks/%@", NSBundle.mainBundle.bundlePath, NSBundle.mainBundle.bundlePath, lwjglNativesFolder].UTF8String;
margv[++margc] = [NSString stringWithFormat:@"-Duser.dir=%@", gameDir].UTF8String;
margv[++margc] = [NSString stringWithFormat:@"-Duser.home=%s", getenv("POJAV_HOME")].UTF8String;
margv[++margc] = [NSString stringWithFormat:@"-Duser.timezone=%@", NSTimeZone.localTimeZone.name].UTF8String;
Expand Down Expand Up @@ -351,7 +360,7 @@ int launchJVM(NSString *username, id launchTarget, int width, int height, int mi
init_loadCustomJvmFlags(&margc, (const char **)margv);
NSLog(@"[Init] Found JLI lib");

NSString *classpath = [NSString stringWithFormat:@"%@/*", librariesPath];
NSString *classpath = [NSString stringWithFormat:@"%@/*:%@/%@/*", librariesPath, librariesPath, lwjglFolder];
if (launchJar) {
classpath = [classpath stringByAppendingFormat:@":%@", launchTarget];
}
Expand Down
Binary file modified Natives/resources/Frameworks/libopenal.dylib

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why and what was this changed to?

Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.