Godot Android plugin re-architecture

This commit is contained in:
Fredia Huya-Kouadio 2023-07-17 12:11:37 -07:00
parent fa3428ff25
commit 8cc7739197
13 changed files with 169 additions and 207 deletions

View file

@ -79,6 +79,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_
_begin_benchmark_measure = p_env->GetMethodID(godot_class, "nativeBeginBenchmarkMeasure", "(Ljava/lang/String;)V");
_end_benchmark_measure = p_env->GetMethodID(godot_class, "nativeEndBenchmarkMeasure", "(Ljava/lang/String;)V");
_dump_benchmark = p_env->GetMethodID(godot_class, "nativeDumpBenchmark", "(Ljava/lang/String;)V");
_get_gdextension_list_config_file = p_env->GetMethodID(godot_class, "getGDExtensionConfigFiles", "()[Ljava/lang/String;");
}
GodotJavaWrapper::~GodotJavaWrapper() {
@ -264,6 +265,25 @@ Vector<String> GodotJavaWrapper::get_granted_permissions() const {
return permissions_list;
}
Vector<String> GodotJavaWrapper::get_gdextension_list_config_file() const {
Vector<String> config_file_list;
if (_get_gdextension_list_config_file) {
JNIEnv *env = get_jni_env();
ERR_FAIL_NULL_V(env, config_file_list);
jobject config_file_list_object = env->CallObjectMethod(godot_instance, _get_gdextension_list_config_file);
jobjectArray *arr = reinterpret_cast<jobjectArray *>(&config_file_list_object);
jsize len = env->GetArrayLength(*arr);
for (int i = 0; i < len; i++) {
jstring j_config_file = (jstring)env->GetObjectArrayElement(*arr, i);
String config_file = jstring_to_string(j_config_file, env);
config_file_list.push_back(config_file);
env->DeleteLocalRef(j_config_file);
}
}
return config_file_list;
}
String GodotJavaWrapper::get_ca_certificates() const {
if (_get_ca_certificates) {
JNIEnv *env = get_jni_env();