diff options
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/java/src/com/android/godot/GodotLib.java | 1 | ||||
-rw-r--r-- | platform/android/java_glue.cpp | 20 | ||||
-rw-r--r-- | platform/android/java_glue.h | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/platform/android/java/src/com/android/godot/GodotLib.java b/platform/android/java/src/com/android/godot/GodotLib.java index 8d002c5ebc..f0ec3e97c6 100644 --- a/platform/android/java/src/com/android/godot/GodotLib.java +++ b/platform/android/java/src/com/android/godot/GodotLib.java @@ -59,5 +59,6 @@ public class GodotLib { public static native void method(String p_sname,String p_name,String p_ret,String[] p_params); public static native String getGlobal(String p_key); public static native void callobject(int p_ID, String p_method, Object[] p_params); + public static native void calldeferred(int p_ID, String p_method, Object[] p_params); } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 9c5003cb17..cbe17f2f73 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -1146,6 +1146,26 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, // something }; +JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) { + + String str_method = env->GetStringUTFChars( method, NULL ); + + Object* obj = ObjectDB::get_instance(ID); + ERR_FAIL_COND(!obj); + + int count = env->GetArrayLength(params); + Variant args[VARIANT_ARG_MAX]; + + for (int i=0; i<MIN(count,VARIANT_ARG_MAX); i++) { + + jobject obj = env->GetObjectArrayElement(params, i); + args[i] = _jobject_to_variant(env, obj); + }; + + + obj->call_deferred(str_method, args[0],args[1],args[2],args[3],args[4]); + // something +}; //Main::cleanup(); diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index 7a0666f63d..4b3c14d0db 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -51,6 +51,7 @@ extern "C" { JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args); JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path); JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); + JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); }; |