mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 14:51:51 -04:00
[Mod installer] Try to attach JNI thread anyways
This commit is contained in:
parent
189793020c
commit
58bb44f89a
@ -91,7 +91,7 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
|
||||
if (attached) {
|
||||
drawing = JREUtils.renderAWTScreenFrame(canvas, mWidth, mHeight);
|
||||
}
|
||||
canvas.drawText("FPS: " + fps() + ", attached=" + attached + ", drawing=" + drawing, 50, 50, fpsPaint);
|
||||
canvas.drawText("FPS: " + (Math.round(fps() * 10) / 10) + ", attached=" + attached + ", drawing=" + drawing, 50, 50, fpsPaint);
|
||||
|
||||
mSurface.unlockCanvasAndPost(canvas);
|
||||
} catch (Throwable th) {
|
||||
|
@ -8,7 +8,10 @@
|
||||
// TODO: check for memory leaks
|
||||
int printed = 0;
|
||||
JNIEXPORT jboolean JNICALL Java_net_kdt_pojavlaunch_JREUtils_renderAWTScreenFrame(JNIEnv* env, jclass clazz, jobject canvas, jint width, jint height) {
|
||||
if (runtimeJNIEnvPtr_ANDROID == NULL) return JNI_FALSE;
|
||||
if (runtimeJNIEnvPtr_ANDROID == NULL) {
|
||||
if (runtimeJavaVMPtr == NULL) return JNI_FALSE;
|
||||
(*runtimeJavaVMPtr)->AttachCurrentThread(runtimeJavaVMPtr, &runtimeJNIEnvPtr_ANDROID, NULL);
|
||||
}
|
||||
|
||||
int *rgbArray;
|
||||
jintArray jreRgbArray, androidRgbArray;
|
||||
|
@ -55,6 +55,9 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) {
|
||||
|
||||
DetachCurrentThread(vm);
|
||||
*/
|
||||
|
||||
androidJNIEnvPtr_JRE = NULL;
|
||||
runtimeJNIEnvPtr_ANDROID = NULL;
|
||||
}
|
||||
|
||||
#define ADD_CALLBACK_WWIN(NAME) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user