summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/java_glue.cpp28
-rw-r--r--platform/android/os_android.cpp3
-rw-r--r--platform/android/os_android.h1
3 files changed, 27 insertions, 5 deletions
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 6ce62bfae2..3158254781 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -437,6 +437,7 @@ public:
}
+
int ac = E->get().argtypes.size();
if (ac<p_argcount) {
@@ -455,7 +456,6 @@ public:
}
-
for(int i=0;i<p_argcount;i++) {
if (!Variant::can_convert(p_args[i]->get_type(),E->get().argtypes[i])) {
@@ -476,6 +476,10 @@ public:
JNIEnv *env = ThreadAndroid::get_env();
+ int res = env->PushLocalFrame(16);
+
+ ERR_FAIL_COND_V(res!=0,Variant());
+
//print_line("argcount "+String::num(p_argcount));
List<jobject> to_erase;
for(int i=0;i<p_argcount;i++) {
@@ -568,6 +572,7 @@ public:
print_line("failure..");
+ env->PopLocalFrame(NULL);
ERR_FAIL_V(Variant());
} break;
}
@@ -576,6 +581,8 @@ public:
env->DeleteLocalRef(to_erase.front()->get());
to_erase.pop_front();
}
+
+ env->PopLocalFrame(NULL);
//print_line("success");
return ret;
@@ -1613,11 +1620,15 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobj
JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(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 res = env->PushLocalFrame(16);
+ ERR_FAIL_COND(res!=0);
+
+ String str_method = env->GetStringUTFChars( method, NULL );
+
+
int count = env->GetArrayLength(params);
Variant* vlist = (Variant*)alloca(sizeof(Variant) * count);
Variant** vptr = (Variant**)alloca(sizeof(Variant*) * count);
@@ -1637,15 +1648,22 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env,
Variant::CallError err;
obj->call(str_method, (const Variant**)vptr, count, err);
// something
+
+ env->PopLocalFrame(NULL);
+
};
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 res = env->PushLocalFrame(16);
+ ERR_FAIL_COND(res!=0);
+
+ String str_method = env->GetStringUTFChars( method, NULL );
+
int count = env->GetArrayLength(params);
Variant args[VARIANT_ARG_MAX];
@@ -1666,6 +1684,8 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env
obj->call_deferred(str_method, args[0],args[1],args[2],args[3],args[4]);
// something
+ env->PopLocalFrame(NULL);
+
};
//Main::cleanup();
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 80953df85f..612148418b 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -163,7 +163,8 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_
//
physics_server = memnew( PhysicsServerSW );
physics_server->init();
- physics_2d_server = memnew( Physics2DServerSW );
+ //physics_2d_server = memnew( Physics2DServerSW );
+ physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>();
physics_2d_server->init();
input = memnew( InputDefault );
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index 41892d23b4..7a5a55653f 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -37,6 +37,7 @@
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
#include "servers/audio/audio_server_sw.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
+#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "servers/visual/rasterizer.h"