mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
attempt fix blank + updated x64 libs
This commit is contained in:
parent
04cc1f4646
commit
0967dae16c
@ -36,8 +36,6 @@ LOCAL_SRC_FILES := \
|
|||||||
input_bridge_v3.c \
|
input_bridge_v3.c \
|
||||||
jre_launcher.c \
|
jre_launcher.c \
|
||||||
utils.c
|
utils.c
|
||||||
LOCAL_SHARED_LIBRARIES := xhook
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/xhook
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
@ -664,6 +664,9 @@ void pojavTerminate() {
|
|||||||
|
|
||||||
JNIEXPORT void JNICALL Java_net_kdt_pojavlaunch_utils_JREUtils_setupBridgeWindow(JNIEnv* env, jclass clazz, jobject surface) {
|
JNIEXPORT void JNICALL Java_net_kdt_pojavlaunch_utils_JREUtils_setupBridgeWindow(JNIEnv* env, jclass clazz, jobject surface) {
|
||||||
potatoBridge.androidWindow = ANativeWindow_fromSurface(env, surface);
|
potatoBridge.androidWindow = ANativeWindow_fromSurface(env, surface);
|
||||||
|
char *ptrStr = malloc(sizeof(long));
|
||||||
|
sprintf(ptrStr, "%ld", (long) potatoBridge.androidWindow);
|
||||||
|
setenv("POJAV_WINDOW_PTR", ptrStr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* pojavGetCurrentContext() {
|
void* pojavGetCurrentContext() {
|
||||||
@ -762,6 +765,7 @@ bool loadSymbolsVirGL() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int pojavInit() {
|
int pojavInit() {
|
||||||
|
potatoBridge.androidWindow = (void *)atol(getenv("POJAV_WINDOW_PTR"));
|
||||||
ANativeWindow_acquire(potatoBridge.androidWindow);
|
ANativeWindow_acquire(potatoBridge.androidWindow);
|
||||||
savedWidth = ANativeWindow_getWidth(potatoBridge.androidWindow);
|
savedWidth = ANativeWindow_getWidth(potatoBridge.androidWindow);
|
||||||
savedHeight = ANativeWindow_getHeight(potatoBridge.androidWindow);
|
savedHeight = ANativeWindow_getHeight(potatoBridge.androidWindow);
|
||||||
@ -1032,17 +1036,14 @@ Java_org_lwjgl_glfw_GLFW_nativeEglDetachOnCurrentThread(JNIEnv *env, jclass claz
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL
|
void* pojavCreateContext(void* contextSrc) {
|
||||||
Java_org_lwjgl_glfw_GLFW_nativeEglCreateContext(JNIEnv *env, jclass clazz, jlong contextSrc) {
|
|
||||||
if (config_renderer == RENDERER_GL4ES) {
|
if (config_renderer == RENDERER_GL4ES) {
|
||||||
const EGLint ctx_attribs[] = {
|
const EGLint ctx_attribs[] = {
|
||||||
EGL_CONTEXT_CLIENT_VERSION, atoi(getenv("LIBGL_ES")),
|
EGL_CONTEXT_CLIENT_VERSION, atoi(getenv("LIBGL_ES")),
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
EGLContext* ctx = eglCreateContext_p(potatoBridge.eglDisplay, config, (void*)contextSrc, ctx_attribs);
|
EGLContext* ctx = eglCreateContext_p(potatoBridge.eglDisplay, config, (void*)contextSrc, ctx_attribs);
|
||||||
|
|
||||||
potatoBridge.eglContext = ctx;
|
potatoBridge.eglContext = ctx;
|
||||||
|
|
||||||
printf("EGLBridge: Created CTX pointer = %p\n",ctx);
|
printf("EGLBridge: Created CTX pointer = %p\n",ctx);
|
||||||
//(*env)->ThrowNew(env,(*env)->FindClass(env,"java/lang/Exception"),"Trace exception");
|
//(*env)->ThrowNew(env,(*env)->FindClass(env,"java/lang/Exception"),"Trace exception");
|
||||||
return (long)ctx;
|
return (long)ctx;
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
// Boardwalk: missing include
|
// Boardwalk: missing include
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <xhook.h>
|
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@ -85,15 +83,6 @@ typedef jint JLI_Launch_func(int argc, char ** argv, /* main argc, argc */
|
|||||||
jint ergo /* ergonomics class policy */
|
jint ergo /* ergonomics class policy */
|
||||||
);
|
);
|
||||||
|
|
||||||
void* (*old_dlopen)(const char *filename, int flags);
|
|
||||||
void* custom_dlopen(const char *filename, int flags) {
|
|
||||||
if (flags == (RTLD_LAZY | RTLD_LOCAL)) {
|
|
||||||
return old_dlopen(filename, RTLD_LAZY | RTLD_GLOBAL);
|
|
||||||
} else {
|
|
||||||
return old_dlopen(filename, flags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static jint launchJVM(int margc, char** margv) {
|
static jint launchJVM(int margc, char** margv) {
|
||||||
void* libjli = dlopen("libjli.so", RTLD_LAZY | RTLD_GLOBAL);
|
void* libjli = dlopen("libjli.so", RTLD_LAZY | RTLD_GLOBAL);
|
||||||
|
|
||||||
@ -170,13 +159,6 @@ JNIEXPORT jint JNICALL Java_com_oracle_dalvik_VMLauncher_launchJVM(JNIEnv *env,
|
|||||||
CATCHSIG(SIGXFSZ);
|
CATCHSIG(SIGXFSZ);
|
||||||
//Signal trapper ready
|
//Signal trapper ready
|
||||||
|
|
||||||
// Since we have moved from JNI call to LWJGL call for fixing GL context
|
|
||||||
// set incorrectly, we're facing another problem: fields in the previously
|
|
||||||
// loaded pojavexec aren't shared to LWJGL loaded one, is it because
|
|
||||||
// of RTLD_LOCAL? hook moment.
|
|
||||||
xhook_register(".*/liblwjgl.so$","dlopen",custom_dlopen,&old_dlopen);
|
|
||||||
xhook_refresh(1);
|
|
||||||
|
|
||||||
// Save dalvik JNIEnv pointer for JVM launch thread
|
// Save dalvik JNIEnv pointer for JVM launch thread
|
||||||
dalvikJNIEnvPtr_ANDROID = env;
|
dalvikJNIEnvPtr_ANDROID = env;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user