- Avoid printing "Session ID". Several Minecraft versions do that.
- Fixes Minecraft 1.13 snapshot due to the usage of LWJGL functions from an older version.
- Minecraft's built in Fullscreen Resolution scaler is available now, but not working properly.
- Regal internal changes (still fail at )
This commit is contained in:
Duy Tran Khanh committed 2021-08-23 11:19:54 +07:00
1 parent 261e74a4de
commit 5ce5dbcc00
9 files changed
+99 -32

No files matched your search

@@ -18,7 +18,7 @@ public class AccountJNI {
// Call back about account credentials for login
public static boolean loginAccount(int type,
String data // One of:
// Offline username
// Local username
// Mojang json response
// Microsoft token
) {
+22 -18
View File
@@ -687,9 +687,11 @@ public class GLFW
mGLFWFramebufferSizeCallback = GLFWFramebufferSizeCallback.createSafe(nglfwSetFramebufferSizeCallback(window, memAddressSafe(cbfun)));
/*
try {
mGLFWFramebufferSizeCallback.invoke(window, mGLFWWindowWidth, mGLFWWindowHeight);
} catch (Throwable th) {}
*/
return lastCallback;
}
@@ -823,7 +825,6 @@ public class GLFW
@NativeType("GLFWwindow *")
public static long glfwGetCurrentContext() {
// Stub prevent NULL check
return nativeEglGetCurrentContext();
}
@@ -913,14 +914,17 @@ public class GLFW
@NativeType("GLFWmonitor *")
public static long glfwGetWindowMonitor(@NativeType("GLFWwindow *") long window) {
return mGLFWWindowMonitor;
return internalGetWindow(window).monitor;
}
public static void glfwSetWindowMonitor(@NativeType("GLFWwindow *") long window, @NativeType("GLFWmonitor *") long monitor, int xpos, int ypos, int width, int height, int refreshRate) {
// weird calculation to fake pointer
mGLFWWindowMonitor = window * monitor;
GLFWWindowProperties properties = internalGetWindow(window);
properties.monitor = monitor;
properties.x = xpos;
properties.y = ypos;
internalChangeMonitorSize(width, height);
}
public static int glfwGetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib) {
return internalGetWindow(window).windowAttribs.get(attrib);
}
@@ -1012,22 +1016,22 @@ public class GLFW
// GLFW Window functions
public static long glfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) {
EventLoop.OffScreen.check();
// Create an ACTUAL EGL context
long ptr = nativeEglCreateContext(share);
//nativeEglMakeCurrent(ptr);
GLFWWindowProperties win = new GLFWWindowProperties();
// Create an ACTUAL EGL context
long ptr = nativeEglCreateContext(share);
//nativeEglMakeCurrent(ptr);
GLFWWindowProperties win = new GLFWWindowProperties();
// win.width = width;
// win.height = height;
win.width = mGLFWWindowWidth;
win.height = mGLFWWindowHeight;
win.width = width;
win.height = height;
win.title = title;
// win.width = mGLFWWindowWidth;
// win.height = mGLFWWindowHeight;
win.title = title;
mGLFWWindowMap.put(ptr, win);
mainContext = ptr;
return ptr;
mGLFWWindowMap.put(ptr, win);
mainContext = ptr;
return ptr;
//Return our context
}
@@ -8,6 +8,7 @@ public class GLFWWindowProperties {
public int x, y;
public CharSequence title;
public boolean shouldClose, isInitialSizeCalled, isCursorEntered;
public long monitor;
public Map<Integer, Integer> inputModes = new HashMap<>();
public Map<Integer, Integer> windowAttribs = new HashMap<>();
@@ -91,6 +91,8 @@ public final class GL {
}
}
private static native void nativeRegalMakeCurrent();
private GL() {}
/** Ensures that the lwjgl_opengl shared library has been loaded. */
@@ -370,7 +372,7 @@ public final class GL {
// This fixed framebuffer issue on 1.13+ 64-bit by another making current
GLFW.nativeEglMakeCurrent(GLFW.mainContext);
if (isUsingRegal) {
callPV(callJ(functionProvider.getFunctionAddress("eglGetCurrentContext"), functionProvider.getFunctionAddress("RegalMakeCurrent"));
nativeRegalMakeCurrent();
}
} else if (System.getenv("RENDERER").contains("zink")) {
int[] dims = getNativeWidthHeight();
@@ -1838,6 +1838,18 @@ public final class MemoryUtil {
return a ^ ((a ^ b) & mask);
}
/**
* Sets all bytes in a specified block of memory to a copy of another block.
*
* @param src the source memory address
* @param dst the destination memory address
* @param bytes the number of bytes to copy
*/
// from LWJGL 3.1.2
public static void memCopy(long src, long dst, int bytes) {
memCopy(src, dst, (long)bytes);
}
/**
* Sets all bytes in a specified block of memory to a copy of another block.
*