diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:25:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:26:38 -0300 |
commit | 2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch) | |
tree | 7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /platform/android | |
parent | 2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff) |
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/godot_android.cpp | 24 | ||||
-rw-r--r-- | platform/android/java_glue.cpp | 40 |
2 files changed, 32 insertions, 32 deletions
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 715021db33..c4d1a85c5f 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -153,7 +153,7 @@ public: } break; case Variant::STRING_ARRAY: { - DVector<String> sarray = *p_args[i]; + PoolVector<String> sarray = *p_args[i]; jobjectArray arr = env->NewObjectArray(sarray.size(),env->FindClass("java/lang/String"),env->NewStringUTF("")); for(int j=0;j<sarray.size();j++) { @@ -165,18 +165,18 @@ public: } break; case Variant::INT_ARRAY: { - DVector<int> array = *p_args[i]; + PoolVector<int> array = *p_args[i]; jintArray arr = env->NewIntArray(array.size()); - DVector<int>::Read r = array.read(); + PoolVector<int>::Read r = array.read(); env->SetIntArrayRegion(arr,0,array.size(),r.ptr()); v[i].l=arr; } break; case Variant::REAL_ARRAY: { - DVector<float> array = *p_args[i]; + PoolVector<float> array = *p_args[i]; jfloatArray arr = env->NewFloatArray(array.size()); - DVector<float>::Read r = array.read(); + PoolVector<float>::Read r = array.read(); env->SetFloatArrayRegion(arr,0,array.size(),r.ptr()); v[i].l=arr; @@ -225,7 +225,7 @@ public: jobjectArray arr = (jobjectArray)env->CallObjectMethodA(instance,E->get().method,v); int stringCount = env->GetArrayLength(arr); - DVector<String> sarr; + PoolVector<String> sarr; for (int i=0; i<stringCount; i++) { jstring string = (jstring) env->GetObjectArrayElement(arr, i); @@ -241,12 +241,12 @@ public: jintArray arr = (jintArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); ret=sarr; } break; case Variant::REAL_ARRAY: { @@ -254,12 +254,12 @@ public: jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<float> sarr; + PoolVector<float> sarr; sarr.resize(fCount); - DVector<float>::Write w = sarr.write(); + PoolVector<float>::Write w = sarr.write(); env->GetFloatArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<float>::Write(); + w = PoolVector<float>::Write(); ret=sarr; } break; default: { diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 602d22dfa2..6d47946263 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -122,7 +122,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a } break; case Variant::STRING_ARRAY: { - DVector<String> sarray = *p_arg; + PoolVector<String> sarray = *p_arg; jobjectArray arr = env->NewObjectArray(sarray.size(),env->FindClass("java/lang/String"),env->NewStringUTF("")); for(int j=0;j<sarray.size();j++) { @@ -181,18 +181,18 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a case Variant::INT_ARRAY: { - DVector<int> array = *p_arg; + PoolVector<int> array = *p_arg; jintArray arr = env->NewIntArray(array.size()); - DVector<int>::Read r = array.read(); + PoolVector<int>::Read r = array.read(); env->SetIntArrayRegion(arr,0,array.size(),r.ptr()); v.val.l=arr; v.obj=arr; } break; case Variant::RAW_ARRAY: { - DVector<uint8_t> array = *p_arg; + PoolVector<uint8_t> array = *p_arg; jbyteArray arr = env->NewByteArray(array.size()); - DVector<uint8_t>::Read r = array.read(); + PoolVector<uint8_t>::Read r = array.read(); env->SetByteArrayRegion(arr,0,array.size(),reinterpret_cast<const signed char*>(r.ptr())); v.val.l=arr; v.obj=arr; @@ -200,9 +200,9 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a } break; case Variant::REAL_ARRAY: { - DVector<float> array = *p_arg; + PoolVector<float> array = *p_arg; jfloatArray arr = env->NewFloatArray(array.size()); - DVector<float>::Read r = array.read(); + PoolVector<float>::Read r = array.read(); env->SetFloatArrayRegion(arr,0,array.size(),r.ptr()); v.val.l=arr; v.obj=arr; @@ -259,7 +259,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jobjectArray arr = (jobjectArray)obj; int stringCount = env->GetArrayLength(arr); //print_line("String array! " + String::num(stringCount)); - DVector<String> sarr; + PoolVector<String> sarr; for (int i=0; i<stringCount; i++) { jstring string = (jstring) env->GetObjectArrayElement(arr, i); @@ -290,12 +290,12 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jintArray arr = (jintArray)obj; int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); return sarr; }; @@ -303,12 +303,12 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jbyteArray arr = (jbyteArray)obj; int fCount = env->GetArrayLength(arr); - DVector<uint8_t> sarr; + PoolVector<uint8_t> sarr; sarr.resize(fCount); - DVector<uint8_t>::Write w = sarr.write(); + PoolVector<uint8_t>::Write w = sarr.write(); env->GetByteArrayRegion(arr,0,fCount,reinterpret_cast<signed char*>(w.ptr())); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); return sarr; }; @@ -540,12 +540,12 @@ public: jintArray arr = (jintArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); ret=sarr; env->DeleteLocalRef(arr); } break; @@ -554,12 +554,12 @@ public: jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<float> sarr; + PoolVector<float> sarr; sarr.resize(fCount); - DVector<float>::Write w = sarr.write(); + PoolVector<float>::Write w = sarr.write(); env->GetFloatArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<float>::Write(); + w = PoolVector<float>::Write(); ret=sarr; env->DeleteLocalRef(arr); } break; |