Leverage java annotations to simplify the logic used to register the Godot plugin methods.

This commit is contained in:
Fredia Huya-Kouadio 2021-03-16 00:36:31 -07:00
parent 3ddab1c9d1
commit 94df08aae1
9 changed files with 245 additions and 65 deletions

View file

@ -201,7 +201,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jc
}
if (err != OK) {
return; //should exit instead and print the error
return; // should exit instead and print the error
}
java_class_wrapper = memnew(JavaClassWrapper(godot_java->get_activity()));
@ -252,9 +252,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jcl
if (step == 1) {
if (!Main::start()) {
return; //should exit instead and print the error
return; // should exit instead and print the error
}
godot_java->on_godot_setup_completed(env);
os_android->main_loop_begin();
godot_java->on_godot_main_loop_started(env);
++step;