diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/api/java_class_wrapper.h | 16 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/android/java_godot_lib_jni.cpp | 64 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 6 | ||||
-rw-r--r-- | platform/javascript/http_client_javascript.cpp | 32 | ||||
-rw-r--r-- | platform/javascript/javascript_eval.cpp | 14 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 22 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 16 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 9 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | platform/windows/os_windows.cpp | 4 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 8 |
12 files changed, 92 insertions, 111 deletions
diff --git a/platform/android/api/java_class_wrapper.h b/platform/android/api/java_class_wrapper.h index 6c06d57ac1..2b13be2de4 100644 --- a/platform/android/api/java_class_wrapper.h +++ b/platform/android/api/java_class_wrapper.h @@ -126,34 +126,34 @@ class JavaClass : public Reference { case ARG_ARRAY_BIT | ARG_TYPE_VOID: r_type = Variant::NIL; break; case ARG_ARRAY_BIT | ARG_TYPE_BOOLEAN: r_type = Variant::ARRAY; break; case ARG_ARRAY_BIT | ARG_TYPE_BYTE: - r_type = Variant::POOL_BYTE_ARRAY; + r_type = Variant::PACKED_BYTE_ARRAY; likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_CHAR: - r_type = Variant::POOL_BYTE_ARRAY; + r_type = Variant::PACKED_BYTE_ARRAY; likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_SHORT: - r_type = Variant::POOL_INT_ARRAY; + r_type = Variant::PACKED_INT_ARRAY; likelihood = 0.3; break; case ARG_ARRAY_BIT | ARG_TYPE_INT: - r_type = Variant::POOL_INT_ARRAY; + r_type = Variant::PACKED_INT_ARRAY; likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_LONG: - r_type = Variant::POOL_INT_ARRAY; + r_type = Variant::PACKED_INT_ARRAY; likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_FLOAT: - r_type = Variant::POOL_REAL_ARRAY; + r_type = Variant::PACKED_REAL_ARRAY; likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_DOUBLE: - r_type = Variant::POOL_REAL_ARRAY; + r_type = Variant::PACKED_REAL_ARRAY; likelihood = 0.5; break; - case ARG_ARRAY_BIT | ARG_TYPE_STRING: r_type = Variant::POOL_STRING_ARRAY; break; + case ARG_ARRAY_BIT | ARG_TYPE_STRING: r_type = Variant::PACKED_STRING_ARRAY; break; case ARG_ARRAY_BIT | ARG_TYPE_CLASS: r_type = Variant::ARRAY; break; } } diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 952bc3d28f..2679d9db92 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -701,7 +701,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { aperms++; } - PoolStringArray user_perms = p_preset->get("permissions/custom_permissions"); + PackedStringArray user_perms = p_preset->get("permissions/custom_permissions"); for (int i = 0; i < user_perms.size(); i++) { String user_perm = user_perms[i].strip_edges(); @@ -1310,11 +1310,11 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { working_image->resize(p_icon.dimensions, p_icon.dimensions, Image::Interpolation::INTERPOLATE_LANCZOS); } - PoolVector<uint8_t> png_buffer; + Vector<uint8_t> png_buffer; Error err = PNGDriverCommon::image_to_png(working_image, png_buffer); if (err == OK) { p_data.resize(png_buffer.size()); - memcpy(p_data.ptrw(), png_buffer.read().ptr(), p_data.size()); + memcpy(p_data.ptrw(), png_buffer.ptr(), p_data.size()); } else { String err_str = String("Failed to convert resized icon (") + p_processing_file_name + ") to png."; WARN_PRINT(err_str.utf8().get_data()); @@ -1398,7 +1398,7 @@ public: r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architectures/" + abi), is_default)); } - r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "permissions/custom_permissions"), PoolStringArray())); + r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "permissions/custom_permissions"), PackedStringArray())); const char **perms = android_perms; while (*perms) { diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index dedb2ee114..d3d8304faf 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -123,9 +123,9 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.val.l = jStr; v.obj = jStr; } break; - case Variant::POOL_STRING_ARRAY: { + case Variant::PACKED_STRING_ARRAY: { - PoolVector<String> sarray = *p_arg; + Vector<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++) { @@ -182,30 +182,30 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.obj = jdict; } break; - case Variant::POOL_INT_ARRAY: { + case Variant::PACKED_INT_ARRAY: { - PoolVector<int> array = *p_arg; + Vector<int> array = *p_arg; jintArray arr = env->NewIntArray(array.size()); - PoolVector<int>::Read r = array.read(); + const int *r = array.ptr(); env->SetIntArrayRegion(arr, 0, array.size(), r.ptr()); v.val.l = arr; v.obj = arr; } break; - case Variant::POOL_BYTE_ARRAY: { - PoolVector<uint8_t> array = *p_arg; + case Variant::PACKED_BYTE_ARRAY: { + Vector<uint8_t> array = *p_arg; jbyteArray arr = env->NewByteArray(array.size()); - PoolVector<uint8_t>::Read r = array.read(); + const uint8_t *r = array.ptr(); env->SetByteArrayRegion(arr, 0, array.size(), reinterpret_cast<const signed char *>(r.ptr())); v.val.l = arr; v.obj = arr; } break; - case Variant::POOL_REAL_ARRAY: { + case Variant::PACKED_REAL_ARRAY: { - PoolVector<float> array = *p_arg; + Vector<float> array = *p_arg; jfloatArray arr = env->NewFloatArray(array.size()); - PoolVector<float>::Read r = array.read(); + const float *r = array.ptr(); env->SetFloatArrayRegion(arr, 0, array.size(), r.ptr()); v.val.l = arr; v.obj = arr; @@ -255,7 +255,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jobjectArray arr = (jobjectArray)obj; int stringCount = env->GetArrayLength(arr); - PoolVector<String> sarr; + Vector<String> sarr; for (int i = 0; i < stringCount; i++) { jstring string = (jstring)env->GetObjectArrayElement(arr, i); @@ -285,10 +285,10 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jintArray arr = (jintArray)obj; int fCount = env->GetArrayLength(arr); - PoolVector<int> sarr; + Vector<int> sarr; sarr.resize(fCount); - PoolVector<int>::Write w = sarr.write(); + int *w = sarr.ptrw(); env->GetIntArrayRegion(arr, 0, fCount, w.ptr()); w.release(); return sarr; @@ -298,10 +298,10 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jbyteArray arr = (jbyteArray)obj; int fCount = env->GetArrayLength(arr); - PoolVector<uint8_t> sarr; + Vector<uint8_t> sarr; sarr.resize(fCount); - PoolVector<uint8_t>::Write w = sarr.write(); + uint8_t *w = sarr.ptrw(); env->GetByteArrayRegion(arr, 0, fCount, reinterpret_cast<signed char *>(w.ptr())); w.release(); return sarr; @@ -319,10 +319,10 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jdoubleArray arr = (jdoubleArray)obj; int fCount = env->GetArrayLength(arr); - PoolRealArray sarr; + PackedRealArray sarr; sarr.resize(fCount); - PoolRealArray::Write w = sarr.write(); + real_t *w = sarr.ptrw(); for (int i = 0; i < fCount; i++) { @@ -337,10 +337,10 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jfloatArray arr = (jfloatArray)obj; int fCount = env->GetArrayLength(arr); - PoolRealArray sarr; + PackedRealArray sarr; sarr.resize(fCount); - PoolRealArray::Write w = sarr.write(); + real_t *w = sarr.ptrw(); for (int i = 0; i < fCount; i++) { @@ -374,7 +374,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jmethodID get_keys = env->GetMethodID(oclass, "get_keys", "()[Ljava/lang/String;"); jobjectArray arr = (jobjectArray)env->CallObjectMethod(obj, get_keys); - PoolStringArray keys = _jobject_to_variant(env, arr); + PackedStringArray keys = _jobject_to_variant(env, arr); env->DeleteLocalRef(arr); jmethodID get_values = env->GetMethodID(oclass, "get_values", "()[Ljava/lang/Object;"); @@ -497,7 +497,7 @@ public: ret = jstring_to_string((jstring)o, env); env->DeleteLocalRef(o); } break; - case Variant::POOL_STRING_ARRAY: { + case Variant::PACKED_STRING_ARRAY: { jobjectArray arr = (jobjectArray)env->CallObjectMethodA(instance, E->get().method, v); @@ -505,29 +505,29 @@ public: env->DeleteLocalRef(arr); } break; - case Variant::POOL_INT_ARRAY: { + case Variant::PACKED_INT_ARRAY: { jintArray arr = (jintArray)env->CallObjectMethodA(instance, E->get().method, v); int fCount = env->GetArrayLength(arr); - PoolVector<int> sarr; + Vector<int> sarr; sarr.resize(fCount); - PoolVector<int>::Write w = sarr.write(); + int *w = sarr.ptrw(); env->GetIntArrayRegion(arr, 0, fCount, w.ptr()); w.release(); ret = sarr; env->DeleteLocalRef(arr); } break; - case Variant::POOL_REAL_ARRAY: { + case Variant::PACKED_REAL_ARRAY: { jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance, E->get().method, v); int fCount = env->GetArrayLength(arr); - PoolVector<float> sarr; + Vector<float> sarr; sarr.resize(fCount); - PoolVector<float>::Write w = sarr.write(); + float *w = sarr.ptrw(); env->GetFloatArrayRegion(arr, 0, fCount, w.ptr()); w.release(); ret = sarr; @@ -1249,10 +1249,10 @@ static Variant::Type get_jni_type(const String &p_type) { { "float", Variant::REAL }, { "double", Variant::REAL }, { "java.lang.String", Variant::STRING }, - { "[I", Variant::POOL_INT_ARRAY }, - { "[B", Variant::POOL_BYTE_ARRAY }, - { "[F", Variant::POOL_REAL_ARRAY }, - { "[Ljava.lang.String;", Variant::POOL_STRING_ARRAY }, + { "[I", Variant::PACKED_INT_ARRAY }, + { "[B", Variant::PACKED_BYTE_ARRAY }, + { "[F", Variant::PACKED_REAL_ARRAY }, + { "[Ljava.lang.String;", Variant::PACKED_STRING_ARRAY }, { "org.godotengine.godot.Dictionary", Variant::DICTIONARY }, { NULL, Variant::NIL } }; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 0767ce7638..7cef2351e3 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -447,9 +447,6 @@ void EditorExportPlatformIOS::_blend_and_rotate(Ref<Image> &p_dst, Ref<Image> &p ERR_FAIL_COND(p_dst.is_null()); ERR_FAIL_COND(p_src.is_null()); - p_dst->lock(); - p_src->lock(); - int sw = p_rot ? p_src->get_height() : p_src->get_width(); int sh = p_rot ? p_src->get_width() : p_src->get_height(); @@ -473,9 +470,6 @@ void EditorExportPlatformIOS::_blend_and_rotate(Ref<Image> &p_dst, Ref<Image> &p p_dst->set_pixel(x_pos + x, y_pos + y, dc); } } - - p_dst->unlock(); - p_src->unlock(); } struct IconInfo { diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index 2c2511a3a5..d7796cc4f4 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -103,12 +103,12 @@ Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Ve return OK; } -Error HTTPClient::request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const PoolVector<uint8_t> &p_body) { +Error HTTPClient::request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const Vector<uint8_t> &p_body) { Error err = prepare_request(p_method, p_url, p_headers); if (err != OK) return err; - PoolByteArray::Read read = p_body.read(); + const uint8_t *read = p_body.ptr(); godot_xhr_send_data(xhr_id, read.ptr(), p_body.size()); return OK; } @@ -173,18 +173,18 @@ int HTTPClient::get_response_body_length() const { return polled_response.size(); } -PoolByteArray HTTPClient::read_response_body_chunk() { +PackedByteArray HTTPClient::read_response_body_chunk() { - ERR_FAIL_COND_V(status != STATUS_BODY, PoolByteArray()); + ERR_FAIL_COND_V(status != STATUS_BODY, PackedByteArray()); int to_read = MIN(read_limit, polled_response.size() - response_read_offset); - PoolByteArray chunk; + PackedByteArray chunk; chunk.resize(to_read); - PoolByteArray::Write write = chunk.write(); - PoolByteArray::Read read = polled_response.read(); + uint8_t *write = chunk.ptrw(); + const uint8_t *read = polled_response.ptr(); memcpy(write.ptr(), read.ptr() + response_read_offset, to_read); - write = PoolByteArray::Write(); - read = PoolByteArray::Read(); + write = uint8_t * (); + read = const uint8_t * (); response_read_offset += to_read; if (response_read_offset == polled_response.size()) { @@ -263,23 +263,23 @@ Error HTTPClient::poll() { status = STATUS_BODY; - PoolByteArray bytes; + PackedByteArray bytes; int len = godot_xhr_get_response_headers_length(xhr_id); bytes.resize(len + 1); - PoolByteArray::Write write = bytes.write(); + uint8_t *write = bytes.ptrw(); godot_xhr_get_response_headers(xhr_id, reinterpret_cast<char *>(write.ptr()), len); write[len] = 0; - write = PoolByteArray::Write(); + write = uint8_t * (); - PoolByteArray::Read read = bytes.read(); + const uint8_t *read = bytes.ptr(); polled_response_header = String::utf8(reinterpret_cast<const char *>(read.ptr())); - read = PoolByteArray::Read(); + read = const uint8_t * (); polled_response.resize(godot_xhr_get_response_length(xhr_id)); - write = polled_response.write(); + write = polled_response.ptrw(); godot_xhr_get_response(xhr_id, write.ptr(), polled_response.size()); - write = PoolByteArray::Write(); + write = uint8_t * (); break; } diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp index d907222d24..ab045d359b 100644 --- a/platform/javascript/javascript_eval.cpp +++ b/platform/javascript/javascript_eval.cpp @@ -33,7 +33,7 @@ #include "api/javascript_eval.h" #include "emscripten.h" -extern "C" EMSCRIPTEN_KEEPALIVE uint8_t *resize_poolbytearray_and_open_write(PoolByteArray *p_arr, PoolByteArray::Write *r_write, int p_len) { +extern "C" EMSCRIPTEN_KEEPALIVE uint8_t *resize_PackedByteArray_and_open_write(PackedByteArray *p_arr, uint8_t **r_write, int p_len) { p_arr->resize(p_len); *r_write = p_arr->write(); @@ -48,8 +48,8 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) { char *s; } js_data; - PoolByteArray arr; - PoolByteArray::Write arr_write; + PackedByteArray arr; + uint8_t *arr_write; /* clang-format off */ Variant::Type return_type = static_cast<Variant::Type>(EM_ASM_INT({ @@ -114,9 +114,9 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) { eval_ret = new Uint8Array(eval_ret); } if (eval_ret instanceof Uint8Array) { - var bytes_ptr = ccall('resize_poolbytearray_and_open_write', 'number', ['number', 'number' ,'number'], [BYTEARRAY_PTR, BYTEARRAY_WRITE_PTR, eval_ret.length]); + var bytes_ptr = ccall('resize_PackedByteArray_and_open_write', 'number', ['number', 'number' ,'number'], [BYTEARRAY_PTR, BYTEARRAY_WRITE_PTR, eval_ret.length]); HEAPU8.set(eval_ret, bytes_ptr); - return 20; // POOL_BYTE_ARRAY + return 20; // PACKED_BYTE_ARRAY } break; } @@ -137,8 +137,8 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) { /* clang-format on */ return str; } - case Variant::POOL_BYTE_ARRAY: - arr_write = PoolByteArray::Write(); + case Variant::PACKED_BYTE_ARRAY: + arr_write = uint8_t * (); return arr; default: return Variant(); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 8ba2b39c85..5acdc5f602 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -536,17 +536,17 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s png_meta.height = texture_size.height; png_meta.format = PNG_FORMAT_RGBA; - PoolByteArray png; + PackedByteArray png; size_t len; - PoolByteArray::Read r = image->get_data().read(); + const uint8_t *r = image->get_data().ptr(); ERR_FAIL_COND(!png_image_write_get_memory_size(png_meta, len, 0, r.ptr(), 0, NULL)); png.resize(len); - PoolByteArray::Write w = png.write(); + uint8_t *w = png.ptrw(); ERR_FAIL_COND(!png_image_write_to_memory(&png_meta, w.ptr(), &len, 0, r.ptr(), 0, NULL)); - w = PoolByteArray::Write(); + w = uint8_t * (); - r = png.read(); + r = png.ptr(); char *object_url; /* clang-format off */ @@ -563,7 +563,7 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s stringToUTF8(url, string_on_wasm_heap, length_bytes); }, r.ptr(), len, &object_url); /* clang-format on */ - r = PoolByteArray::Read(); + r = const uint8_t * (); String url = String::utf8(object_url) + "?" + itos(p_hotspot.x) + " " + itos(p_hotspot.y); @@ -1178,17 +1178,17 @@ void OS_JavaScript::set_icon(const Ref<Image> &p_icon) { png_meta.height = icon->get_height(); png_meta.format = PNG_FORMAT_RGBA; - PoolByteArray png; + PackedByteArray png; size_t len; - PoolByteArray::Read r = icon->get_data().read(); + const uint8_t *r = icon->get_data().ptr(); ERR_FAIL_COND(!png_image_write_get_memory_size(png_meta, len, 0, r.ptr(), 0, NULL)); png.resize(len); - PoolByteArray::Write w = png.write(); + uint8_t *w = png.ptrw(); ERR_FAIL_COND(!png_image_write_to_memory(&png_meta, w.ptr(), &len, 0, r.ptr(), 0, NULL)); - w = PoolByteArray::Write(); + w = uint8_t * (); - r = png.read(); + r = png.ptr(); /* clang-format off */ EM_ASM_ARGS({ var PNG_PTR = $0; diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 312987b8cb..dbe52da912 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -139,7 +139,7 @@ void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/timestamp"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/hardened_runtime"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/entitlements", PROPERTY_HINT_GLOBAL_FILE, "*.plist"), "")); - r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "codesign/custom_options"), PoolStringArray())); + r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "codesign/custom_options"), PackedStringArray())); #endif r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true)); @@ -147,7 +147,7 @@ void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false)); } -void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_source, Vector<uint8_t> &p_dest) { +void _rgba8_to_packbits_encode(int p_ch, int p_size, Vector<uint8_t> &p_source, Vector<uint8_t> &p_dest) { int src_len = p_size * p_size; @@ -160,11 +160,11 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour int i = 0; while (i < src_len) { - uint8_t cur = p_source.read()[i * 4 + p_ch]; + uint8_t cur = p_source.ptr()[i * 4 + p_ch]; if (i < src_len - 2) { - if ((p_source.read()[(i + 1) * 4 + p_ch] == cur) && (p_source.read()[(i + 2) * 4 + p_ch] == cur)) { + if ((p_source.ptr()[(i + 1) * 4 + p_ch] == cur) && (p_source.ptr()[(i + 2) * 4 + p_ch] == cur)) { if (buf_size > 0) { result.write[res_size++] = (uint8_t)(buf_size - 1); copymem(&result.write[res_size], &buf, buf_size); @@ -176,7 +176,7 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour bool hit_lim = true; for (int j = 3; j <= lim; j++) { - if (p_source.read()[(i + j) * 4 + p_ch] != cur) { + if (p_source.ptr()[(i + j) * 4 + p_ch] != cur) { hit_lim = false; i = i + j - 1; result.write[res_size++] = (uint8_t)(j - 3 + 0x80); @@ -278,7 +278,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_ DirAccess::remove_file_or_error(path); } else { - PoolVector<uint8_t> src_data = copy->get_data(); + Vector<uint8_t> src_data = copy->get_data(); //encode 24bit RGB RLE icon { @@ -302,7 +302,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_ data.resize(data.size() + len + 8); for (int j = 0; j < len; j++) { - data.write[ofs + 8 + j] = src_data.read()[j * 4 + 3]; + data.write[ofs + 8 + j] = src_data.ptr()[j * 4 + 3]; } len += 8; len = BSWAP32(len); @@ -386,7 +386,7 @@ Error EditorExportPlatformOSX::_code_sign(const Ref<EditorExportPreset> &p_prese args.push_back(p_preset->get("codesign/entitlements")); } - PoolStringArray user_args = p_preset->get("codesign/custom_options"); + PackedStringArray user_args = p_preset->get("codesign/custom_options"); for (int i = 0; i < user_args.size(); i++) { String user_arg = user_args[i].strip_edges(); if (!user_arg.empty()) { diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index ca29c95f57..be25cab40b 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1892,10 +1892,6 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c uint8_t *pixels = [imgrep bitmapData]; int len = int(texture_size.width * texture_size.height); - PoolVector<uint8_t> data = image->get_data(); - PoolVector<uint8_t>::Read r = data.read(); - - image->lock(); for (int i = 0; i < len; i++) { int row_index = floor(i / texture_size.width) + atlas_rect.position.y; @@ -1915,8 +1911,6 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c pixels[i * 4 + 3] = alpha; } - image->unlock(); - NSImage *nsimage = [[NSImage alloc] initWithSize:NSMakeSize(texture_size.width, texture_size.height)]; [nsimage addRepresentation:imgrep]; @@ -2051,8 +2045,7 @@ void OS_OSX::set_icon(const Ref<Image> &p_icon) { uint8_t *pixels = [imgrep bitmapData]; int len = img->get_width() * img->get_height(); - PoolVector<uint8_t> data = img->get_data(); - PoolVector<uint8_t>::Read r = data.read(); + const uint8_t *r = img->get_data().ptr(); /* Premultiply the alpha channel */ for (int i = 0; i < len; i++) { diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 31501c2cd3..78a3fc8f79 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -85,7 +85,7 @@ void EditorExportPlatformWindows::get_export_options(List<ExportOption> *r_optio r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/timestamp_server_url"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/digest_algorithm", PROPERTY_HINT_ENUM, "SHA1,SHA256"), 1)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/description"), "")); - r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "codesign/custom_options"), PoolStringArray())); + r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "codesign/custom_options"), PackedStringArray())); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.ico"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "1.0.0"), "")); @@ -297,7 +297,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p } //user options - PoolStringArray user_args = p_preset->get("codesign/custom_options"); + PackedStringArray user_args = p_preset->get("codesign/custom_options"); for (int i = 0; i < user_args.size(); i++) { String user_arg = user_args[i].strip_edges(); if (!user_arg.empty()) { diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index cdcdf65e21..b9cd277657 100755..100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2567,7 +2567,6 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap // Create the BITMAP with alpha channel COLORREF *buffer = (COLORREF *)memalloc(sizeof(COLORREF) * image_size); - image->lock(); for (UINT index = 0; index < image_size; index++) { int row_index = floor(index / texture_size.width) + atlas_rect.position.y; int column_index = (index % int(texture_size.width)) + atlas_rect.position.x; @@ -2579,7 +2578,6 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap *(buffer + index) = image->get_pixel(column_index, row_index).to_argb32(); } - image->unlock(); // Using 4 channels, so 4 * 8 bits HBITMAP bitmap = CreateBitmap(texture_size.width, texture_size.height, 1, 4 * 8, buffer); @@ -2934,7 +2932,7 @@ void OS_Windows::set_icon(const Ref<Image> &p_icon) { encode_uint32(0, &icon_bmp[36]); uint8_t *wr = &icon_bmp[40]; - PoolVector<uint8_t>::Read r = icon->get_data().read(); + const uint8_t *r = icon->get_data().ptr(); for (int i = 0; i < h; i++) { diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 26170a8335..36e9681f5f 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -3076,8 +3076,6 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c // allocate memory to contain the whole file cursor_image->pixels = (XcursorPixel *)memalloc(size); - image->lock(); - for (XcursorPixel index = 0; index < image_size; index++) { int row_index = floor(index / texture_size.width) + atlas_rect.position.y; int column_index = (index % int(texture_size.width)) + atlas_rect.position.x; @@ -3090,8 +3088,6 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c *(cursor_image->pixels + index) = image->get_pixel(column_index, row_index).to_argb32(); } - image->unlock(); - ERR_FAIL_COND(cursor_image->pixels == NULL); // Save it for a further usage @@ -3269,10 +3265,10 @@ void OS_X11::set_icon(const Ref<Image> &p_icon) { pd.write[0] = w; pd.write[1] = h; - PoolVector<uint8_t>::Read r = img->get_data().read(); + const uint8_t *r = img->get_data().ptr(); long *wr = &pd.write[2]; - uint8_t const *pr = r.ptr(); + uint8_t const *pr = r; for (int i = 0; i < w * h; i++) { long v = 0; |