summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2020-02-17 18:06:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-18 10:10:36 +0100
commit3205a92ad872f918c8322cdcd1434c231a1fd251 (patch)
treedb44242ca27432eb8ea849679752d0835d2ae41a /editor
parentfb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff)
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
Diffstat (limited to 'editor')
-rw-r--r--editor/connections_dialog.cpp6
-rw-r--r--editor/doc/doc_dump.cpp12
-rw-r--r--editor/editor_autoload_settings.cpp4
-rw-r--r--editor/editor_export.cpp10
-rw-r--r--editor/editor_export.h6
-rw-r--r--editor/editor_file_dialog.cpp4
-rw-r--r--editor/editor_file_system.cpp4
-rw-r--r--editor/editor_folding.cpp22
-rw-r--r--editor/editor_folding.h4
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_node.cpp6
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_plugin.cpp8
-rw-r--r--editor/editor_profiler.cpp4
-rw-r--r--editor/editor_profiler.h2
-rw-r--r--editor/editor_properties.cpp28
-rw-r--r--editor/editor_properties_array_dict.cpp54
-rw-r--r--editor/editor_visual_profiler.cpp4
-rw-r--r--editor/editor_visual_profiler.h2
-rw-r--r--editor/export_template_manager.cpp8
-rw-r--r--editor/export_template_manager.h4
-rw-r--r--editor/filesystem_dock.cpp2
-rw-r--r--editor/find_in_files.cpp18
-rw-r--r--editor/find_in_files.h4
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp86
-rw-r--r--editor/import/editor_scene_importer_gltf.h10
-rw-r--r--editor/import/resource_importer_bitmask.cpp1
-rw-r--r--editor/import/resource_importer_layered_texture.cpp12
-rw-r--r--editor/import/resource_importer_texture.cpp32
-rw-r--r--editor/import/resource_importer_texture_atlas.cpp18
-rw-r--r--editor/import/resource_importer_wav.cpp14
-rw-r--r--editor/import/resource_importer_wav.h6
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp12
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp37
-rw-r--r--editor/plugins/asset_library_editor_plugin.h10
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp4
-rw-r--r--editor/plugins/cpu_particles_2d_editor_plugin.cpp16
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.cpp4
-rw-r--r--editor/plugins/curve_editor_plugin.cpp4
-rw-r--r--editor/plugins/editor_preview_plugins.cpp31
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.cpp10
-rw-r--r--editor/plugins/multimesh_editor_plugin.cpp10
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp20
-rw-r--r--editor/plugins/particles_editor_plugin.cpp32
-rw-r--r--editor/plugins/particles_editor_plugin.h4
-rw-r--r--editor/plugins/path_editor_plugin.cpp10
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp54
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.h10
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.h6
-rw-r--r--editor/plugins/script_text_editor.cpp26
-rw-r--r--editor/plugins/script_text_editor.h2
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp4
-rw-r--r--editor/plugins/sprite_editor_plugin.cpp16
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp4
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.h2
-rw-r--r--editor/plugins/text_editor.cpp2
-rw-r--r--editor/plugins/text_editor.h2
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp28
-rw-r--r--editor/plugins/tile_map_editor_plugin.h8
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp38
-rw-r--r--editor/plugins/tile_set_editor_plugin.h6
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp4
-rw-r--r--editor/project_manager.cpp8
-rw-r--r--editor/project_manager.h4
-rw-r--r--editor/project_settings_editor.cpp16
-rw-r--r--editor/property_editor.cpp24
-rw-r--r--editor/property_selector.cpp14
-rw-r--r--editor/scene_tree_editor.cpp2
-rw-r--r--editor/script_editor_debugger.cpp8
-rw-r--r--editor/spatial_editor_gizmos.cpp24
72 files changed, 443 insertions, 478 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index deabb06e1a..c2c9a88bf0 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -555,12 +555,12 @@ void ConnectionsDock::_make_or_edit_connection() {
add_script_function = !found_inherited_function;
}
- PoolStringArray script_function_args;
+ PackedStringArray script_function_args;
if (add_script_function) {
// Pick up args here before "it" is deleted by update_tree.
script_function_args = it->get_metadata(0).operator Dictionary()["args"];
for (int i = 0; i < cToMake.binds.size(); i++) {
- script_function_args.append("extra_arg_" + itos(i) + ":" + Variant::get_type_name(cToMake.binds[i].get_type()));
+ script_function_args.push_back("extra_arg_" + itos(i) + ":" + Variant::get_type_name(cToMake.binds[i].get_type()));
}
}
@@ -943,7 +943,7 @@ void ConnectionsDock::update_tree() {
StringName signal_name = mi.name;
String signaldesc = "(";
- PoolStringArray argnames;
+ PackedStringArray argnames;
if (mi.arguments.size()) {
for (int i = 0; i < mi.arguments.size(); i++) {
diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp
index 5f7fa53ee7..4763091b8e 100644
--- a/editor/doc/doc_dump.cpp
+++ b/editor/doc/doc_dump.cpp
@@ -184,12 +184,12 @@ void DocDump::dump(const String &p_file) {
case Variant::AABB:
case Variant::BASIS:
case Variant::COLOR:
- case Variant::POOL_BYTE_ARRAY:
- case Variant::POOL_INT_ARRAY:
- case Variant::POOL_REAL_ARRAY:
- case Variant::POOL_STRING_ARRAY:
- case Variant::POOL_VECTOR3_ARRAY:
- case Variant::POOL_COLOR_ARRAY:
+ case Variant::PACKED_BYTE_ARRAY:
+ case Variant::PACKED_INT_ARRAY:
+ case Variant::PACKED_REAL_ARRAY:
+ case Variant::PACKED_STRING_ARRAY:
+ case Variant::PACKED_VECTOR3_ARRAY:
+ case Variant::PACKED_COLOR_ARRAY:
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
case Variant::OBJECT:
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 549b15d6f9..77a23fb336 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -521,7 +521,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2 &p_point, Control
if (autoload_cache.size() <= 1)
return false;
- PoolStringArray autoloads;
+ PackedStringArray autoloads;
TreeItem *next = tree->get_next_selected(NULL);
@@ -612,7 +612,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
}
Dictionary drop_data = p_data;
- PoolStringArray autoloads = drop_data["autoloads"];
+ PackedStringArray autoloads = drop_data["autoloads"];
Vector<int> orders;
orders.resize(autoload_cache.size());
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index f638df28a8..47ed6a15bb 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -582,14 +582,14 @@ String EditorExportPlugin::get_ios_cpp_code() const {
return ios_cpp_code;
}
-void EditorExportPlugin::_export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features) {
+void EditorExportPlugin::_export_file_script(const String &p_path, const String &p_type, const Vector<String> &p_features) {
if (get_script_instance()) {
get_script_instance()->call("_export_file", p_path, p_type, p_features);
}
}
-void EditorExportPlugin::_export_begin_script(const PoolVector<String> &p_features, bool p_debug, const String &p_path, int p_flags) {
+void EditorExportPlugin::_export_begin_script(const Vector<String> &p_features, bool p_debug, const String &p_path, int p_flags) {
if (get_script_instance()) {
get_script_instance()->call("_export_begin", p_features, p_debug, p_path, p_flags);
@@ -625,8 +625,8 @@ void EditorExportPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_ios_cpp_code", "code"), &EditorExportPlugin::add_ios_cpp_code);
ClassDB::bind_method(D_METHOD("skip"), &EditorExportPlugin::skip);
- BIND_VMETHOD(MethodInfo("_export_file", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "type"), PropertyInfo(Variant::POOL_STRING_ARRAY, "features")));
- BIND_VMETHOD(MethodInfo("_export_begin", PropertyInfo(Variant::POOL_STRING_ARRAY, "features"), PropertyInfo(Variant::BOOL, "is_debug"), PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::INT, "flags")));
+ BIND_VMETHOD(MethodInfo("_export_file", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "type"), PropertyInfo(Variant::PACKED_STRING_ARRAY, "features")));
+ BIND_VMETHOD(MethodInfo("_export_begin", PropertyInfo(Variant::PACKED_STRING_ARRAY, "features"), PropertyInfo(Variant::BOOL, "is_debug"), PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::INT, "flags")));
BIND_VMETHOD(MethodInfo("_export_end"));
}
@@ -731,7 +731,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
FeatureContainers feature_containers = get_feature_containers(p_preset);
Set<String> &features = feature_containers.features;
- PoolVector<String> &features_pv = feature_containers.features_pv;
+ Vector<String> &features_pv = feature_containers.features_pv;
//store everything in the export medium
int idx = 0;
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 19651b2c62..139d672cb8 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -188,7 +188,7 @@ private:
struct FeatureContainers {
Set<String> features;
- PoolVector<String> features_pv;
+ Vector<String> features_pv;
};
void _export_find_resources(EditorFileSystemDirectory *p_dir, Set<String> &p_paths);
@@ -310,8 +310,8 @@ class EditorExportPlugin : public Reference {
ios_cpp_code = "";
}
- void _export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features);
- void _export_begin_script(const PoolVector<String> &p_features, bool p_debug, const String &p_path, int p_flags);
+ void _export_file_script(const String &p_path, const String &p_type, const Vector<String> &p_features);
+ void _export_begin_script(const Vector<String> &p_features, bool p_debug, const String &p_path, int p_flags);
void _export_end_script();
protected:
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index c869768c6c..8858db48df 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -347,7 +347,7 @@ void EditorFileDialog::_action_pressed() {
String fbase = dir_access->get_current_dir();
- PoolVector<String> files;
+ Vector<String> files;
for (int i = 0; i < item_list->get_item_count(); i++) {
if (item_list->is_selected(i))
files.push_back(fbase.plus_file(item_list->get_item_text(i)));
@@ -1419,7 +1419,7 @@ void EditorFileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("invalidate"), &EditorFileDialog::invalidate);
ADD_SIGNAL(MethodInfo("file_selected", PropertyInfo(Variant::STRING, "path")));
- ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::POOL_STRING_ARRAY, "paths")));
+ ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::PACKED_STRING_ARRAY, "paths")));
ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir")));
ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access");
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 107ecac3b0..b5ec08ef60 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -2100,8 +2100,8 @@ void EditorFileSystem::_bind_methods() {
ADD_SIGNAL(MethodInfo("filesystem_changed"));
ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist")));
- ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::POOL_STRING_ARRAY, "resources")));
- ADD_SIGNAL(MethodInfo("resources_reload", PropertyInfo(Variant::POOL_STRING_ARRAY, "resources")));
+ ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::PACKED_STRING_ARRAY, "resources")));
+ ADD_SIGNAL(MethodInfo("resources_reload", PropertyInfo(Variant::PACKED_STRING_ARRAY, "resources")));
}
void EditorFileSystem::_update_extensions() {
diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp
index 475f16f12f..8308cd760b 100644
--- a/editor/editor_folding.cpp
+++ b/editor/editor_folding.cpp
@@ -34,12 +34,12 @@
#include "editor_inspector.h"
#include "editor_settings.h"
-PoolVector<String> EditorFolding::_get_unfolds(const Object *p_object) {
+Vector<String> EditorFolding::_get_unfolds(const Object *p_object) {
- PoolVector<String> sections;
+ Vector<String> sections;
sections.resize(p_object->editor_get_section_folding().size());
if (sections.size()) {
- PoolVector<String>::Write w = sections.write();
+ String *w = sections.ptrw();
int idx = 0;
for (const Set<String>::Element *E = p_object->editor_get_section_folding().front(); E; E = E->next()) {
w[idx++] = E->get();
@@ -52,7 +52,7 @@ PoolVector<String> EditorFolding::_get_unfolds(const Object *p_object) {
void EditorFolding::save_resource_folding(const RES &p_resource, const String &p_path) {
Ref<ConfigFile> config;
config.instance();
- PoolVector<String> unfolds = _get_unfolds(p_resource.ptr());
+ Vector<String> unfolds = _get_unfolds(p_resource.ptr());
config->set_value("folding", "sections_unfolded", unfolds);
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
@@ -60,10 +60,10 @@ void EditorFolding::save_resource_folding(const RES &p_resource, const String &p
config->save(file);
}
-void EditorFolding::_set_unfolds(Object *p_object, const PoolVector<String> &p_unfolds) {
+void EditorFolding::_set_unfolds(Object *p_object, const Vector<String> &p_unfolds) {
int uc = p_unfolds.size();
- PoolVector<String>::Read r = p_unfolds.read();
+ const String *r = p_unfolds.ptr();
p_object->editor_clear_section_folding();
for (int i = 0; i < uc; i++) {
p_object->editor_set_section_unfold(r[i], true);
@@ -82,7 +82,7 @@ void EditorFolding::load_resource_folding(RES p_resource, const String &p_path)
return;
}
- PoolVector<String> unfolds;
+ Vector<String> unfolds;
if (config->has_section_key("folding", "sections_unfolded")) {
unfolds = config->get_value("folding", "sections_unfolded");
@@ -103,7 +103,7 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p
if (p_node->is_displayed_folded()) {
nodes_folded.push_back(p_root->get_path_to(p_node));
}
- PoolVector<String> unfolds = _get_unfolds(p_node);
+ Vector<String> unfolds = _get_unfolds(p_node);
if (unfolds.size()) {
p_folds.push_back(p_root->get_path_to(p_node));
@@ -118,7 +118,7 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p
RES res = p_node->get(E->get().name);
if (res.is_valid() && !resources.has(res) && res->get_path() != String() && !res->get_path().is_resource_file()) {
- PoolVector<String> res_unfolds = _get_unfolds(res.ptr());
+ Vector<String> res_unfolds = _get_unfolds(res.ptr());
resource_folds.push_back(res->get_path());
resource_folds.push_back(res_unfolds);
resources.insert(res);
@@ -184,7 +184,7 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
for (int i = 0; i < unfolds.size(); i += 2) {
NodePath path2 = unfolds[i];
- PoolVector<String> un = unfolds[i + 1];
+ Vector<String> un = unfolds[i + 1];
Node *node = p_scene->get_node_or_null(path2);
if (!node) {
continue;
@@ -202,7 +202,7 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
continue;
}
- PoolVector<String> unfolds2 = res_unfolds[i + 1];
+ Vector<String> unfolds2 = res_unfolds[i + 1];
_set_unfolds(res.ptr(), unfolds2);
}
diff --git a/editor/editor_folding.h b/editor/editor_folding.h
index cc49b062d0..5220907fe7 100644
--- a/editor/editor_folding.h
+++ b/editor/editor_folding.h
@@ -35,8 +35,8 @@
class EditorFolding {
- PoolVector<String> _get_unfolds(const Object *p_object);
- void _set_unfolds(Object *p_object, const PoolVector<String> &p_unfolds);
+ Vector<String> _get_unfolds(const Object *p_object);
+ void _set_unfolds(Object *p_object, const Vector<String> &p_unfolds);
void _fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, Set<RES> &resources);
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 6d2b891dc6..b16ec26fd1 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -829,7 +829,7 @@ void EditorProperty::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_red"), "set_draw_red", "is_draw_red");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keying"), "set_keying", "is_keying");
ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT)));
- ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::POOL_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value")));
+ ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::PACKED_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value")));
ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property")));
ADD_SIGNAL(MethodInfo("property_keyed_with_value", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT)));
ADD_SIGNAL(MethodInfo("property_checked", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::STRING, "bool")));
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 24656410e8..6a6485575f 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -547,7 +547,7 @@ void EditorNode::_on_plugin_ready(Object *p_script, const String &p_activate_nam
push_item(script.operator->());
}
-void EditorNode::_resources_changed(const PoolVector<String> &p_resources) {
+void EditorNode::_resources_changed(const Vector<String> &p_resources) {
List<Ref<Resource> > changed;
@@ -3052,7 +3052,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
String addon_path = String("res://addons").plus_file(p_addon).plus_file("plugin.cfg");
if (!DirAccess::exists(addon_path.get_base_dir())) {
ProjectSettings *ps = ProjectSettings::get_singleton();
- PoolStringArray enabled_plugins = ps->get("editor_plugins/enabled");
+ PackedStringArray enabled_plugins = ps->get("editor_plugins/enabled");
for (int i = 0; i < enabled_plugins.size(); ++i) {
if (enabled_plugins.get(i) == p_addon) {
enabled_plugins.remove(i);
@@ -5519,7 +5519,7 @@ void EditorNode::_bind_methods() {
ADD_SIGNAL(MethodInfo("pause_pressed"));
ADD_SIGNAL(MethodInfo("stop_pressed"));
ADD_SIGNAL(MethodInfo("request_help_search"));
- ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::POOL_STRING_ARRAY, "args")));
+ ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::PACKED_STRING_ARRAY, "args")));
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "obj")));
}
diff --git a/editor/editor_node.h b/editor/editor_node.h
index bd2c3d73ae..ef9be0677d 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -639,7 +639,7 @@ private:
static void _resource_saved(RES p_resource, const String &p_path);
static void _resource_loaded(RES p_resource, const String &p_path);
- void _resources_changed(const PoolVector<String> &p_resources);
+ void _resources_changed(const Vector<String> &p_resources);
void _feature_profile_changed();
bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index ce847d02eb..2135e70de3 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -688,7 +688,7 @@ void EditorPlugin::apply_changes() {
void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) {
if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) {
- PoolStringArray arr = get_script_instance()->call("get_breakpoints");
+ PackedStringArray arr = get_script_instance()->call("get_breakpoints");
for (int i = 0; i < arr.size(); i++)
p_breakpoints->push_back(arr[i]);
}
@@ -743,8 +743,8 @@ void EditorPlugin::remove_scene_import_plugin(const Ref<EditorSceneImporter> &p_
ResourceImporterScene::get_singleton()->remove_importer(p_importer);
}
-int find(const PoolStringArray &a, const String &v) {
- PoolStringArray::Read r = a.read();
+int find(const PackedStringArray &a, const String &v) {
+ const String *r = a.ptr();
for (int j = 0; j < a.size(); ++j) {
if (r[j] == v) {
return j;
@@ -872,7 +872,7 @@ void EditorPlugin::_bind_methods() {
ClassDB::add_virtual_method(get_class_static(), MethodInfo("clear"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("save_external_data"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("apply_changes"));
- ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::POOL_STRING_ARRAY, "get_breakpoints"));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::PACKED_STRING_ARRAY, "get_breakpoints"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "build"));
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp
index 3ac4fcc21b..96a4551763 100644
--- a/editor/editor_profiler.cpp
+++ b/editor/editor_profiler.cpp
@@ -175,7 +175,7 @@ void EditorProfiler::_update_plot() {
graph_image.resize(desired_len);
}
- PoolVector<uint8_t>::Write wr = graph_image.write();
+ uint8_t *wr = graph_image.ptrw();
const Color background_color = get_color("dark_color_2", "Editor");
// Clear the previous frame and set the background color.
@@ -342,8 +342,6 @@ void EditorProfiler::_update_plot() {
}
}
- wr.release();
-
Ref<Image> img;
img.instance();
img->create(w, h, 0, Image::FORMAT_RGBA8, graph_image);
diff --git a/editor/editor_profiler.h b/editor/editor_profiler.h
index f8accdf6d2..0a442ddd5c 100644
--- a/editor/editor_profiler.h
+++ b/editor/editor_profiler.h
@@ -103,7 +103,7 @@ private:
Button *clear_button;
TextureRect *graph;
Ref<ImageTexture> graph_texture;
- PoolVector<uint8_t> graph_image;
+ Vector<uint8_t> graph_image;
Tree *variables;
HSplitContainer *h_split;
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 905e928c5a..a93bc6169e 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3353,39 +3353,39 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
editor->setup(Variant::ARRAY, p_hint_text);
add_property_editor(p_path, editor);
} break;
- case Variant::POOL_BYTE_ARRAY: {
+ case Variant::PACKED_BYTE_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_BYTE_ARRAY);
+ editor->setup(Variant::PACKED_BYTE_ARRAY);
add_property_editor(p_path, editor);
} break; // 20
- case Variant::POOL_INT_ARRAY: {
+ case Variant::PACKED_INT_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_INT_ARRAY);
+ editor->setup(Variant::PACKED_INT_ARRAY);
add_property_editor(p_path, editor);
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_REAL_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_REAL_ARRAY);
+ editor->setup(Variant::PACKED_REAL_ARRAY);
add_property_editor(p_path, editor);
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_STRING_ARRAY);
+ editor->setup(Variant::PACKED_STRING_ARRAY);
add_property_editor(p_path, editor);
} break;
- case Variant::POOL_VECTOR2_ARRAY: {
+ case Variant::PACKED_VECTOR2_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_VECTOR2_ARRAY);
+ editor->setup(Variant::PACKED_VECTOR2_ARRAY);
add_property_editor(p_path, editor);
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
+ case Variant::PACKED_VECTOR3_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_VECTOR3_ARRAY);
+ editor->setup(Variant::PACKED_VECTOR3_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
- case Variant::POOL_COLOR_ARRAY: {
+ case Variant::PACKED_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_COLOR_ARRAY);
+ editor->setup(Variant::PACKED_COLOR_ARRAY);
add_property_editor(p_path, editor);
} break;
default: {
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 0dc67b298f..86b2642faa 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -229,32 +229,32 @@ void EditorPropertyArray::update_property() {
} break;
// arrays
- case Variant::POOL_BYTE_ARRAY: {
- arrtype = "PoolByteArray";
+ case Variant::PACKED_BYTE_ARRAY: {
+ arrtype = "PackedByteArray";
} break;
- case Variant::POOL_INT_ARRAY: {
- arrtype = "PoolIntArray";
+ case Variant::PACKED_INT_ARRAY: {
+ arrtype = "PackedIntArray";
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_REAL_ARRAY: {
arrtype = "PoolFloatArray";
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
- arrtype = "PoolStringArray";
+ arrtype = "PackedStringArray";
} break;
- case Variant::POOL_VECTOR2_ARRAY: {
+ case Variant::PACKED_VECTOR2_ARRAY: {
- arrtype = "PoolVector2Array";
+ arrtype = "PackedVector2Array";
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
- arrtype = "PoolVector3Array";
+ case Variant::PACKED_VECTOR3_ARRAY: {
+ arrtype = "PackedVector3Array";
} break;
- case Variant::POOL_COLOR_ARRAY: {
- arrtype = "PoolColorArray";
+ case Variant::PACKED_COLOR_ARRAY: {
+ arrtype = "PackedColorArray";
} break;
default: {
}
@@ -846,46 +846,46 @@ void EditorPropertyDictionary::update_property() {
} break;
// arrays
- case Variant::POOL_BYTE_ARRAY: {
+ case Variant::PACKED_BYTE_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_BYTE_ARRAY);
+ editor->setup(Variant::PACKED_BYTE_ARRAY);
prop = editor;
} break;
- case Variant::POOL_INT_ARRAY: {
+ case Variant::PACKED_INT_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_INT_ARRAY);
+ editor->setup(Variant::PACKED_INT_ARRAY);
prop = editor;
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_REAL_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_REAL_ARRAY);
+ editor->setup(Variant::PACKED_REAL_ARRAY);
prop = editor;
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_STRING_ARRAY);
+ editor->setup(Variant::PACKED_STRING_ARRAY);
prop = editor;
} break;
- case Variant::POOL_VECTOR2_ARRAY: {
+ case Variant::PACKED_VECTOR2_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_VECTOR2_ARRAY);
+ editor->setup(Variant::PACKED_VECTOR2_ARRAY);
prop = editor;
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
+ case Variant::PACKED_VECTOR3_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_VECTOR3_ARRAY);
+ editor->setup(Variant::PACKED_VECTOR3_ARRAY);
prop = editor;
} break;
- case Variant::POOL_COLOR_ARRAY: {
+ case Variant::PACKED_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
- editor->setup(Variant::POOL_COLOR_ARRAY);
+ editor->setup(Variant::PACKED_COLOR_ARRAY);
prop = editor;
} break;
default: {
diff --git a/editor/editor_visual_profiler.cpp b/editor/editor_visual_profiler.cpp
index 1b68a89181..579ac2e9ab 100644
--- a/editor/editor_visual_profiler.cpp
+++ b/editor/editor_visual_profiler.cpp
@@ -161,7 +161,7 @@ void EditorVisualProfiler::_update_plot() {
graph_image.resize(desired_len);
}
- PoolVector<uint8_t>::Write wr = graph_image.write();
+ uint8_t *wr = graph_image.ptrw();
//clear
for (int i = 0; i < desired_len; i += 4) {
@@ -305,8 +305,6 @@ void EditorVisualProfiler::_update_plot() {
}
}
- wr.release();
-
Ref<Image> img;
img.instance();
img->create(w, h, 0, Image::FORMAT_RGBA8, graph_image);
diff --git a/editor/editor_visual_profiler.h b/editor/editor_visual_profiler.h
index b4c03b227e..5194c08b96 100644
--- a/editor/editor_visual_profiler.h
+++ b/editor/editor_visual_profiler.h
@@ -78,7 +78,7 @@ private:
TextureRect *graph;
Ref<ImageTexture> graph_texture;
- PoolVector<uint8_t> graph_image;
+ Vector<uint8_t> graph_image;
Tree *variables;
HSplitContainer *h_split;
CheckBox *frame_relative;
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index 7ed6688154..9f957cadc8 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -350,7 +350,7 @@ void ExportTemplateManager::ok_pressed() {
template_open->popup_centered_ratio();
}
-void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
+void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) {
if (p_status != HTTPRequest::RESULT_SUCCESS || p_code != 200) {
EditorNode::get_singleton()->show_warning(TTR("Error getting the list of mirrors."));
@@ -359,8 +359,8 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_
String mirror_str;
{
- PoolByteArray::Read r = p_data.read();
- mirror_str.parse_utf8((const char *)r.ptr(), p_data.size());
+ const uint8_t *r = p_data.ptr();
+ mirror_str.parse_utf8((const char *)r, p_data.size());
}
template_list_state->hide();
@@ -396,7 +396,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_
return;
}
}
-void ExportTemplateManager::_http_download_templates_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
+void ExportTemplateManager::_http_download_templates_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) {
switch (p_status) {
diff --git a/editor/export_template_manager.h b/editor/export_template_manager.h
index 96e61a6569..6ebc7fd131 100644
--- a/editor/export_template_manager.h
+++ b/editor/export_template_manager.h
@@ -72,8 +72,8 @@ class ExportTemplateManager : public ConfirmationDialog {
virtual void ok_pressed();
bool _install_from_file(const String &p_file, bool p_use_progress = true);
- void _http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
- void _http_download_templates_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
+ void _http_download_mirror_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
+ void _http_download_templates_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
void _begin_template_download(const String &p_url);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index a3def15532..b32f90f7b9 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -2506,7 +2506,7 @@ void FileSystemDock::_bind_methods() {
ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &FileSystemDock::_feature_profile_changed);
ADD_SIGNAL(MethodInfo("inherit", PropertyInfo(Variant::STRING, "file")));
- ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::POOL_STRING_ARRAY, "files")));
+ ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files")));
ADD_SIGNAL(MethodInfo("file_removed", PropertyInfo(Variant::STRING, "file")));
ADD_SIGNAL(MethodInfo("folder_removed", PropertyInfo(Variant::STRING, "folder")));
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 095e1b804a..f4bc6ae4be 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -47,7 +47,7 @@
const char *FindInFiles::SIGNAL_RESULT_FOUND = "result_found";
const char *FindInFiles::SIGNAL_FINISHED = "finished";
-// TODO Would be nice in Vector and PoolVectors
+// TODO Would be nice in Vector and Vectors
template <typename T>
inline void pop_back(T &container) {
container.resize(container.size() - 1);
@@ -132,8 +132,8 @@ void FindInFiles::start() {
// Init search
_current_dir = "";
- PoolStringArray init_folder;
- init_folder.append(_root_dir);
+ PackedStringArray init_folder;
+ init_folder.push_back(_root_dir);
_folders_stack.clear();
_folders_stack.push_back(init_folder);
@@ -168,7 +168,7 @@ void FindInFiles::_iterate() {
// Scan folders first so we can build a list of files and have progress info later
- PoolStringArray &folders_to_scan = _folders_stack.write[_folders_stack.size() - 1];
+ PackedStringArray &folders_to_scan = _folders_stack.write[_folders_stack.size() - 1];
if (folders_to_scan.size() != 0) {
// Scan one folder below
@@ -178,7 +178,7 @@ void FindInFiles::_iterate() {
_current_dir = _current_dir.plus_file(folder_name);
- PoolStringArray sub_dirs;
+ PackedStringArray sub_dirs;
_scan_dir("res://" + _current_dir, sub_dirs);
_folders_stack.push_back(sub_dirs);
@@ -219,7 +219,7 @@ float FindInFiles::get_progress() const {
return 0;
}
-void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
+void FindInFiles::_scan_dir(String path, PackedStringArray &out_folders) {
DirAccessRef dir = DirAccess::open(path);
if (!dir) {
@@ -242,7 +242,7 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
continue;
if (dir->current_is_dir())
- out_folders.append(file);
+ out_folders.push_back(file);
else {
String file_ext = file.get_extension();
@@ -823,7 +823,7 @@ void FindInFilesPanel::_on_replace_all_clicked() {
String replace_text = get_replace_text();
- PoolStringArray modified_files;
+ PackedStringArray modified_files;
for (Map<String, TreeItem *>::Element *E = _file_items.front(); E; E = E->next()) {
@@ -844,7 +844,7 @@ void FindInFilesPanel::_on_replace_all_clicked() {
if (locations.size() != 0) {
// Results are sorted by file, so we can batch replaces
apply_replaces_in_file(fpath, locations, replace_text);
- modified_files.append(fpath);
+ modified_files.push_back(fpath);
}
}
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index 243f59096a..5dc4ef5e19 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -69,7 +69,7 @@ protected:
private:
void _process();
void _iterate();
- void _scan_dir(String path, PoolStringArray &out_folders);
+ void _scan_dir(String path, PackedStringArray &out_folders);
void _scan_file(String fpath);
// Config
@@ -82,7 +82,7 @@ private:
// State
bool _searching;
String _current_dir;
- Vector<PoolStringArray> _folders_stack;
+ Vector<PackedStringArray> _folders_stack;
Vector<String> _files_to_scan;
int _initial_files_count;
};
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index c0d84b61b4..f9e8977924 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -764,10 +764,10 @@ Vector<double> EditorSceneImporterGLTF::_decode_accessor(GLTFState &state, const
return dst_buffer;
}
-PoolVector<int> EditorSceneImporterGLTF::_decode_accessor_as_ints(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
+Vector<int> EditorSceneImporterGLTF::_decode_accessor_as_ints(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
- PoolVector<int> ret;
+ Vector<int> ret;
if (attribs.size() == 0)
return ret;
@@ -776,7 +776,7 @@ PoolVector<int> EditorSceneImporterGLTF::_decode_accessor_as_ints(GLTFState &sta
const int ret_size = attribs.size();
ret.resize(ret_size);
{
- PoolVector<int>::Write w = ret.write();
+ int *w = ret.ptrw();
for (int i = 0; i < ret_size; i++) {
w[i] = int(attribs_ptr[i]);
}
@@ -784,10 +784,10 @@ PoolVector<int> EditorSceneImporterGLTF::_decode_accessor_as_ints(GLTFState &sta
return ret;
}
-PoolVector<float> EditorSceneImporterGLTF::_decode_accessor_as_floats(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
+Vector<float> EditorSceneImporterGLTF::_decode_accessor_as_floats(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
- PoolVector<float> ret;
+ Vector<float> ret;
if (attribs.size() == 0)
return ret;
@@ -796,7 +796,7 @@ PoolVector<float> EditorSceneImporterGLTF::_decode_accessor_as_floats(GLTFState
const int ret_size = attribs.size();
ret.resize(ret_size);
{
- PoolVector<float>::Write w = ret.write();
+ float *w = ret.ptrw();
for (int i = 0; i < ret_size; i++) {
w[i] = float(attribs_ptr[i]);
}
@@ -804,10 +804,10 @@ PoolVector<float> EditorSceneImporterGLTF::_decode_accessor_as_floats(GLTFState
return ret;
}
-PoolVector<Vector2> EditorSceneImporterGLTF::_decode_accessor_as_vec2(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
+Vector<Vector2> EditorSceneImporterGLTF::_decode_accessor_as_vec2(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
- PoolVector<Vector2> ret;
+ Vector<Vector2> ret;
if (attribs.size() == 0)
return ret;
@@ -817,7 +817,7 @@ PoolVector<Vector2> EditorSceneImporterGLTF::_decode_accessor_as_vec2(GLTFState
const int ret_size = attribs.size() / 2;
ret.resize(ret_size);
{
- PoolVector<Vector2>::Write w = ret.write();
+ Vector2 *w = ret.ptrw();
for (int i = 0; i < ret_size; i++) {
w[i] = Vector2(attribs_ptr[i * 2 + 0], attribs_ptr[i * 2 + 1]);
}
@@ -825,10 +825,10 @@ PoolVector<Vector2> EditorSceneImporterGLTF::_decode_accessor_as_vec2(GLTFState
return ret;
}
-PoolVector<Vector3> EditorSceneImporterGLTF::_decode_accessor_as_vec3(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
+Vector<Vector3> EditorSceneImporterGLTF::_decode_accessor_as_vec3(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
- PoolVector<Vector3> ret;
+ Vector<Vector3> ret;
if (attribs.size() == 0)
return ret;
@@ -838,7 +838,7 @@ PoolVector<Vector3> EditorSceneImporterGLTF::_decode_accessor_as_vec3(GLTFState
const int ret_size = attribs.size() / 3;
ret.resize(ret_size);
{
- PoolVector<Vector3>::Write w = ret.write();
+ Vector3 *w = ret.ptrw();
for (int i = 0; i < ret_size; i++) {
w[i] = Vector3(attribs_ptr[i * 3 + 0], attribs_ptr[i * 3 + 1], attribs_ptr[i * 3 + 2]);
}
@@ -846,10 +846,10 @@ PoolVector<Vector3> EditorSceneImporterGLTF::_decode_accessor_as_vec3(GLTFState
return ret;
}
-PoolVector<Color> EditorSceneImporterGLTF::_decode_accessor_as_color(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
+Vector<Color> EditorSceneImporterGLTF::_decode_accessor_as_color(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) {
const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex);
- PoolVector<Color> ret;
+ Vector<Color> ret;
if (attribs.size() == 0)
return ret;
@@ -866,7 +866,7 @@ PoolVector<Color> EditorSceneImporterGLTF::_decode_accessor_as_color(GLTFState &
const int ret_size = attribs.size() / vec_len;
ret.resize(ret_size);
{
- PoolVector<Color>::Write w = ret.write();
+ Color *w = ret.ptrw();
for (int i = 0; i < ret_size; i++) {
w[i] = Color(attribs_ptr[i * vec_len + 0], attribs_ptr[i * vec_len + 1], attribs_ptr[i * vec_len + 2], vec_len == 4 ? attribs_ptr[i * 4 + 3] : 1.0);
}
@@ -1021,10 +1021,10 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
array[Mesh::ARRAY_BONES] = _decode_accessor_as_ints(state, a["JOINTS_0"], true);
}
if (a.has("WEIGHTS_0")) {
- PoolVector<float> weights = _decode_accessor_as_floats(state, a["WEIGHTS_0"], true);
+ Vector<float> weights = _decode_accessor_as_floats(state, a["WEIGHTS_0"], true);
{ //gltf does not seem to normalize the weights for some reason..
int wc = weights.size();
- PoolVector<float>::Write w = weights.write();
+ float *w = weights.ptrw();
for (int k = 0; k < wc; k += 4) {
float total = 0.0;
@@ -1044,13 +1044,13 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
}
if (p.has("indices")) {
- PoolVector<int> indices = _decode_accessor_as_ints(state, p["indices"], false);
+ Vector<int> indices = _decode_accessor_as_ints(state, p["indices"], false);
if (primitive == Mesh::PRIMITIVE_TRIANGLES) {
//swap around indices, convert ccw to cw for front face
const int is = indices.size();
- const PoolVector<int>::Write w = indices.write();
+ int *w = indices.ptrw();
for (int k = 0; k < is; k += 3) {
SWAP(w[k + 1], w[k + 2]);
}
@@ -1059,13 +1059,13 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
} else if (primitive == Mesh::PRIMITIVE_TRIANGLES) {
//generate indices because they need to be swapped for CW/CCW
- const PoolVector<Vector3> &vertices = array[Mesh::ARRAY_VERTEX];
+ const Vector<Vector3> &vertices = array[Mesh::ARRAY_VERTEX];
ERR_FAIL_COND_V(vertices.size() == 0, ERR_PARSE_ERROR);
- PoolVector<int> indices;
+ Vector<int> indices;
const int vs = vertices.size();
indices.resize(vs);
{
- const PoolVector<int>::Write w = indices.write();
+ int *w = indices.ptrw();
for (int k = 0; k < vs; k += 3) {
w[k] = k;
w[k + 1] = k + 2;
@@ -1127,8 +1127,8 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
array_copy[Mesh::ARRAY_INDEX] = Variant();
if (t.has("POSITION")) {
- PoolVector<Vector3> varr = _decode_accessor_as_vec3(state, t["POSITION"], true);
- const PoolVector<Vector3> src_varr = array[Mesh::ARRAY_VERTEX];
+ Vector<Vector3> varr = _decode_accessor_as_vec3(state, t["POSITION"], true);
+ const Vector<Vector3> src_varr = array[Mesh::ARRAY_VERTEX];
const int size = src_varr.size();
ERR_FAIL_COND_V(size == 0, ERR_PARSE_ERROR);
{
@@ -1136,9 +1136,9 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
const int max_idx = varr.size();
varr.resize(size);
- const PoolVector<Vector3>::Write w_varr = varr.write();
- const PoolVector<Vector3>::Read r_varr = varr.read();
- const PoolVector<Vector3>::Read r_src_varr = src_varr.read();
+ Vector3 *w_varr = varr.ptrw();
+ const Vector3 *r_varr = varr.ptr();
+ const Vector3 *r_src_varr = src_varr.ptr();
for (int l = 0; l < size; l++) {
if (l < max_idx) {
w_varr[l] = r_varr[l] + r_src_varr[l];
@@ -1150,17 +1150,17 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
array_copy[Mesh::ARRAY_VERTEX] = varr;
}
if (t.has("NORMAL")) {
- PoolVector<Vector3> narr = _decode_accessor_as_vec3(state, t["NORMAL"], true);
- const PoolVector<Vector3> src_narr = array[Mesh::ARRAY_NORMAL];
+ Vector<Vector3> narr = _decode_accessor_as_vec3(state, t["NORMAL"], true);
+ const Vector<Vector3> src_narr = array[Mesh::ARRAY_NORMAL];
int size = src_narr.size();
ERR_FAIL_COND_V(size == 0, ERR_PARSE_ERROR);
{
int max_idx = narr.size();
narr.resize(size);
- const PoolVector<Vector3>::Write w_narr = narr.write();
- const PoolVector<Vector3>::Read r_narr = narr.read();
- const PoolVector<Vector3>::Read r_src_narr = src_narr.read();
+ Vector3 *w_narr = narr.ptrw();
+ const Vector3 *r_narr = narr.ptr();
+ const Vector3 *r_src_narr = src_narr.ptr();
for (int l = 0; l < size; l++) {
if (l < max_idx) {
w_narr[l] = r_narr[l] + r_src_narr[l];
@@ -1172,11 +1172,11 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
array_copy[Mesh::ARRAY_NORMAL] = narr;
}
if (t.has("TANGENT")) {
- const PoolVector<Vector3> tangents_v3 = _decode_accessor_as_vec3(state, t["TANGENT"], true);
- const PoolVector<float> src_tangents = array[Mesh::ARRAY_TANGENT];
+ const Vector<Vector3> tangents_v3 = _decode_accessor_as_vec3(state, t["TANGENT"], true);
+ const Vector<float> src_tangents = array[Mesh::ARRAY_TANGENT];
ERR_FAIL_COND_V(src_tangents.size() == 0, ERR_PARSE_ERROR);
- PoolVector<float> tangents_v4;
+ Vector<float> tangents_v4;
{
@@ -1184,10 +1184,10 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
int size4 = src_tangents.size();
tangents_v4.resize(size4);
- const PoolVector<float>::Write w4 = tangents_v4.write();
+ float *w4 = tangents_v4.ptrw();
- const PoolVector<Vector3>::Read r3 = tangents_v3.read();
- const PoolVector<float>::Read r4 = src_tangents.read();
+ const Vector3 *r3 = tangents_v3.ptr();
+ const float *r4 = src_tangents.ptr();
for (int l = 0; l < size4 / 4; l++) {
@@ -2397,9 +2397,9 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
}
}
- const PoolVector<float> times = _decode_accessor_as_floats(state, input, false);
+ const Vector<float> times = _decode_accessor_as_floats(state, input, false);
if (path == "translation") {
- const PoolVector<Vector3> translations = _decode_accessor_as_vec3(state, output, false);
+ const Vector<Vector3> translations = _decode_accessor_as_vec3(state, output, false);
track->translation_track.interpolation = interp;
track->translation_track.times = Variant(times); //convert via variant
track->translation_track.values = Variant(translations); //convert via variant
@@ -2409,12 +2409,12 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
track->rotation_track.times = Variant(times); //convert via variant
track->rotation_track.values = rotations; //convert via variant
} else if (path == "scale") {
- const PoolVector<Vector3> scales = _decode_accessor_as_vec3(state, output, false);
+ const Vector<Vector3> scales = _decode_accessor_as_vec3(state, output, false);
track->scale_track.interpolation = interp;
track->scale_track.times = Variant(times); //convert via variant
track->scale_track.values = Variant(scales); //convert via variant
} else if (path == "weights") {
- const PoolVector<float> weights = _decode_accessor_as_floats(state, output, false);
+ const Vector<float> weights = _decode_accessor_as_floats(state, output, false);
ERR_FAIL_INDEX_V(state.nodes[node]->mesh, state.meshes.size(), ERR_PARSE_ERROR);
const GLTFMesh *mesh = &state.meshes[state.nodes[node]->mesh];
@@ -2427,7 +2427,7 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
ERR_FAIL_COND_V_MSG(weights.size() != expected_value_count, ERR_PARSE_ERROR, "Invalid weight data, expected " + itos(expected_value_count) + " weight values, got " + itos(weights.size()) + " instead.");
const int wlen = weights.size() / wc;
- PoolVector<float>::Read r = weights.read();
+ const float *r = weights.ptr();
for (int k = 0; k < wc; k++) { //separate tracks, having them together is not such a good idea
GLTFAnimation::Channel<float> cf;
cf.interpolation = interp;
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
index a4a715d17c..72d5b04e67 100644
--- a/editor/import/editor_scene_importer_gltf.h
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -352,11 +352,11 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Error _decode_buffer_view(GLTFState &state, double *dst, const GLTFBufferViewIndex p_buffer_view, const int skip_every, const int skip_bytes, const int element_size, const int count, const GLTFType type, const int component_count, const int component_type, const int component_size, const bool normalized, const int byte_offset, const bool for_vertex);
Vector<double> _decode_accessor(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
- PoolVector<float> _decode_accessor_as_floats(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
- PoolVector<int> _decode_accessor_as_ints(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
- PoolVector<Vector2> _decode_accessor_as_vec2(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
- PoolVector<Vector3> _decode_accessor_as_vec3(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
- PoolVector<Color> _decode_accessor_as_color(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
+ Vector<float> _decode_accessor_as_floats(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
+ Vector<int> _decode_accessor_as_ints(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
+ Vector<Vector2> _decode_accessor_as_vec2(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
+ Vector<Vector3> _decode_accessor_as_vec3(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
+ Vector<Color> _decode_accessor_as_color(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
Vector<Quat> _decode_accessor_as_quat(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
Vector<Transform2D> _decode_accessor_as_xform2d(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
Vector<Basis> _decode_accessor_as_basis(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex);
diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp
index c6fdbd1378..22989b81e4 100644
--- a/editor/import/resource_importer_bitmask.cpp
+++ b/editor/import/resource_importer_bitmask.cpp
@@ -94,7 +94,6 @@ Error ResourceImporterBitMap::import(const String &p_source_file, const String &
Ref<BitMap> bitmap;
bitmap.instance();
bitmap->create(Size2(w, h));
- image->lock();
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index 9ea2911c63..d472070808 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -187,11 +187,11 @@ void ResourceImporterLayeredTexture::_save_tex(const Vector<Ref<Image> > &p_imag
image->shrink_x2();
}
- PoolVector<uint8_t> data = Image::lossless_packer(image);
+ Vector<uint8_t> data = Image::lossless_packer(image);
int data_len = data.size();
f->store_32(data_len);
- PoolVector<uint8_t>::Read r = data.read();
+ const uint8_t* r = data.ptr();
f->store_buffer(r.ptr(), data_len);
}
@@ -210,10 +210,10 @@ void ResourceImporterLayeredTexture::_save_tex(const Vector<Ref<Image> > &p_imag
f->store_32(p_compress_mode); // 0 - lossless (PNG), 1 - vram, 2 - uncompressed
}
- PoolVector<uint8_t> data = image->get_data();
+ Vector<uint8_t> data = image->get_data();
int dl = data.size();
- PoolVector<uint8_t>::Read r = data.read();
+ const uint8_t* r = data.ptr();
f->store_buffer(r.ptr(), dl);
} break;
case COMPRESS_UNCOMPRESSED: {
@@ -226,10 +226,10 @@ void ResourceImporterLayeredTexture::_save_tex(const Vector<Ref<Image> > &p_imag
image->clear_mipmaps();
}
- PoolVector<uint8_t> data = image->get_data();
+ Vector<uint8_t> data = image->get_data();
int dl = data.size();
- PoolVector<uint8_t>::Read r = data.read();
+ const uint8_t* r = data.ptr();
f->store_buffer(r.ptr(), dl);
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index aa7346efe8..7144bc04c8 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -242,12 +242,12 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
for (int i = 0; i < p_image->get_mipmap_count() + 1; i++) {
- PoolVector<uint8_t> data = Image::lossless_packer(p_image->get_image_from_mipmap(i));
+ Vector<uint8_t> data = Image::lossless_packer(p_image->get_image_from_mipmap(i));
int data_len = data.size();
f->store_32(data_len);
- PoolVector<uint8_t>::Read r = data.read();
- f->store_buffer(r.ptr(), data_len);
+ const uint8_t *r = data.ptr();
+ f->store_buffer(r, data_len);
}
} break;
@@ -261,12 +261,12 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
for (int i = 0; i < p_image->get_mipmap_count() + 1; i++) {
- PoolVector<uint8_t> data = Image::lossy_packer(p_image->get_image_from_mipmap(i), p_lossy_quality);
+ Vector<uint8_t> data = Image::lossy_packer(p_image->get_image_from_mipmap(i), p_lossy_quality);
int data_len = data.size();
f->store_32(data_len);
- PoolVector<uint8_t>::Read r = data.read();
- f->store_buffer(r.ptr(), data_len);
+ const uint8_t *r = data.ptr();
+ f->store_buffer(r, data_len);
}
} break;
case COMPRESS_VRAM_COMPRESSED: {
@@ -285,10 +285,10 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
f->store_32(image->get_mipmap_count());
f->store_32(image->get_format());
- PoolVector<uint8_t> data = image->get_data();
+ Vector<uint8_t> data = image->get_data();
int dl = data.size();
- PoolVector<uint8_t>::Read r = data.read();
- f->store_buffer(r.ptr(), dl);
+ const uint8_t *r = data.ptr();
+ f->store_buffer(r, dl);
} break;
case COMPRESS_VRAM_UNCOMPRESSED: {
@@ -298,11 +298,11 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
f->store_32(p_image->get_mipmap_count());
f->store_32(p_image->get_format());
- PoolVector<uint8_t> data = p_image->get_data();
+ Vector<uint8_t> data = p_image->get_data();
int dl = data.size();
- PoolVector<uint8_t>::Read r = data.read();
+ const uint8_t *r = data.ptr();
- f->store_buffer(r.ptr(), dl);
+ f->store_buffer(r, dl);
} break;
case COMPRESS_BASIS_UNIVERSAL: {
@@ -315,12 +315,12 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
for (int i = 0; i < p_image->get_mipmap_count() + 1; i++) {
- PoolVector<uint8_t> data = Image::basis_universal_packer(p_image->get_image_from_mipmap(i), p_channels);
+ Vector<uint8_t> data = Image::basis_universal_packer(p_image->get_image_from_mipmap(i), p_channels);
int data_len = data.size();
f->store_32(data_len);
- PoolVector<uint8_t>::Read r = data.read();
- f->store_buffer(r.ptr(), data_len);
+ const uint8_t *r = data.ptr();
+ f->store_buffer(r, data_len);
}
} break;
}
@@ -476,13 +476,11 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
int height = image->get_height();
int width = image->get_width();
- image->lock();
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
image->set_pixel(i, j, image->get_pixel(i, j).inverted());
}
}
- image->unlock();
}
if (compress_mode == COMPRESS_BASIS_UNIVERSAL && image->get_format() >= Image::FORMAT_RF) {
diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp
index 00a25ec886..4291d6f2d7 100644
--- a/editor/import/resource_importer_texture_atlas.cpp
+++ b/editor/import/resource_importer_texture_atlas.cpp
@@ -286,12 +286,10 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
new_atlas.instance();
new_atlas->create(atlas_width, atlas_height, false, Image::FORMAT_RGBA8);
- new_atlas->lock();
-
for (int i = 0; i < pack_data_files.size(); i++) {
PackData &pack_data = pack_data_files.write[i];
- pack_data.image->lock();
+
for (int j = 0; j < pack_data.chart_pieces.size(); j++) {
const EditorAtlasPacker::Chart &chart = charts[pack_data.chart_pieces[j]];
for (int k = 0; k < chart.faces.size(); k++) {
@@ -304,9 +302,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
_plot_triangle(positions, chart.final_offset, chart.transposed, new_atlas, pack_data.image);
}
}
- pack_data.image->unlock();
}
- new_atlas->unlock();
//save the atlas
@@ -350,9 +346,9 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
for (int i = 0; i < pack_data.chart_pieces.size(); i++) {
const EditorAtlasPacker::Chart &chart = charts[pack_data.chart_pieces[i]];
- PoolVector<Vector2> vertices;
- PoolVector<int> indices;
- PoolVector<Vector2> uvs;
+ Vector<Vector2> vertices;
+ Vector<int> indices;
+ Vector<Vector2> uvs;
int vc = chart.vertices.size();
int fc = chart.faces.size();
vertices.resize(vc);
@@ -360,9 +356,9 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
indices.resize(fc * 3);
{
- PoolVector<Vector2>::Write vw = vertices.write();
- PoolVector<int>::Write iw = indices.write();
- PoolVector<Vector2>::Write uvw = uvs.write();
+ Vector2 *vw = vertices.ptrw();
+ int *iw = indices.ptrw();
+ Vector2 *uvw = uvs.ptrw();
for (int j = 0; j < vc; j++) {
vw[j] = chart.vertices[j];
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp
index 2d43fa089d..b65209d204 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -467,7 +467,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
is16 = false;
}
- PoolVector<uint8_t> dst_data;
+ Vector<uint8_t> dst_data;
AudioStreamSample::Format dst_format;
if (compression == 1) {
@@ -490,8 +490,8 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
right.write[i] = data[i * 2 + 1];
}
- PoolVector<uint8_t> bleft;
- PoolVector<uint8_t> bright;
+ Vector<uint8_t> bleft;
+ Vector<uint8_t> bright;
_compress_ima_adpcm(left, bleft);
_compress_ima_adpcm(right, bright);
@@ -499,9 +499,9 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
int dl = bleft.size();
dst_data.resize(dl * 2);
- PoolVector<uint8_t>::Write w = dst_data.write();
- PoolVector<uint8_t>::Read rl = bleft.read();
- PoolVector<uint8_t>::Read rr = bright.read();
+ uint8_t *w = dst_data.ptrw();
+ const uint8_t *rl = bleft.ptr();
+ const uint8_t *rr = bright.ptr();
for (int i = 0; i < dl; i++) {
w[i * 2 + 0] = rl[i];
@@ -514,7 +514,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
dst_format = is16 ? AudioStreamSample::FORMAT_16_BITS : AudioStreamSample::FORMAT_8_BITS;
dst_data.resize(data.size() * (is16 ? 2 : 1));
{
- PoolVector<uint8_t>::Write w = dst_data.write();
+ uint8_t *w = dst_data.ptrw();
int ds = data.size();
for (int i = 0; i < ds; i++) {
diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h
index 59d33feef0..6df5b88b13 100644
--- a/editor/import/resource_importer_wav.h
+++ b/editor/import/resource_importer_wav.h
@@ -49,7 +49,7 @@ public:
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
- static void _compress_ima_adpcm(const Vector<float> &p_data, PoolVector<uint8_t> &dst_data) {
+ static void _compress_ima_adpcm(const Vector<float> &p_data, Vector<uint8_t> &dst_data) {
/*p_sample_data->data = (void*)malloc(len);
xm_s8 *dataptr=(xm_s8*)p_sample_data->data;*/
@@ -76,10 +76,10 @@ public:
datalen++;
dst_data.resize(datalen / 2 + 4);
- PoolVector<uint8_t>::Write w = dst_data.write();
+ uint8_t *w = dst_data.ptrw();
int i, step_idx = 0, prev = 0;
- uint8_t *out = w.ptr();
+ uint8_t *out = w;
//int16_t xm_prev=0;
const float *in = p_data.ptr();
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index b2d132b3da..2d038d11ad 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -150,7 +150,7 @@ void AbstractPolygon2DEditor::_action_add_polygon(const Variant &p_polygon) {
void AbstractPolygon2DEditor::_action_remove_polygon(int p_idx) {
- _action_set_polygon(p_idx, _get_polygon(p_idx), PoolVector<Vector2>());
+ _action_set_polygon(p_idx, _get_polygon(p_idx), Vector<Vector2>());
}
void AbstractPolygon2DEditor::_action_set_polygon(int p_idx, const Variant &p_polygon) {
@@ -256,7 +256,7 @@ void AbstractPolygon2DEditor::_wip_close() {
undo_redo->create_action(TTR("Create Polygon"));
_action_add_polygon(wip);
if (_has_uv()) {
- undo_redo->add_do_method(_get_node(), "set_uv", PoolVector<Vector2>());
+ undo_redo->add_do_method(_get_node(), "set_uv", Vector<Vector2>());
undo_redo->add_undo_method(_get_node(), "set_uv", _get_node()->get("uv"));
}
_commit_action();
@@ -584,7 +584,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
if (wip_active && wip_destructive && j != -1)
continue;
- PoolVector<Vector2> points;
+ Vector<Vector2> points;
Vector2 offset;
if (wip_active && j == edited_point.polygon) {
@@ -703,7 +703,7 @@ void AbstractPolygon2DEditor::_bind_methods() {
void AbstractPolygon2DEditor::remove_point(const Vertex &p_vertex) {
- PoolVector<Vector2> vertices = _get_polygon(p_vertex.polygon);
+ Vector<Vector2> vertices = _get_polygon(p_vertex.polygon);
if (vertices.size() > (_is_line() ? 2 : 3)) {
@@ -744,7 +744,7 @@ AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_point(const
for (int j = 0; j < n_polygons; j++) {
- PoolVector<Vector2> points = _get_polygon(j);
+ Vector<Vector2> points = _get_polygon(j);
const Vector2 offset = _get_offset(j);
const int n_points = points.size();
@@ -777,7 +777,7 @@ AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_edge_point(c
for (int j = 0; j < n_polygons; j++) {
- PoolVector<Vector2> points = _get_polygon(j);
+ Vector<Vector2> points = _get_polygon(j);
const Vector2 offset = _get_offset(j);
const int n_points = points.size();
const int n_segments = n_points - (_is_line() ? 1 : 0);
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index a479703527..3d47dd46db 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -166,9 +166,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
// Overlay and thumbnail need the same format for `blend_rect` to work.
thumbnail->convert(Image::FORMAT_RGBA8);
- thumbnail->lock();
+
thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
- thumbnail->unlock();
Ref<ImageTexture> tex;
tex.instance();
@@ -322,7 +321,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
}
///////////////////////////////////////////////////////////////////////////////////
-void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
+void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) {
String error_text;
@@ -710,12 +709,12 @@ void EditorAssetLibrary::_select_asset(int p_id) {
_api_request("asset/" + itos(p_id), REQUESTING_ASSET);
}
-void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByteArray &p_data, int p_queue_id) {
+void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedByteArray &p_data, int p_queue_id) {
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
bool image_set = false;
- PoolByteArray image_data = p_data;
+ PackedByteArray image_data = p_data;
if (use_cache) {
String cache_filename_base = EditorSettings::get_singleton()->get_cache_dir().plus_file("assetimage_" + image_queue[p_queue_id].image_url.md5_text());
@@ -723,12 +722,12 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
FileAccess *file = FileAccess::open(cache_filename_base + ".data", FileAccess::READ);
if (file) {
- PoolByteArray cached_data;
+ PackedByteArray cached_data;
int len = file->get_32();
cached_data.resize(len);
- PoolByteArray::Write w = cached_data.write();
- file->get_buffer(w.ptr(), len);
+ uint8_t *w = cached_data.ptrw();
+ file->get_buffer(w, len);
image_data = cached_data;
file->close();
@@ -737,17 +736,17 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
}
int len = image_data.size();
- PoolByteArray::Read r = image_data.read();
+ const uint8_t *r = image_data.ptr();
Ref<Image> image = Ref<Image>(memnew(Image));
uint8_t png_signature[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
uint8_t jpg_signature[3] = { 255, 216, 255 };
- if (r.ptr()) {
+ if (r) {
if ((memcmp(&r[0], &png_signature[0], 8) == 0) && Image::_png_mem_loader_func) {
- image->copy_internals_from(Image::_png_mem_loader_func(r.ptr(), len));
+ image->copy_internals_from(Image::_png_mem_loader_func(r, len));
} else if ((memcmp(&r[0], &jpg_signature[0], 3) == 0) && Image::_jpg_mem_loader_func) {
- image->copy_internals_from(Image::_jpg_mem_loader_func(r.ptr(), len));
+ image->copy_internals_from(Image::_jpg_mem_loader_func(r, len));
}
}
@@ -790,7 +789,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
}
}
-void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data, int p_queue_id) {
+void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data, int p_queue_id) {
ERR_FAIL_COND(!image_queue.has(p_queue_id));
@@ -811,11 +810,11 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
}
int len = p_data.size();
- PoolByteArray::Read r = p_data.read();
+ const uint8_t *r = p_data.ptr();
file = FileAccess::open(cache_filename_base + ".data", FileAccess::WRITE);
if (file) {
file->store_32(len);
- file->store_buffer(r.ptr(), len);
+ file->store_buffer(r, len);
file->close();
memdelete(file);
}
@@ -899,7 +898,7 @@ void EditorAssetLibrary::_request_image(ObjectID p_for, String p_image_url, Imag
add_child(iq.request);
- _image_update(true, false, PoolByteArray(), iq.queue_id);
+ _image_update(true, false, PackedByteArray(), iq.queue_id);
_update_image_queue();
}
@@ -1068,14 +1067,14 @@ void EditorAssetLibrary::_api_request(const String &p_request, RequestType p_req
request->request(host + "/" + p_request + p_arguments);
}
-void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
+void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) {
String str;
{
int datalen = p_data.size();
- PoolByteArray::Read r = p_data.read();
- str.parse_utf8((const char *)r.ptr(), datalen);
+ const uint8_t *r = p_data.ptr();
+ str.parse_utf8((const char *)r, datalen);
}
bool error_abort = true;
diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h
index e13d8a6149..536a855d03 100644
--- a/editor/plugins/asset_library_editor_plugin.h
+++ b/editor/plugins/asset_library_editor_plugin.h
@@ -156,7 +156,7 @@ class EditorAssetLibraryItemDownload : public PanelContainer {
void _close();
void _install();
void _make_request();
- void _http_download_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
+ void _http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
protected:
void _notification(int p_what);
@@ -250,8 +250,8 @@ class EditorAssetLibrary : public PanelContainer {
int last_queue_id;
Map<int, ImageQueue> image_queue;
- void _image_update(bool use_cache, bool final, const PoolByteArray &p_data, int p_queue_id);
- void _image_request_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data, int p_queue_id);
+ void _image_update(bool use_cache, bool final, const PackedByteArray &p_data, int p_queue_id);
+ void _image_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data, int p_queue_id);
void _request_image(ObjectID p_for, String p_image_url, ImageType p_type, int p_image_index);
void _update_image_queue();
@@ -286,8 +286,8 @@ class EditorAssetLibrary : public PanelContainer {
void _rerun_search(int p_ignore);
void _search_text_entered(const String &p_text = "");
void _api_request(const String &p_request, RequestType p_request_type, const String &p_arguments = "");
- void _http_request_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
- void _http_download_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
+ void _http_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
+ void _http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
void _repository_changed(int p_repository_id);
void _support_toggled(int p_support);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index f7a3b50052..3ab7fdb39c 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5987,7 +5987,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
if (default_type == "NinePatchRect") {
editor_data->get_undo_redo().add_do_property(child, "rect/size", texture_size);
} else if (default_type == "Polygon2D") {
- PoolVector<Vector2> list;
+ Vector<Vector2> list;
list.push_back(Vector2(0, 0));
list.push_back(Vector2(texture_size.width, 0));
list.push_back(Vector2(texture_size.width, texture_size.height));
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 3de67589ee..9aa9b6cda5 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -470,11 +470,11 @@ void Polygon3DEditor::_polygon_draw() {
Array a;
a.resize(Mesh::ARRAY_MAX);
- PoolVector<Vector3> va;
+ Vector<Vector3> va;
{
va.resize(poly.size());
- PoolVector<Vector3>::Write w = va.write();
+ Vector3 *w = va.ptrw();
for (int i = 0; i < poly.size(); i++) {
Vector2 p, p2;
diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
index 655048c271..80f5e26d48 100644
--- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
@@ -118,8 +118,8 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
int vpc = 0;
{
- PoolVector<uint8_t> data = img->get_data();
- PoolVector<uint8_t>::Read r = data.read();
+ Vector<uint8_t> data = img->get_data();
+ const uint8_t *r = data.ptr();
for (int i = 0; i < s.width; i++) {
for (int j = 0; j < s.height; j++) {
@@ -198,9 +198,9 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
ERR_FAIL_COND_MSG(valid_positions.size() == 0, "No pixels with transparency > 128 in image...");
if (capture_colors) {
- PoolColorArray pca;
+ PackedColorArray pca;
pca.resize(vpc);
- PoolColorArray::Write pcaw = pca.write();
+ Color *pcaw = pca.ptrw();
for (int i = 0; i < vpc; i += 1) {
Color color;
color.r = valid_colors[i * 4 + 0] / 255.0f;
@@ -214,9 +214,9 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
if (valid_normals.size()) {
particles->set_emission_shape(CPUParticles2D::EMISSION_SHAPE_DIRECTED_POINTS);
- PoolVector2Array norms;
+ PackedVector2Array norms;
norms.resize(valid_normals.size());
- PoolVector2Array::Write normsw = norms.write();
+ Vector2 *normsw = norms.ptrw();
for (int i = 0; i < valid_normals.size(); i += 1) {
normsw[i] = valid_normals[i];
}
@@ -226,9 +226,9 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
}
{
- PoolVector2Array points;
+ PackedVector2Array points;
points.resize(valid_positions.size());
- PoolVector2Array::Write pointsw = points.write();
+ Vector2 *pointsw = points.ptrw();
for (int i = 0; i < valid_positions.size(); i += 1) {
pointsw[i] = valid_positions[i];
}
diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp
index 2074ba6b99..be3e9cd8e0 100644
--- a/editor/plugins/cpu_particles_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_editor_plugin.cpp
@@ -80,8 +80,8 @@ void CPUParticlesEditor::edit(CPUParticles *p_particles) {
void CPUParticlesEditor::_generate_emission_points() {
/// hacer codigo aca
- PoolVector<Vector3> points;
- PoolVector<Vector3> normals;
+ Vector<Vector3> points;
+ Vector<Vector3> normals;
if (!_generate(points, normals)) {
return;
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp
index 0af983f780..62a3ff9b58 100644
--- a/editor/plugins/curve_editor_plugin.cpp
+++ b/editor/plugins/curve_editor_plugin.cpp
@@ -802,8 +802,6 @@ Ref<Texture2D> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, cons
im.create(thumbnail_size, thumbnail_size / 2, 0, Image::FORMAT_RGBA8);
- im.lock();
-
Color bg_color(0.1, 0.1, 0.1, 1.0);
for (int i = 0; i < thumbnail_size; i++) {
for (int j = 0; j < thumbnail_size / 2; j++) {
@@ -844,8 +842,6 @@ Ref<Texture2D> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, cons
prev_y = y;
}
- im.unlock();
-
Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
ptex->create_from_image(img_ref);
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 6e8aef0aea..3c173ab783 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -47,8 +47,6 @@ void post_process_preview(Ref<Image> p_image) {
if (p_image->get_format() != Image::FORMAT_RGBA8)
p_image->convert(Image::FORMAT_RGBA8);
- p_image->lock();
-
const int w = p_image->get_width();
const int h = p_image->get_height();
@@ -70,8 +68,6 @@ void post_process_preview(Ref<Image> p_image) {
}
}
}
-
- p_image->unlock();
}
bool EditorTexturePreviewPlugin::handles(const String &p_type) const {
@@ -207,19 +203,19 @@ Ref<Texture2D> EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size
return Ref<Texture2D>();
}
- PoolVector<uint8_t> data;
+ Vector<uint8_t> data;
data.resize(bm->get_size().width * bm->get_size().height);
{
- PoolVector<uint8_t>::Write w = data.write();
+ uint8_t *w = data.ptrw();
for (int i = 0; i < bm->get_size().width; i++) {
for (int j = 0; j < bm->get_size().height; j++) {
if (bm->get_bit(Point2i(i, j))) {
- w[j * bm->get_size().width + i] = 255;
+ w[j * (int)bm->get_size().width + i] = 255;
} else {
- w[j * bm->get_size().width + i] = 0;
+ w[j * (int)bm->get_size().width + i] = 0;
}
}
}
@@ -396,10 +392,10 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
int lons = 32;
float radius = 1.0;
- PoolVector<Vector3> vertices;
- PoolVector<Vector3> normals;
- PoolVector<Vector2> uvs;
- PoolVector<float> tangents;
+ Vector<Vector3> vertices;
+ Vector<Vector3> normals;
+ Vector<Vector2> uvs;
+ Vector<float> tangents;
Basis tt = Basis(Vector3(0, 1, 0), Math_PI * 0.5);
for (int i = 1; i <= lats; i++) {
@@ -522,8 +518,6 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size
Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color");
Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color");
- img->lock();
-
if (bg_color.a == 0)
bg_color = Color(0, 0, 0, 0);
bg_color.a = MAX(bg_color.a, 0.2); // some background
@@ -593,8 +587,6 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size
col++;
}
- img->unlock();
-
post_process_preview(img);
Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
@@ -617,14 +609,14 @@ Ref<Texture2D> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const
Ref<AudioStream> stream = p_from;
ERR_FAIL_COND_V(stream.is_null(), Ref<Texture2D>());
- PoolVector<uint8_t> img;
+ Vector<uint8_t> img;
int w = p_size.x;
int h = p_size.y;
img.resize(w * h * 3);
- PoolVector<uint8_t>::Write imgdata = img.write();
- uint8_t *imgw = imgdata.ptr();
+ uint8_t *imgdata = img.ptrw();
+ uint8_t *imgw = imgdata;
Ref<AudioStreamPlayback> playback = stream->instance_playback();
ERR_FAIL_COND_V(playback.is_null(), Ref<Texture2D>());
@@ -680,7 +672,6 @@ Ref<Texture2D> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const
}
}
- imgdata.release();
//post_process_preview(img);
Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture));
diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp
index aaba6406c7..574646956e 100644
--- a/editor/plugins/mesh_instance_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_editor_plugin.cpp
@@ -327,24 +327,24 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) {
continue;
Array a = mesh->surface_get_arrays(i);
- PoolVector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2];
+ Vector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2];
if (uv.size() == 0) {
err_dialog->set_text(TTR("Model has no UV in this layer"));
err_dialog->popup_centered_minsize();
return;
}
- PoolVector<Vector2>::Read r = uv.read();
+ const Vector2 *r = uv.ptr();
- PoolVector<int> indices = a[Mesh::ARRAY_INDEX];
- PoolVector<int>::Read ri;
+ Vector<int> indices = a[Mesh::ARRAY_INDEX];
+ const int *ri;
int ic;
bool use_indices;
if (indices.size()) {
ic = indices.size();
- ri = indices.read();
+ ri = indices.ptr();
use_indices = true;
} else {
ic = uv.size();
diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp
index ddd27b5e97..4b7fd6399b 100644
--- a/editor/plugins/multimesh_editor_plugin.cpp
+++ b/editor/plugins/multimesh_editor_plugin.cpp
@@ -124,7 +124,7 @@ void MultiMeshEditor::_populate() {
Transform geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform();
- PoolVector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID);
+ Vector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID);
if (geometry.size() == 0) {
@@ -136,7 +136,7 @@ void MultiMeshEditor::_populate() {
//make all faces local
int gc = geometry.size();
- PoolVector<Face3>::Write w = geometry.write();
+ Face3 *w = geometry.ptrw();
for (int i = 0; i < gc; i++) {
for (int j = 0; j < 3; j++) {
@@ -144,13 +144,11 @@ void MultiMeshEditor::_populate() {
}
}
- w.release();
-
- PoolVector<Face3> faces = geometry;
+ Vector<Face3> faces = geometry;
int facecount = faces.size();
ERR_FAIL_COND_MSG(!facecount, "Parent has no solid faces to populate.");
- PoolVector<Face3>::Read r = faces.read();
+ const Face3 *r = faces.ptr();
float area_accum = 0;
Map<float, int> triangle_area_map;
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index 3a48673d8e..2e149a0f65 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -191,8 +191,8 @@ void Particles2DEditorPlugin::_generate_emission_mask() {
int vpc = 0;
{
- PoolVector<uint8_t> data = img->get_data();
- PoolVector<uint8_t>::Read r = data.read();
+ Vector<uint8_t> data = img->get_data();
+ const uint8_t *r = data.ptr();
for (int i = 0; i < s.width; i++) {
for (int j = 0; j < s.height; j++) {
@@ -270,7 +270,7 @@ void Particles2DEditorPlugin::_generate_emission_mask() {
ERR_FAIL_COND_MSG(valid_positions.size() == 0, "No pixels with transparency > 128 in image...");
- PoolVector<uint8_t> texdata;
+ Vector<uint8_t> texdata;
int w = 2048;
int h = (vpc / 2048) + 1;
@@ -278,8 +278,8 @@ void Particles2DEditorPlugin::_generate_emission_mask() {
texdata.resize(w * h * 2 * sizeof(float));
{
- PoolVector<uint8_t>::Write tw = texdata.write();
- float *twf = (float *)tw.ptr();
+ uint8_t *tw = texdata.ptrw();
+ float *twf = (float *)tw;
for (int i = 0; i < vpc; i++) {
twf[i * 2 + 0] = valid_positions[i].x;
@@ -299,11 +299,11 @@ void Particles2DEditorPlugin::_generate_emission_mask() {
if (capture_colors) {
- PoolVector<uint8_t> colordata;
+ Vector<uint8_t> colordata;
colordata.resize(w * h * 4); //use RG texture
{
- PoolVector<uint8_t>::Write tw = colordata.write();
+ uint8_t *tw = colordata.ptrw();
for (int i = 0; i < vpc * 4; i++) {
tw[i] = valid_colors[i];
@@ -321,12 +321,12 @@ void Particles2DEditorPlugin::_generate_emission_mask() {
if (valid_normals.size()) {
pm->set_emission_shape(ParticlesMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
- PoolVector<uint8_t> normdata;
+ Vector<uint8_t> normdata;
normdata.resize(w * h * 2 * sizeof(float)); //use RG texture
{
- PoolVector<uint8_t>::Write tw = normdata.write();
- float *twf = (float *)tw.ptr();
+ uint8_t *tw = normdata.ptrw();
+ float *twf = (float *)tw;
for (int i = 0; i < vpc; i++) {
twf[i * 2 + 0] = valid_normals[i].x;
twf[i * 2 + 1] = valid_normals[i].y;
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index cb29e11b9d..940874846f 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -35,7 +35,7 @@
#include "scene/3d/cpu_particles.h"
#include "scene/resources/particles_material.h"
-bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vector3> &normals) {
+bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) {
bool use_normals = emission_fill->get_selected() == 1;
@@ -93,7 +93,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect
return false;
}
- PoolVector<Face3>::Read r = geometry.read();
+ const Face3 *r = geometry.ptr();
AABB aabb;
@@ -191,7 +191,7 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) {
Transform geom_xform = base_node->get_global_transform().affine_inverse() * vi->get_global_transform();
int gc = geometry.size();
- PoolVector<Face3>::Write w = geometry.write();
+ Face3 *w = geometry.ptrw();
for (int i = 0; i < gc; i++) {
for (int j = 0; j < 3; j++) {
@@ -199,8 +199,6 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) {
}
}
- w.release();
-
emission_dialog->popup_centered(Size2(300, 130));
}
@@ -379,8 +377,8 @@ void ParticlesEditor::edit(Particles *p_particles) {
void ParticlesEditor::_generate_emission_points() {
/// hacer codigo aca
- PoolVector<Vector3> points;
- PoolVector<Vector3> normals;
+ Vector<Vector3> points;
+ Vector<Vector3> normals;
if (!_generate(points, normals)) {
return;
@@ -391,14 +389,14 @@ void ParticlesEditor::_generate_emission_points() {
int w = 2048;
int h = (point_count / 2048) + 1;
- PoolVector<uint8_t> point_img;
+ Vector<uint8_t> point_img;
point_img.resize(w * h * 3 * sizeof(float));
{
- PoolVector<uint8_t>::Write iw = point_img.write();
- zeromem(iw.ptr(), w * h * 3 * sizeof(float));
- PoolVector<Vector3>::Read r = points.read();
- float *wf = (float *)iw.ptr();
+ uint8_t *iw = point_img.ptrw();
+ zeromem(iw, w * h * 3 * sizeof(float));
+ const Vector3 *r = points.ptr();
+ float *wf = (float *)iw;
for (int i = 0; i < point_count; i++) {
wf[i * 3 + 0] = r[i].x;
wf[i * 3 + 1] = r[i].y;
@@ -420,14 +418,14 @@ void ParticlesEditor::_generate_emission_points() {
material->set_emission_point_count(point_count);
material->set_emission_point_texture(tex);
- PoolVector<uint8_t> point_img2;
+ Vector<uint8_t> point_img2;
point_img2.resize(w * h * 3 * sizeof(float));
{
- PoolVector<uint8_t>::Write iw = point_img2.write();
- zeromem(iw.ptr(), w * h * 3 * sizeof(float));
- PoolVector<Vector3>::Read r = normals.read();
- float *wf = (float *)iw.ptr();
+ uint8_t *iw = point_img2.ptrw();
+ zeromem(iw, w * h * 3 * sizeof(float));
+ const Vector3 *r = normals.ptr();
+ float *wf = (float *)iw;
for (int i = 0; i < point_count; i++) {
wf[i * 3 + 0] = r[i].x;
wf[i * 3 + 1] = r[i].y;
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index 4b20d00670..5419b7d3d5 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -53,9 +53,9 @@ protected:
SpinBox *emission_amount;
OptionButton *emission_fill;
- PoolVector<Face3> geometry;
+ Vector<Face3> geometry;
- bool _generate(PoolVector<Vector3> &points, PoolVector<Vector3> &normals);
+ bool _generate(Vector<Vector3> &points, Vector<Vector3> &normals);
virtual void _generate_emission_points() = 0;
void _node_selected(const NodePath &p_path);
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index 92f21d8428..75c9776f0f 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -229,14 +229,14 @@ void PathSpatialGizmo::redraw() {
if (c.is_null())
return;
- PoolVector<Vector3> v3a = c->tessellate();
- //PoolVector<Vector3> v3a=c->get_baked_points();
+ Vector<Vector3> v3a = c->tessellate();
+ //Vector<Vector3> v3a=c->get_baked_points();
int v3s = v3a.size();
if (v3s == 0)
return;
Vector<Vector3> v3p;
- PoolVector<Vector3>::Read r = v3a.read();
+ const Vector3 *r = v3a.ptr();
// BUG: the following won't work when v3s, avoid drawing as a temporary workaround.
for (int i = 0; i < v3s - 1; i++) {
@@ -315,7 +315,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb->get_control()))) {
//click into curve, break it down
- PoolVector<Vector3> v3a = c->tessellate();
+ Vector<Vector3> v3a = c->tessellate();
int idx = 0;
int rc = v3a.size();
int closest_seg = -1;
@@ -323,7 +323,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp
float closest_d = 1e20;
if (rc >= 2) {
- PoolVector<Vector3>::Read r = v3a.read();
+ const Vector3 *r = v3a.ptr();
if (p_camera->unproject_position(gt.xform(c->get_point_position(0))).distance_to(mbpos) < click_dist)
return false; //nope, existing
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 14e22625d9..8b0adbafa2 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -125,12 +125,12 @@ void Polygon2DEditor::_sync_bones() {
} else {
for (int i = 0; i < skeleton->get_bone_count(); i++) {
NodePath path = skeleton->get_path_to(skeleton->get_bone(i));
- PoolVector<float> weights;
+ Vector<float> weights;
int wc = node->get_polygon().size();
for (int j = 0; j < prev_bones.size(); j += 2) {
NodePath pvp = prev_bones[j];
- PoolVector<float> pv = prev_bones[j + 1];
+ Vector<float> pv = prev_bones[j + 1];
if (pvp == path && pv.size() == wc) {
weights = pv;
}
@@ -138,7 +138,7 @@ void Polygon2DEditor::_sync_bones() {
if (weights.size() == 0) { //create them
weights.resize(node->get_polygon().size());
- PoolVector<float>::Write w = weights.write();
+ float *w = weights.ptrw();
for (int j = 0; j < wc; j++) {
w[j] = 0.0;
}
@@ -293,8 +293,8 @@ void Polygon2DEditor::_menu_option(int p_option) {
return;
}
- PoolVector<Vector2> points = node->get_polygon();
- PoolVector<Vector2> uvs = node->get_uv();
+ Vector<Vector2> points = node->get_polygon();
+ Vector<Vector2> uvs = node->get_uv();
if (uvs.size() != points.size()) {
undo_redo->create_action(TTR("Create UV Map"));
undo_redo->add_do_method(node, "set_uv", points);
@@ -312,10 +312,10 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_POLYGON_TO_UV: {
- PoolVector<Vector2> points = node->get_polygon();
+ Vector<Vector2> points = node->get_polygon();
if (points.size() == 0)
break;
- PoolVector<Vector2> uvs = node->get_uv();
+ Vector<Vector2> uvs = node->get_uv();
undo_redo->create_action(TTR("Create UV Map"));
undo_redo->add_do_method(node, "set_uv", points);
undo_redo->add_undo_method(node, "set_uv", uvs);
@@ -325,8 +325,8 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_UV_TO_POLYGON: {
- PoolVector<Vector2> points = node->get_polygon();
- PoolVector<Vector2> uvs = node->get_uv();
+ Vector<Vector2> points = node->get_polygon();
+ Vector<Vector2> uvs = node->get_uv();
if (uvs.size() == 0)
break;
@@ -339,11 +339,11 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_UV_CLEAR: {
- PoolVector<Vector2> uvs = node->get_uv();
+ Vector<Vector2> uvs = node->get_uv();
if (uvs.size() == 0)
break;
undo_redo->create_action(TTR("Create UV Map"));
- undo_redo->add_do_method(node, "set_uv", PoolVector<Vector2>());
+ undo_redo->add_do_method(node, "set_uv", Vector<Vector2>());
undo_redo->add_undo_method(node, "set_uv", uvs);
undo_redo->add_do_method(uv_edit_draw, "update");
undo_redo->add_undo_method(uv_edit_draw, "update");
@@ -567,7 +567,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->add_do_method(node, "set_vertex_colors", uv_create_colors_prev);
undo_redo->add_undo_method(node, "set_vertex_colors", node->get_vertex_colors());
for (int i = 0; i < node->get_bone_count(); i++) {
- PoolVector<float> bonew = node->get_bone_weights(i);
+ Vector<float> bonew = node->get_bone_weights(i);
bonew.push_back(0);
undo_redo->add_do_method(node, "set_bone_weights", i, bonew);
undo_redo->add_undo_method(node, "set_bone_weights", i, node->get_bone_weights(i));
@@ -622,7 +622,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->add_do_method(node, "set_vertex_colors", uv_create_colors_prev);
undo_redo->add_undo_method(node, "set_vertex_colors", node->get_vertex_colors());
for (int i = 0; i < node->get_bone_count(); i++) {
- PoolVector<float> bonew = node->get_bone_weights(i);
+ Vector<float> bonew = node->get_bone_weights(i);
bonew.remove(closest);
undo_redo->add_do_method(node, "set_bone_weights", i, bonew);
undo_redo->add_undo_method(node, "set_bone_weights", i, node->get_bone_weights(i));
@@ -712,7 +712,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
int erase_index = -1;
for (int i = polygons.size() - 1; i >= 0; i--) {
- PoolVector<int> points = polygons[i];
+ Vector<int> points = polygons[i];
Vector<Vector2> polys;
polys.resize(points.size());
for (int j = 0; j < polys.size(); j++) {
@@ -832,7 +832,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} break;
case UV_MODE_EDIT_POINT: {
- PoolVector<Vector2> uv_new = points_prev;
+ Vector<Vector2> uv_new = points_prev;
uv_new.set(point_drag_index, uv_new[point_drag_index] + drag);
if (uv_edit_mode[0]->is_pressed()) { //edit uv
@@ -843,7 +843,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} break;
case UV_MODE_MOVE: {
- PoolVector<Vector2> uv_new = points_prev;
+ Vector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
uv_new.set(i, uv_new[i] + drag);
@@ -856,7 +856,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
case UV_MODE_ROTATE: {
Vector2 center;
- PoolVector<Vector2> uv_new = points_prev;
+ Vector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
center += points_prev[i];
@@ -879,7 +879,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
case UV_MODE_SCALE: {
Vector2 center;
- PoolVector<Vector2> uv_new = points_prev;
+ Vector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
center += points_prev[i];
@@ -914,7 +914,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
}
if (bone_painting) {
- PoolVector<float> painted_weights = node->get_bone_weights(bone_painting_bone);
+ Vector<float> painted_weights = node->get_bone_weights(bone_painting_bone);
{
int pc = painted_weights.size();
@@ -925,9 +925,9 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
amount = -amount;
}
- PoolVector<float>::Write w = painted_weights.write();
- PoolVector<float>::Read r = prev_weights.read();
- PoolVector<Vector2>::Read rv = points_prev.read();
+ float *w = painted_weights.ptrw();
+ const float *r = prev_weights.ptr();
+ const Vector2 *rv = points_prev.ptr();
for (int i = 0; i < pc; i++) {
if (mtx.xform(rv[i]).distance_to(bone_paint_pos) < radius) {
@@ -1024,14 +1024,14 @@ void Polygon2DEditor::_uv_draw() {
Array polygons = node->get_polygons();
- PoolVector<Vector2> uvs;
+ Vector<Vector2> uvs;
if (uv_edit_mode[0]->is_pressed()) { //edit uv
uvs = node->get_uv();
} else { //edit polygon
uvs = node->get_polygon();
}
- PoolVector<float>::Read weight_r;
+ const float *weight_r;
if (uv_edit_mode[3]->is_pressed()) {
int bone_selected = -1;
@@ -1045,7 +1045,7 @@ void Polygon2DEditor::_uv_draw() {
if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uvs.size()) {
- weight_r = node->get_bone_weights(bone_selected).read();
+ weight_r = node->get_bone_weights(bone_selected).ptr();
}
}
@@ -1094,7 +1094,7 @@ void Polygon2DEditor::_uv_draw() {
for (int i = 0; i < polygons.size(); i++) {
- PoolVector<int> points = polygons[i];
+ Vector<int> points = polygons[i];
Vector<Vector2> polypoints;
for (int j = 0; j < points.size(); j++) {
int next = (j + 1) % points.size();
@@ -1116,7 +1116,7 @@ void Polygon2DEditor::_uv_draw() {
for (int i = 0; i < uvs.size(); i++) {
- if (weight_r.ptr()) {
+ if (weight_r) {
Vector2 draw_pos = mtx.xform(uvs[i]);
float weight = weight_r[i];
uv_edit_draw->draw_rect(Rect2(draw_pos - Vector2(2, 2) * EDSCALE, Vector2(5, 5) * EDSCALE), Color(weight, weight, weight, 1.0), Math::round(EDSCALE));
diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h
index 1454a03325..2b00b50e5c 100644
--- a/editor/plugins/polygon_2d_editor_plugin.h
+++ b/editor/plugins/polygon_2d_editor_plugin.h
@@ -88,7 +88,7 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
Label *bone_paint_radius_label;
bool bone_painting;
int bone_painting_bone;
- PoolVector<float> prev_weights;
+ Vector<float> prev_weights;
Vector2 bone_paint_pos;
AcceptDialog *grid_settings;
@@ -97,10 +97,10 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
Vector2 uv_draw_ofs;
float uv_draw_zoom;
- PoolVector<Vector2> points_prev;
- PoolVector<Vector2> uv_create_uv_prev;
- PoolVector<Vector2> uv_create_poly_prev;
- PoolVector<Color> uv_create_colors_prev;
+ Vector<Vector2> points_prev;
+ Vector<Vector2> uv_create_uv_prev;
+ Vector<Vector2> uv_create_poly_prev;
+ Vector<Color> uv_create_colors_prev;
int uv_create_prev_internal_vertices;
Array uv_create_bones_prev;
Array polygons_prev;
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 76312df20a..f12be18c21 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2309,7 +2309,7 @@ void ScriptEditor::_editor_stop() {
}
}
-void ScriptEditor::_add_callback(Object *p_obj, const String &p_function, const PoolStringArray &p_args) {
+void ScriptEditor::_add_callback(Object *p_obj, const String &p_function, const PackedStringArray &p_args) {
ERR_FAIL_COND(!p_obj);
Ref<Script> script = p_obj->get_script();
@@ -3099,7 +3099,7 @@ void ScriptEditor::_start_find_in_files(bool with_replace) {
editor->make_bottom_panel_item_visible(find_in_files);
}
-void ScriptEditor::_on_find_in_files_modified_files(PoolStringArray paths) {
+void ScriptEditor::_on_find_in_files_modified_files(PackedStringArray paths) {
_test_script_times_on_disk();
_update_modified_scripts_for_external_editor();
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index 4087b7cd55..ec84bcb461 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -107,7 +107,7 @@ public:
virtual void tag_saved_version() = 0;
virtual void reload(bool p_soft) {}
virtual void get_breakpoints(List<int> *p_breakpoints) = 0;
- virtual void add_callback(const String &p_function, PoolStringArray p_args) = 0;
+ virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0;
virtual void update_settings() = 0;
virtual void set_debugger_active(bool p_active) = 0;
virtual bool can_lose_focus_on_node_selection() { return true; }
@@ -321,7 +321,7 @@ class ScriptEditor : public PanelContainer {
int edit_pass;
- void _add_callback(Object *p_obj, const String &p_function, const PoolStringArray &p_args);
+ void _add_callback(Object *p_obj, const String &p_function, const PackedStringArray &p_args);
void _res_saved_callback(const Ref<Resource> &p_res);
bool trim_trailing_whitespace_on_save;
@@ -408,7 +408,7 @@ class ScriptEditor : public PanelContainer {
void _on_replace_in_files_requested(String text);
void _on_find_in_files_result_selected(String fpath, int line_number, int begin, int end);
void _start_find_in_files(bool with_replace);
- void _on_find_in_files_modified_files(PoolStringArray paths);
+ void _on_find_in_files_modified_files(PackedStringArray paths);
static void _open_script_request(const String &p_path);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 778febaf8a..9f1e2f0353 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -306,13 +306,13 @@ void ScriptTextEditor::_set_theme_for_script() {
text_edit->add_keyword_color("RID", basetype_color);
text_edit->add_keyword_color("Dictionary", basetype_color);
text_edit->add_keyword_color("Array", basetype_color);
- text_edit->add_keyword_color("PoolByteArray", basetype_color);
- text_edit->add_keyword_color("PoolIntArray", basetype_color);
- text_edit->add_keyword_color("PoolRealArray", basetype_color);
- text_edit->add_keyword_color("PoolStringArray", basetype_color);
- text_edit->add_keyword_color("PoolVector2Array", basetype_color);
- text_edit->add_keyword_color("PoolVector3Array", basetype_color);
- text_edit->add_keyword_color("PoolColorArray", basetype_color);
+ text_edit->add_keyword_color("PackedByteArray", basetype_color);
+ text_edit->add_keyword_color("PackedIntArray", basetype_color);
+ text_edit->add_keyword_color("PackedRealArray", basetype_color);
+ text_edit->add_keyword_color("PackedStringArray", basetype_color);
+ text_edit->add_keyword_color("PackedVector2Array", basetype_color);
+ text_edit->add_keyword_color("PackedVector3Array", basetype_color);
+ text_edit->add_keyword_color("PackedColorArray", basetype_color);
//colorize engine types
List<StringName> types;
@@ -424,7 +424,7 @@ void ScriptTextEditor::_notification(int p_what) {
}
}
-void ScriptTextEditor::add_callback(const String &p_function, PoolStringArray p_args) {
+void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
String code = code_editor->get_text_edit()->get_text();
int pos = script->get_language()->find_function(p_function, code);
@@ -1212,7 +1212,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
Expression expression;
Vector<String> lines = code_editor->get_text_edit()->get_selection_text().split("\n");
- PoolStringArray results;
+ PackedStringArray results;
for (int i = 0; i < lines.size(); i++) {
String line = lines[i];
@@ -1221,17 +1221,17 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (expression.parse(line) == OK) {
Variant result = expression.execute(Array(), Variant(), false);
if (expression.get_error_text() == "") {
- results.append(whitespace + result.get_construct_string());
+ results.push_back(whitespace + result.get_construct_string());
} else {
- results.append(line);
+ results.push_back(line);
}
} else {
- results.append(line);
+ results.push_back(line);
}
}
code_editor->get_text_edit()->begin_complex_operation(); //prevents creating a two-step undo
- code_editor->get_text_edit()->insert_text_at_cursor(results.join("\n"));
+ code_editor->get_text_edit()->insert_text_at_cursor(String("\n").join(results));
code_editor->get_text_edit()->end_complex_operation();
} break;
case SEARCH_FIND: {
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index 359f0b0019..e23160d029 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -220,7 +220,7 @@ public:
virtual void reload(bool p_soft);
virtual void get_breakpoints(List<int> *p_breakpoints);
- virtual void add_callback(const String &p_function, PoolStringArray p_args);
+ virtual void add_callback(const String &p_function, PackedStringArray p_args);
virtual void update_settings();
virtual bool show_members_overview();
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index e916f6f028..88b4f011ee 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -5181,8 +5181,8 @@ void SpatialEditor::_update_gizmos_menu_theme() {
void SpatialEditor::_init_grid() {
- PoolVector<Color> grid_colors[3];
- PoolVector<Vector3> grid_points[3];
+ Vector<Color> grid_colors[3];
+ Vector<Vector3> grid_points[3];
Color primary_grid_color = EditorSettings::get_singleton()->get("editors/3d/primary_grid_color");
Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/3d/secondary_grid_color");
diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp
index 2736bbfd3a..e69440b5bb 100644
--- a/editor/plugins/sprite_editor_plugin.cpp
+++ b/editor/plugins/sprite_editor_plugin.cpp
@@ -358,13 +358,13 @@ void SpriteEditor::_convert_to_polygon_2d_node() {
for (int i = 0; i < computed_outline_lines.size(); i++)
total_point_count += computed_outline_lines[i].size();
- PoolVector2Array polygon;
+ PackedVector2Array polygon;
polygon.resize(total_point_count);
- PoolVector2Array::Write polygon_write = polygon.write();
+ Vector2 *polygon_write = polygon.ptrw();
- PoolVector2Array uvs;
+ PackedVector2Array uvs;
uvs.resize(total_point_count);
- PoolVector2Array::Write uvs_write = uvs.write();
+ Vector2 *uvs_write = uvs.ptrw();
int current_point_index = 0;
@@ -376,9 +376,9 @@ void SpriteEditor::_convert_to_polygon_2d_node() {
Vector<Vector2> outline = computed_outline_lines[i];
Vector<Vector2> uv_outline = outline_lines[i];
- PoolIntArray pia;
+ PackedIntArray pia;
pia.resize(outline.size());
- PoolIntArray::Write pia_write = pia.write();
+ int *pia_write = pia.ptrw();
for (int pi = 0; pi < outline.size(); pi++) {
polygon_write[current_point_index] = outline[pi];
@@ -442,9 +442,9 @@ void SpriteEditor::_create_light_occluder_2d_node() {
Ref<OccluderPolygon2D> polygon;
polygon.instance();
- PoolVector2Array a;
+ PackedVector2Array a;
a.resize(outline.size());
- PoolVector2Array::Write aw = a.write();
+ Vector2 *aw = a.ptrw();
for (int io = 0; io < outline.size(); io++) {
aw[io] = outline[io];
}
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 2d756af213..9e8ce7ac4a 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -245,7 +245,7 @@ void SpriteFramesEditor::_notification(int p_what) {
}
}
-void SpriteFramesEditor::_file_load_request(const PoolVector<String> &p_path, int p_at_pos) {
+void SpriteFramesEditor::_file_load_request(const Vector<String> &p_path, int p_at_pos) {
ERR_FAIL_COND(!frames->has_animation(edited_anim));
@@ -852,7 +852,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
if (String(d["type"]) == "files") {
- PoolVector<String> files = d["files"];
+ Vector<String> files = d["files"];
_file_load_request(files, at_pos);
}
diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h
index aa683605ed..1fa93b5c47 100644
--- a/editor/plugins/sprite_frames_editor_plugin.h
+++ b/editor/plugins/sprite_frames_editor_plugin.h
@@ -86,7 +86,7 @@ class SpriteFramesEditor : public HSplitContainer {
void _load_pressed();
void _load_scene_pressed();
- void _file_load_request(const PoolVector<String> &p_path, int p_at_pos = -1);
+ void _file_load_request(const Vector<String> &p_path, int p_at_pos = -1);
void _copy_pressed();
void _paste_pressed();
void _empty_pressed();
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 69f1bcfa2e..357af5ecd8 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -185,7 +185,7 @@ void TextEditor::set_edited_resource(const RES &p_res) {
code_editor->update_line_and_column();
}
-void TextEditor::add_callback(const String &p_function, PoolStringArray p_args) {
+void TextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
}
void TextEditor::set_debugger_active(bool p_active) {
diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h
index c976cd87f1..c80052e7ba 100644
--- a/editor/plugins/text_editor.h
+++ b/editor/plugins/text_editor.h
@@ -147,7 +147,7 @@ public:
virtual bool can_lose_focus_on_node_selection() { return true; }
virtual void set_debugger_active(bool p_active);
virtual void set_tooltip_request_func(String p_method, Object *p_obj);
- virtual void add_callback(const String &p_function, PoolStringArray p_args);
+ virtual void add_callback(const String &p_function, PackedStringArray p_args);
virtual Control *get_edit_menu();
virtual void clear_edit_menu();
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 425a759dac..145263a5ab 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -598,7 +598,7 @@ void TileMapEditor::_pick_tile(const Point2 &p_pos) {
CanvasItemEditor::get_singleton()->update_viewport();
}
-PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase, bool preview) {
+Vector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase, bool preview) {
int prev_id = node->get_cell(p_start.x, p_start.y);
Vector<int> ids;
@@ -607,14 +607,14 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
ids = get_selected_tiles();
if (ids.size() == 0 || ids[0] == TileMap::INVALID_CELL)
- return PoolVector<Vector2>();
+ return Vector<Vector2>();
} else if (prev_id == TileMap::INVALID_CELL) {
- return PoolVector<Vector2>();
+ return Vector<Vector2>();
}
if (ids.size() == 1 && ids[0] == prev_id) {
// Same ID, nothing to change
- return PoolVector<Vector2>();
+ return Vector<Vector2>();
}
Rect2i r = node->get_used_rect();
@@ -640,14 +640,14 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
if (invalidate_cache) {
for (int i = 0; i < area; ++i)
bucket_cache_visited[i] = false;
- bucket_cache = PoolVector<Vector2>();
+ bucket_cache = Vector<Vector2>();
bucket_cache_tile = prev_id;
bucket_cache_rect = r;
bucket_queue.clear();
}
}
- PoolVector<Vector2> points;
+ Vector<Vector2> points;
Vector<Vector2> non_preview_cache;
int count = 0;
int limit = 0;
@@ -698,10 +698,10 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
return preview ? bucket_cache : points;
}
-void TileMapEditor::_fill_points(const PoolVector<Vector2> &p_points, const Dictionary &p_op) {
+void TileMapEditor::_fill_points(const Vector<Vector2> &p_points, const Dictionary &p_op) {
int len = p_points.size();
- PoolVector<Vector2>::Read pr = p_points.read();
+ const Vector2 *pr = p_points.ptr();
Vector<int> ids = p_op["id"];
bool xf = p_op["flip_h"];
@@ -716,10 +716,10 @@ void TileMapEditor::_fill_points(const PoolVector<Vector2> &p_points, const Dict
node->update_dirty_bitmask();
}
-void TileMapEditor::_erase_points(const PoolVector<Vector2> &p_points) {
+void TileMapEditor::_erase_points(const Vector<Vector2> &p_points) {
int len = p_points.size();
- PoolVector<Vector2>::Read pr = p_points.read();
+ const Vector2 *pr = p_points.ptr();
for (int i = 0; i < len; i++) {
@@ -882,8 +882,8 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p
void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord, const Transform2D &p_xform) {
- PoolVector<Vector2> points = _bucket_fill(p_point, false, true);
- PoolVector<Vector2>::Read pr = points.read();
+ Vector<Vector2> points = _bucket_fill(p_point, false, true);
+ const Vector2 *pr = points.ptr();
int len = points.size();
for (int i = 0; i < len; ++i) {
@@ -1109,7 +1109,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
} else if (tool == TOOL_BUCKET) {
- PoolVector<Vector2> points = _bucket_fill(over_tile);
+ Vector<Vector2> points = _bucket_fill(over_tile);
if (points.size() == 0)
return false;
@@ -1216,7 +1216,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
- PoolVector<Vector2> points = _bucket_fill(over_tile, true);
+ Vector<Vector2> points = _bucket_fill(over_tile, true);
if (points.size() == 0)
return false;
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index 927f0887bb..74969d3e64 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -123,7 +123,7 @@ class TileMapEditor : public VBoxContainer {
bool *bucket_cache_visited;
Rect2i bucket_cache_rect;
int bucket_cache_tile;
- PoolVector<Vector2> bucket_cache;
+ Vector<Vector2> bucket_cache;
List<Point2i> bucket_queue;
struct CellOp {
@@ -164,10 +164,10 @@ class TileMapEditor : public VBoxContainer {
void _pick_tile(const Point2 &p_pos);
- PoolVector<Vector2> _bucket_fill(const Point2i &p_start, bool erase = false, bool preview = false);
+ Vector<Vector2> _bucket_fill(const Point2i &p_start, bool erase = false, bool preview = false);
- void _fill_points(const PoolVector<Vector2> &p_points, const Dictionary &p_op);
- void _erase_points(const PoolVector<Vector2> &p_points);
+ void _fill_points(const Vector<Vector2> &p_points, const Dictionary &p_op);
+ void _erase_points(const Vector<Vector2> &p_points);
void _select(const Point2i &p_from, const Point2i &p_to);
void _erase_selection();
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index ce865510b4..4fea504f7d 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -251,7 +251,7 @@ void TileSetEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, C
if (String(d["type"]) == "files") {
- PoolVector<String> files = d["files"];
+ Vector<String> files = d["files"];
_on_textures_added(files);
}
@@ -750,7 +750,7 @@ void TileSetEditor::_on_texture_list_selected(int p_index) {
workspace->update();
}
-void TileSetEditor::_on_textures_added(const PoolStringArray &p_paths) {
+void TileSetEditor::_on_textures_added(const PackedStringArray &p_paths) {
int invalid_count = 0;
for (int i = 0; i < p_paths.size(); i++) {
Ref<Texture2D> t = Ref<Texture2D>(ResourceLoader::load(p_paths[i]));
@@ -1618,16 +1618,14 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
if (dragging_point >= 0) {
dragging_point = -1;
- PoolVector<Vector2> polygon;
+ Vector<Vector2> polygon;
polygon.resize(current_shape.size());
- PoolVector<Vector2>::Write w = polygon.write();
+ Vector2 *w = polygon.ptrw();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
}
- w.release();
-
undo_redo->create_action(TTR("Edit Occlusion Polygon"));
undo_redo->add_do_method(edited_occlusion_shape.ptr(), "set_polygon", polygon);
undo_redo->add_undo_method(edited_occlusion_shape.ptr(), "set_polygon", edited_occlusion_shape->get_polygon());
@@ -1639,18 +1637,16 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
if (dragging_point >= 0) {
dragging_point = -1;
- PoolVector<Vector2> polygon;
+ Vector<Vector2> polygon;
Vector<int> indices;
polygon.resize(current_shape.size());
- PoolVector<Vector2>::Write w = polygon.write();
+ Vector2 *w = polygon.ptrw();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
indices.push_back(i);
}
- w.release();
-
undo_redo->create_action(TTR("Edit Navigation Polygon"));
undo_redo->add_do_method(edited_navigation_shape.ptr(), "set_vertices", polygon);
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "set_vertices", edited_navigation_shape->get_vertices());
@@ -1983,7 +1979,7 @@ void TileSetEditor::_set_edited_shape_points(const Vector<Vector2> &points) {
undo_redo->add_do_method(convex.ptr(), "set_points", points);
undo_redo->add_undo_method(convex.ptr(), "set_points", _get_edited_shape_points());
} else if (concave.is_valid()) {
- PoolVector2Array segments;
+ PackedVector2Array segments;
for (int i = 0; i < points.size() - 1; i++) {
segments.push_back(points[i]);
segments.push_back(points[i + 1]);
@@ -2782,7 +2778,7 @@ void TileSetEditor::draw_polygon_shapes() {
colors.push_back(c_bg);
}
} else {
- PoolVector<Vector2> vertices = shape->get_vertices();
+ Vector<Vector2> vertices = shape->get_vertices();
for (int j = 0; j < shape->get_polygon(0).size(); j++) {
polygon.push_back(vertices[shape->get_polygon(0)[j]] + anchor);
colors.push_back(c_bg);
@@ -2830,7 +2826,7 @@ void TileSetEditor::draw_polygon_shapes() {
colors.push_back(c_bg);
}
} else {
- PoolVector<Vector2> vertices = shape->get_vertices();
+ Vector<Vector2> vertices = shape->get_vertices();
for (int j = 0; j < shape->get_polygon(0).size(); j++) {
polygon.push_back(vertices[shape->get_polygon(0)[j]] + anchor);
colors.push_back(c_bg);
@@ -2917,15 +2913,14 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) {
} else if (edit_mode == EDITMODE_OCCLUSION) {
Ref<OccluderPolygon2D> shape = memnew(OccluderPolygon2D);
- PoolVector<Vector2> polygon;
+ Vector<Vector2> polygon;
polygon.resize(current_shape.size());
- PoolVector<Vector2>::Write w = polygon.write();
+ Vector2 *w = polygon.ptrw();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
}
- w.release();
shape->set_polygon(polygon);
undo_redo->create_action(TTR("Create Occlusion Polygon"));
@@ -2943,17 +2938,16 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) {
} else if (edit_mode == EDITMODE_NAVIGATION) {
Ref<NavigationPolygon> shape = memnew(NavigationPolygon);
- PoolVector<Vector2> polygon;
+ Vector<Vector2> polygon;
Vector<int> indices;
polygon.resize(current_shape.size());
- PoolVector<Vector2>::Write w = polygon.write();
+ Vector2 *w = polygon.ptrw();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
indices.push_back(i);
}
- w.release();
shape->set_vertices(polygon);
shape->add_polygon(indices);
@@ -2975,7 +2969,7 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) {
void TileSetEditor::select_coord(const Vector2 &coord) {
_update_tile_data();
- current_shape = PoolVector2Array();
+ current_shape = PackedVector2Array();
if (get_current_tile() == -1)
return;
Rect2 current_tile_region = tileset->tile_get_region(get_current_tile());
@@ -3006,7 +3000,7 @@ void TileSetEditor::select_coord(const Vector2 &coord) {
current_shape.resize(0);
if (edited_navigation_shape.is_valid()) {
if (edited_navigation_shape->get_polygon_count() > 0) {
- PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices();
+ Vector<Vector2> vertices = edited_navigation_shape->get_vertices();
for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) {
current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + current_tile_region.position);
}
@@ -3055,7 +3049,7 @@ void TileSetEditor::select_coord(const Vector2 &coord) {
current_shape.resize(0);
if (edited_navigation_shape.is_valid()) {
if (edited_navigation_shape->get_polygon_count() > 0) {
- PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices();
+ Vector<Vector2> vertices = edited_navigation_shape->get_vertices();
for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) {
current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + shape_anchor);
}
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index 26340824a0..7b49e2ece2 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -123,7 +123,7 @@ class TileSetEditor : public HSplitContainer {
Rect2 edited_region;
bool draw_edited_region;
Vector2 edited_shape_coord;
- PoolVector2Array current_shape;
+ PackedVector2Array current_shape;
Map<Vector2i, SubtileData> current_tile_data;
Map<Vector2, uint32_t> bitmask_map_copy;
@@ -178,7 +178,7 @@ class TileSetEditor : public HSplitContainer {
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
- void _file_load_request(const PoolVector<String> &p_path, int p_at_pos = -1);
+ void _file_load_request(const Vector<String> &p_path, int p_at_pos = -1);
protected:
static void _bind_methods();
@@ -195,7 +195,7 @@ private:
void _on_tileset_toolbar_button_pressed(int p_index);
void _on_tileset_toolbar_confirm();
void _on_texture_list_selected(int p_index);
- void _on_textures_added(const PoolStringArray &p_paths);
+ void _on_textures_added(const PackedStringArray &p_paths);
void _on_edit_mode_changed(int p_edit_mode);
void _on_workspace_mode_changed(int p_workspace_mode);
void _on_workspace_overlay_draw();
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index ecc140d7d2..6c8c1b44dc 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -2164,10 +2164,10 @@ void VisualShaderEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
saved_node_pos_dirty = true;
_add_node(idx, add_options[idx].sub_func);
} else if (d.has("files")) {
- if (d["files"].get_type() == Variant::POOL_STRING_ARRAY) {
+ if (d["files"].get_type() == Variant::PACKED_STRING_ARRAY) {
int j = 0;
- PoolStringArray arr = d["files"];
+ PackedStringArray arr = d["files"];
for (int i = 0; i < arr.size(); i++) {
String type = ResourceLoader::get_resource_type(arr[i]);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index a1032130f8..1dbd7f46d7 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2327,7 +2327,7 @@ void ProjectManager::_install_project(const String &p_zip_path, const String &p_
npdialog->show_dialog();
}
-void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
+void ProjectManager::_files_dropped(PackedStringArray p_files, int p_screen) {
Set<String> folders_set;
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < p_files.size(); i++) {
@@ -2336,9 +2336,9 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
}
memdelete(da);
if (folders_set.size() > 0) {
- PoolStringArray folders;
+ PackedStringArray folders;
for (Set<String>::Element *E = folders_set.front(); E; E = E->next()) {
- folders.append(E->get());
+ folders.push_back(E->get());
}
bool confirm = true;
@@ -2369,7 +2369,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
}
}
-void ProjectManager::_scan_multiple_folders(PoolStringArray p_files) {
+void ProjectManager::_scan_multiple_folders(PackedStringArray p_files) {
for (int i = 0; i < p_files.size(); i++) {
_scan_begin(p_files.get(i));
}
diff --git a/editor/project_manager.h b/editor/project_manager.h
index feeea9695d..8b9c769c59 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -111,8 +111,8 @@ class ProjectManager : public Control {
void _dim_window();
void _unhandled_input(const Ref<InputEvent> &p_ev);
- void _files_dropped(PoolStringArray p_files, int p_screen);
- void _scan_multiple_folders(PoolStringArray p_files);
+ void _files_dropped(PackedStringArray p_files, int p_screen);
+ void _scan_multiple_folders(PackedStringArray p_files);
void _on_order_option_changed();
void _on_filter_option_changed();
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 6635f5cb47..83593477c7 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -1188,7 +1188,7 @@ void ProjectSettingsEditor::add_translation(const String &p_translation) {
void ProjectSettingsEditor::_translation_add(const String &p_path) {
- PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
+ PackedStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
for (int i = 0; i < translations.size(); i++) {
@@ -1219,7 +1219,7 @@ void ProjectSettingsEditor::_translation_delete(Object *p_item, int p_column, in
int idx = ti->get_metadata(0);
- PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
+ PackedStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
ERR_FAIL_INDEX(idx, translations.size());
@@ -1253,7 +1253,7 @@ void ProjectSettingsEditor::_translation_res_add(const String &p_path) {
if (remaps.has(p_path))
return; //pointless already has it
- remaps[p_path] = PoolStringArray();
+ remaps[p_path] = PackedStringArray();
undo_redo->create_action(TTR("Add Remapped Path"));
undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/translation_remaps", remaps);
@@ -1281,7 +1281,7 @@ void ProjectSettingsEditor::_translation_res_option_add(const String &p_path) {
String key = k->get_metadata(0);
ERR_FAIL_COND(!remaps.has(key));
- PoolStringArray r = remaps[key];
+ PackedStringArray r = remaps[key];
r.push_back(p_path + ":" + "en");
remaps[key] = r;
@@ -1328,7 +1328,7 @@ void ProjectSettingsEditor::_translation_res_option_changed() {
ERR_FAIL_INDEX(which, langs.size());
ERR_FAIL_COND(!remaps.has(key));
- PoolStringArray r = remaps[key];
+ PackedStringArray r = remaps[key];
ERR_FAIL_INDEX(idx, r.size());
if (translation_locales_idxs_remap.size() > which) {
r.set(idx, path + ":" + langs[translation_locales_idxs_remap[which]]);
@@ -1395,7 +1395,7 @@ void ProjectSettingsEditor::_translation_res_option_delete(Object *p_item, int p
int idx = ed->get_metadata(0);
ERR_FAIL_COND(!remaps.has(key));
- PoolStringArray r = remaps[key];
+ PackedStringArray r = remaps[key];
ERR_FAIL_INDEX(idx, r.size());
r.remove(idx);
remaps[key] = r;
@@ -1506,7 +1506,7 @@ void ProjectSettingsEditor::_update_translations() {
translation_list->set_hide_root(true);
if (ProjectSettings::get_singleton()->has_setting("locale/translations")) {
- PoolStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
+ PackedStringArray translations = ProjectSettings::get_singleton()->get("locale/translations");
for (int i = 0; i < translations.size(); i++) {
TreeItem *t = translation_list->create_item(root);
@@ -1642,7 +1642,7 @@ void ProjectSettingsEditor::_update_translations() {
t->select(0);
translation_res_option_add_button->set_disabled(false);
- PoolStringArray selected = remaps[keys[i]];
+ PackedStringArray selected = remaps[keys[i]];
for (int j = 0; j < selected.size(); j++) {
String s2 = selected[j];
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index e6128f255d..cf4b83922d 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1045,22 +1045,22 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
case Variant::DICTIONARY: {
} break;
- case Variant::POOL_BYTE_ARRAY: {
+ case Variant::PACKED_BYTE_ARRAY: {
} break;
- case Variant::POOL_INT_ARRAY: {
+ case Variant::PACKED_INT_ARRAY: {
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_REAL_ARRAY: {
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
+ case Variant::PACKED_VECTOR3_ARRAY: {
} break;
- case Variant::POOL_COLOR_ARRAY: {
+ case Variant::PACKED_COLOR_ARRAY: {
} break;
default: {
@@ -1697,22 +1697,22 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::DICTIONARY: {
} break;
- case Variant::POOL_BYTE_ARRAY: {
+ case Variant::PACKED_BYTE_ARRAY: {
} break;
- case Variant::POOL_INT_ARRAY: {
+ case Variant::PACKED_INT_ARRAY: {
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_REAL_ARRAY: {
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
+ case Variant::PACKED_VECTOR3_ARRAY: {
} break;
- case Variant::POOL_COLOR_ARRAY: {
+ case Variant::PACKED_COLOR_ARRAY: {
} break;
default: {
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 1de5099c4a..8cc1448b7a 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -141,13 +141,13 @@ void PropertySelector::_update_search() {
Control::get_icon("Object", "EditorIcons"),
Control::get_icon("Dictionary", "EditorIcons"),
Control::get_icon("Array", "EditorIcons"),
- Control::get_icon("PoolByteArray", "EditorIcons"),
- Control::get_icon("PoolIntArray", "EditorIcons"),
- Control::get_icon("PoolRealArray", "EditorIcons"),
- Control::get_icon("PoolStringArray", "EditorIcons"),
- Control::get_icon("PoolVector2Array", "EditorIcons"),
- Control::get_icon("PoolVector3Array", "EditorIcons"),
- Control::get_icon("PoolColorArray", "EditorIcons")
+ Control::get_icon("PackedByteArray", "EditorIcons"),
+ Control::get_icon("PackedIntArray", "EditorIcons"),
+ Control::get_icon("PackedRealArray", "EditorIcons"),
+ Control::get_icon("PackedStringArray", "EditorIcons"),
+ Control::get_icon("PackedVector2Array", "EditorIcons"),
+ Control::get_icon("PackedVector3Array", "EditorIcons"),
+ Control::get_icon("PackedColorArray", "EditorIcons")
};
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 0e8a9146e1..ecaef4fb0f 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -1120,7 +1120,7 @@ void SceneTreeEditor::_bind_methods() {
ADD_SIGNAL(MethodInfo("node_changed"));
ADD_SIGNAL(MethodInfo("nodes_dragged"));
ADD_SIGNAL(MethodInfo("nodes_rearranged", PropertyInfo(Variant::ARRAY, "paths"), PropertyInfo(Variant::NODE_PATH, "to_path"), PropertyInfo(Variant::INT, "type")));
- ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::NODE_PATH, "to_path"), PropertyInfo(Variant::INT, "type")));
+ ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::NODE_PATH, "to_path"), PropertyInfo(Variant::INT, "type")));
ADD_SIGNAL(MethodInfo("script_dropped", PropertyInfo(Variant::STRING, "file"), PropertyInfo(Variant::NODE_PATH, "to_path")));
ADD_SIGNAL(MethodInfo("rmb_pressed", PropertyInfo(Variant::VECTOR2, "position")));
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 88d45d5dde..af740d9b4f 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -835,8 +835,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
perf_draw->update();
} else if (p_msg == "visual_profile") {
uint64_t frame = p_data[0];
- PoolVector<String> names = p_data[1];
- PoolVector<real_t> values = p_data[2];
+ Vector<String> names = p_data[1];
+ Vector<real_t> values = p_data[2];
EditorVisualProfiler::Metric metric;
metric.areas.resize(names.size());
@@ -847,8 +847,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
EditorVisualProfiler::Metric::Area *areas_ptr = metric.areas.ptrw();
int metric_count = names.size();
- PoolVector<String>::Read rs = names.read();
- PoolVector<real_t>::Read rr = values.read();
+ const String *rs = names.ptr();
+ const real_t *rr = values.ptr();
for (int i = 0; i < metric_count; i++) {
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 1163621815..12a879edb8 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -214,10 +214,10 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
a[Mesh::ARRAY_VERTEX] = p_lines;
- PoolVector<Color> color;
+ Vector<Color> color;
color.resize(p_lines.size());
{
- PoolVector<Color>::Write w = color.write();
+ Color *w = color.ptrw();
for (int i = 0; i < p_lines.size(); i++) {
if (is_selected())
w[i] = Color(1, 1, 1, 0.8) * p_modulate;
@@ -348,10 +348,10 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref
Array a;
a.resize(VS::ARRAY_MAX);
a[VS::ARRAY_VERTEX] = p_handles;
- PoolVector<Color> colors;
+ Vector<Color> colors;
{
colors.resize(p_handles.size());
- PoolVector<Color>::Write w = colors.write();
+ Color *w = colors.ptrw();
for (int i = 0; i < p_handles.size(); i++) {
Color col(1, 1, 1, 1);
@@ -410,8 +410,8 @@ void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size
cubem.set_size(p_size);
Array arrays = cubem.surface_get_arrays(0);
- PoolVector3Array vertex = arrays[VS::ARRAY_VERTEX];
- PoolVector3Array::Write w = vertex.write();
+ PackedVector3Array vertex = arrays[VS::ARRAY_VERTEX];
+ Vector3 *w = vertex.ptrw();
for (int i = 0; i < vertex.size(); ++i) {
w[i] += p_position;
@@ -1566,7 +1566,7 @@ Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() {
pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
cursor_points = Vector<Vector3>();
- PoolVector<Color> cursor_colors;
+ Vector<Color> cursor_colors;
float cs = 0.25;
cursor_points.push_back(Vector3(+cs, 0, 0));
cursor_points.push_back(Vector3(-cs, 0, 0));
@@ -3611,7 +3611,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
if (Object::cast_to<ConvexPolygonShape>(*s)) {
- PoolVector<Vector3> points = Object::cast_to<ConvexPolygonShape>(*s)->get_points();
+ Vector<Vector3> points = Object::cast_to<ConvexPolygonShape>(*s)->get_points();
if (points.size() > 3) {
@@ -3748,8 +3748,8 @@ void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
if (navmeshie.is_null())
return;
- PoolVector<Vector3> vertices = navmeshie->get_vertices();
- PoolVector<Vector3>::Read vr = vertices.read();
+ Vector<Vector3> vertices = navmeshie->get_vertices();
+ const Vector3 *vr = vertices.ptr();
List<Face3> faces;
for (int i = 0; i < navmeshie->get_polygon_count(); i++) {
Vector<int> p = navmeshie->get_polygon(i);
@@ -3768,11 +3768,11 @@ void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
return;
Map<_EdgeKey, bool> edge_map;
- PoolVector<Vector3> tmeshfaces;
+ Vector<Vector3> tmeshfaces;
tmeshfaces.resize(faces.size() * 3);
{
- PoolVector<Vector3>::Write tw = tmeshfaces.write();
+ Vector3 *tw = tmeshfaces.ptrw();
int tidx = 0;
for (List<Face3>::Element *E = faces.front(); E; E = E->next()) {