You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fixes on android:
- creating Vulkan context instead of OpenGL - checking for validity of ENV in wrapper classes - fix for access to JavaVM from threads
This commit is contained in:
@@ -38,6 +38,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
|
||||
return false;
|
||||
|
||||
JNIEnv *env = get_jni_env();
|
||||
ERR_FAIL_COND_V(env == nullptr, false);
|
||||
|
||||
MethodInfo *method = nullptr;
|
||||
for (List<MethodInfo>::Element *E = M->get().front(); E; E = E->next()) {
|
||||
@@ -965,6 +966,7 @@ Ref<JavaClass> JavaClassWrapper::wrap(const String &p_class) {
|
||||
return class_cache[p_class];
|
||||
|
||||
JNIEnv *env = get_jni_env();
|
||||
ERR_FAIL_COND_V(env == nullptr, Ref<JavaClass>());
|
||||
|
||||
jclass bclass = env->FindClass(p_class.utf8().get_data());
|
||||
ERR_FAIL_COND_V(!bclass, Ref<JavaClass>());
|
||||
@@ -1149,6 +1151,7 @@ JavaClassWrapper::JavaClassWrapper(jobject p_activity) {
|
||||
singleton = this;
|
||||
|
||||
JNIEnv *env = get_jni_env();
|
||||
ERR_FAIL_COND(env == nullptr);
|
||||
|
||||
jclass activityClass = env->FindClass("android/app/Activity");
|
||||
jmethodID getClassLoader = env->GetMethodID(activityClass, "getClassLoader", "()Ljava/lang/ClassLoader;");
|
||||
|
||||
Reference in New Issue
Block a user