summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/bit_map.cpp2
-rw-r--r--scene/resources/curve.cpp4
-rw-r--r--scene/resources/font.cpp4
-rw-r--r--scene/resources/gradient.h2
-rw-r--r--scene/resources/mesh.cpp6
-rw-r--r--scene/resources/mesh_data_tool.cpp2
-rw-r--r--scene/resources/packed_scene.cpp6
-rw-r--r--scene/resources/shape_3d.cpp2
-rw-r--r--scene/resources/syntax_highlighter.cpp2
-rw-r--r--scene/resources/text_line.cpp2
-rw-r--r--scene/resources/text_paragraph.cpp4
-rw-r--r--scene/resources/texture.cpp12
-rw-r--r--scene/resources/visual_shader.cpp4
-rw-r--r--scene/resources/world_2d.cpp10
-rw-r--r--scene/resources/world_3d.cpp8
15 files changed, 35 insertions, 35 deletions
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp
index d07447179d..f4764bef2d 100644
--- a/scene/resources/bit_map.cpp
+++ b/scene/resources/bit_map.cpp
@@ -43,7 +43,7 @@ void BitMap::create(const Size2 &p_size) {
}
void BitMap::create_from_image_alpha(const Ref<Image> &p_image, float p_threshold) {
- ERR_FAIL_COND(p_image.is_null() || p_image->empty());
+ ERR_FAIL_COND(p_image.is_null() || p_image->is_empty());
Ref<Image> img = p_image->duplicate();
img->convert(Image::FORMAT_LA8);
ERR_FAIL_COND(img->get_format() != Image::FORMAT_LA8);
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index de076670cf..e97f3f8825 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -602,7 +602,7 @@ void Curve2D::remove_point(int p_index) {
}
void Curve2D::clear_points() {
- if (!points.empty()) {
+ if (!points.is_empty()) {
points.clear();
baked_cache_dirty = true;
emit_signal(CoreStringNames::get_singleton()->changed);
@@ -1087,7 +1087,7 @@ void Curve3D::remove_point(int p_index) {
}
void Curve3D::clear_points() {
- if (!points.empty()) {
+ if (!points.is_empty()) {
points.clear();
baked_cache_dirty = true;
emit_signal(CoreStringNames::get_singleton()->changed);
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 791f260c0e..667d4af76d 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -724,7 +724,7 @@ void Font::set_spacing(int p_type, int p_value) {
// Drawing string and string sizes, cached.
Size2 Font::get_string_size(const String &p_text, int p_size) const {
- ERR_FAIL_COND_V(data.empty(), Size2());
+ ERR_FAIL_COND_V(data.is_empty(), Size2());
uint64_t hash = p_text.hash64();
hash = hash_djb2_one_64(p_size, hash);
@@ -746,7 +746,7 @@ Size2 Font::get_string_size(const String &p_text, int p_size) const {
}
Size2 Font::get_multiline_string_size(const String &p_text, float p_width, int p_size, uint8_t p_flags) const {
- ERR_FAIL_COND_V(data.empty(), Size2());
+ ERR_FAIL_COND_V(data.is_empty(), Size2());
uint64_t hash = p_text.hash64();
hash = hash_djb2_one_64(p_size, hash);
diff --git a/scene/resources/gradient.h b/scene/resources/gradient.h
index e839909770..0e8f114383 100644
--- a/scene/resources/gradient.h
+++ b/scene/resources/gradient.h
@@ -82,7 +82,7 @@ public:
Vector<Color> get_colors() const;
_FORCE_INLINE_ Color get_color_at_offset(float p_offset) {
- if (points.empty()) {
+ if (points.is_empty()) {
return Color(0, 0, 0, 1);
}
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index f1c05b8014..8d101aa8d3 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -74,7 +74,7 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
}
Array a = surface_get_arrays(i);
- ERR_FAIL_COND_V(a.empty(), Ref<TriangleMesh>());
+ ERR_FAIL_COND_V(a.is_empty(), Ref<TriangleMesh>());
int vc = surface_get_array_len(i);
Vector<Vector3> vertices = a[ARRAY_VERTEX];
@@ -226,7 +226,7 @@ Ref<Shape3D> Mesh::create_convex_shape() const {
for (int i = 0; i < get_surface_count(); i++) {
Array a = surface_get_arrays(i);
- ERR_FAIL_COND_V(a.empty(), Ref<ConvexPolygonShape3D>());
+ ERR_FAIL_COND_V(a.is_empty(), Ref<ConvexPolygonShape3D>());
Vector<Vector3> v = a[ARRAY_VERTEX];
vertices.append_array(v);
}
@@ -266,7 +266,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
}
Array a = surface_get_arrays(i);
- ERR_FAIL_COND_V(a.empty(), Ref<ArrayMesh>());
+ ERR_FAIL_COND_V(a.is_empty(), Ref<ArrayMesh>());
if (i == 0) {
arrays = a;
diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp
index a5c360f123..a24cc800df 100644
--- a/scene/resources/mesh_data_tool.cpp
+++ b/scene/resources/mesh_data_tool.cpp
@@ -43,7 +43,7 @@ Error MeshDataTool::create_from_surface(const Ref<ArrayMesh> &p_mesh, int p_surf
ERR_FAIL_COND_V(p_mesh->surface_get_primitive_type(p_surface) != Mesh::PRIMITIVE_TRIANGLES, ERR_INVALID_PARAMETER);
Array arrays = p_mesh->surface_get_arrays(p_surface);
- ERR_FAIL_COND_V(arrays.empty(), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(arrays.is_empty(), ERR_INVALID_PARAMETER);
Vector<Vector3> varray = arrays[Mesh::ARRAY_VERTEX];
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 09674f3465..a89858f02a 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -80,7 +80,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const {
Node **ret_nodes = (Node **)alloca(sizeof(Node *) * nc);
- bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.empty();
+ bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.is_empty();
Map<Ref<Resource>, Ref<Resource>> resources_local_to_scene;
@@ -603,7 +603,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
// Save the right type. If this node was created by an instance
// then flag that the node should not be created but reused
- if (pack_state_stack.empty()) {
+ if (pack_state_stack.is_empty()) {
//this node is not part of an instancing process, so save the type
nd.type = _nm_get_string(p_node->get_class(), name_map);
} else {
@@ -1349,7 +1349,7 @@ NodePath SceneState::get_node_path(int p_idx, bool p_for_parent) const {
sub_path.insert(0, base_path.get_name(i));
}
- if (sub_path.empty()) {
+ if (sub_path.is_empty()) {
return NodePath(".");
}
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp
index 59766f4f1f..115d7f74cc 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/shape_3d.cpp
@@ -66,7 +66,7 @@ Ref<ArrayMesh> Shape3D::get_debug_mesh() {
debug_mesh_cache = Ref<ArrayMesh>(memnew(ArrayMesh));
- if (!lines.empty()) {
+ if (!lines.is_empty()) {
//make mesh
Vector<Vector3> array;
array.resize(lines.size());
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp
index e3e4373fa9..96c7f23981 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -552,7 +552,7 @@ Dictionary CodeHighlighter::get_color_regions() const {
Dictionary r_color_regions;
for (int i = 0; i < color_regions.size(); i++) {
ColorRegion region = color_regions[i];
- r_color_regions[region.start_key + (region.end_key.empty() ? "" : " " + region.end_key)] = region.color;
+ r_color_regions[region.start_key + (region.end_key.is_empty() ? "" : " " + region.end_key)] = region.color;
}
return r_color_regions;
}
diff --git a/scene/resources/text_line.cpp b/scene/resources/text_line.cpp
index cc9b6758b6..a32d443c6a 100644
--- a/scene/resources/text_line.cpp
+++ b/scene/resources/text_line.cpp
@@ -97,7 +97,7 @@ void TextLine::_bind_methods() {
void TextLine::_shape() {
if (dirty) {
- if (!tab_stops.empty()) {
+ if (!tab_stops.is_empty()) {
TS->shaped_text_tab_align(rid, tab_stops);
}
if (align == HALIGN_FILL) {
diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp
index fd6dd071eb..2624cc8b0b 100644
--- a/scene/resources/text_paragraph.cpp
+++ b/scene/resources/text_paragraph.cpp
@@ -110,14 +110,14 @@ void TextParagraph::_shape_lines() {
}
lines.clear();
- if (!tab_stops.empty()) {
+ if (!tab_stops.is_empty()) {
TS->shaped_text_tab_align(rid, tab_stops);
}
Vector<Vector2i> line_breaks = TS->shaped_text_get_line_breaks(rid, width, 0, flags);
for (int i = 0; i < line_breaks.size(); i++) {
RID line = TS->shaped_text_substr(rid, line_breaks[i].x, line_breaks[i].y - line_breaks[i].x);
- if (!tab_stops.empty()) {
+ if (!tab_stops.is_empty()) {
TS->shaped_text_tab_align(line, tab_stops);
}
if (align == HALIGN_FILL && (line_breaks.size() == 1 || i < line_breaks.size() - 1)) {
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 706b18d2b5..730b53b29c 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -371,8 +371,8 @@ Ref<Image> StreamTexture2D::load_image_from_file(FileAccess *f, int p_size_limit
img = Image::lossy_unpacker(pv);
}
- if (img.is_null() || img->empty()) {
- ERR_FAIL_COND_V(img.is_null() || img->empty(), Ref<Image>());
+ if (img.is_null() || img->is_empty()) {
+ ERR_FAIL_COND_V(img.is_null() || img->is_empty(), Ref<Image>());
}
if (first) {
@@ -548,7 +548,7 @@ Error StreamTexture2D::_load_data(const String &p_path, int &tw, int &th, int &t
memdelete(f);
- if (image.is_null() || image->empty()) {
+ if (image.is_null() || image->is_empty()) {
return ERR_CANT_OPEN;
}
@@ -924,7 +924,7 @@ Error StreamTexture3D::_load_data(const String &p_path, Vector<Ref<Image>> &r_da
for (int i = 0; i < (r_depth + mipmaps); i++) {
Ref<Image> image = StreamTexture2D::load_image_from_file(f, 0);
- ERR_FAIL_COND_V(image.is_null() || image->empty(), ERR_CANT_OPEN);
+ ERR_FAIL_COND_V(image.is_null() || image->is_empty(), ERR_CANT_OPEN);
if (i == 0) {
r_format = image->get_format();
r_width = image->get_width();
@@ -2223,7 +2223,7 @@ Error ImageTextureLayered::create_from_images(Vector<Ref<Image>> p_images) {
"Cubemap array layers must be a multiple of 6");
}
- ERR_FAIL_COND_V(p_images[0].is_null() || p_images[0]->empty(), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_images[0].is_null() || p_images[0]->is_empty(), ERR_INVALID_PARAMETER);
Image::Format new_format = p_images[0]->get_format();
int new_width = p_images[0]->get_width();
@@ -2361,7 +2361,7 @@ Error StreamTextureLayered::_load_data(const String &p_path, Vector<Ref<Image>>
for (uint32_t i = 0; i < layer_count; i++) {
Ref<Image> image = StreamTexture2D::load_image_from_file(f, p_size_limit);
- ERR_FAIL_COND_V(image.is_null() || image->empty(), ERR_CANT_OPEN);
+ ERR_FAIL_COND_V(image.is_null() || image->is_empty(), ERR_CANT_OPEN);
images.write[i] = image;
}
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 34129e35da..50f456bc59 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -3124,7 +3124,7 @@ String VisualShaderNodeExpression::generate_code(Shader::Mode p_mode, VisualShad
_expression = _expression.replace("\n", "\n\t\t");
static Vector<String> pre_symbols;
- if (pre_symbols.empty()) {
+ if (pre_symbols.is_empty()) {
pre_symbols.push_back("\t");
pre_symbols.push_back(",");
pre_symbols.push_back(";");
@@ -3144,7 +3144,7 @@ String VisualShaderNodeExpression::generate_code(Shader::Mode p_mode, VisualShad
}
static Vector<String> post_symbols;
- if (post_symbols.empty()) {
+ if (post_symbols.is_empty()) {
post_symbols.push_back("\t");
post_symbols.push_back("\n");
post_symbols.push_back(",");
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index 41d3fe20be..7aad3a2e05 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -111,7 +111,7 @@ struct SpatialIndexer2D {
ERR_CONTINUE(!E);
if (E->get().notifiers[p_notifier].dec() == 0) {
E->get().notifiers.erase(p_notifier);
- if (E->get().notifiers.empty()) {
+ if (E->get().notifiers.is_empty()) {
cells.erase(E);
}
}
@@ -156,7 +156,7 @@ struct SpatialIndexer2D {
}
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
p_notifier->_exit_viewport(removed.front()->get());
removed.pop_front();
}
@@ -189,7 +189,7 @@ struct SpatialIndexer2D {
removed.push_back(E->key());
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
removed.front()->get()->_exit_viewport(p_viewport);
removed.pop_front();
}
@@ -271,12 +271,12 @@ struct SpatialIndexer2D {
}
}
- while (!added.empty()) {
+ while (!added.is_empty()) {
added.front()->get()->_enter_viewport(E->key());
added.pop_front();
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
E->get().notifiers.erase(removed.front()->get());
removed.front()->get()->_exit_viewport(E->key());
removed.pop_front();
diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp
index b8fb3825ce..1503152b5e 100644
--- a/scene/resources/world_3d.cpp
+++ b/scene/resources/world_3d.cpp
@@ -97,7 +97,7 @@ struct SpatialIndexer {
}
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
p_notifier->_exit_camera(removed.front()->get());
removed.pop_front();
}
@@ -125,7 +125,7 @@ struct SpatialIndexer {
removed.push_back(E->key());
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
removed.front()->get()->_exit_camera(p_camera);
removed.pop_front();
}
@@ -175,12 +175,12 @@ struct SpatialIndexer {
}
}
- while (!added.empty()) {
+ while (!added.is_empty()) {
added.front()->get()->_enter_camera(E->key());
added.pop_front();
}
- while (!removed.empty()) {
+ while (!removed.is_empty()) {
E->get().notifiers.erase(removed.front()->get());
removed.front()->get()->_exit_camera(E->key());
removed.pop_front();