Replace error checks against size with is_empty
This commit is contained in:
parent
94dbf69f5d
commit
684752e75b
58 changed files with 116 additions and 116 deletions
|
|
@ -690,7 +690,7 @@ Array SurfaceTool::commit_to_arrays() {
|
|||
|
||||
} break;
|
||||
case Mesh::ARRAY_INDEX: {
|
||||
ERR_CONTINUE(index_array.size() == 0);
|
||||
ERR_CONTINUE(index_array.is_empty());
|
||||
|
||||
Vector<int> array;
|
||||
array.resize(index_array.size());
|
||||
|
|
@ -1280,7 +1280,7 @@ SurfaceTool::CustomFormat SurfaceTool::get_custom_format(int p_channel_index) co
|
|||
}
|
||||
void SurfaceTool::optimize_indices_for_cache() {
|
||||
ERR_FAIL_NULL(optimize_vertex_cache_func);
|
||||
ERR_FAIL_COND(index_array.size() == 0);
|
||||
ERR_FAIL_COND(index_array.is_empty());
|
||||
ERR_FAIL_COND(primitive != Mesh::PRIMITIVE_TRIANGLES);
|
||||
ERR_FAIL_COND(index_array.size() % 3 != 0);
|
||||
|
||||
|
|
@ -1290,7 +1290,7 @@ void SurfaceTool::optimize_indices_for_cache() {
|
|||
}
|
||||
|
||||
AABB SurfaceTool::get_aabb() const {
|
||||
ERR_FAIL_COND_V(vertex_array.size() == 0, AABB());
|
||||
ERR_FAIL_COND_V(vertex_array.is_empty(), AABB());
|
||||
|
||||
AABB aabb;
|
||||
for (uint32_t i = 0; i < vertex_array.size(); i++) {
|
||||
|
|
@ -1310,8 +1310,8 @@ Vector<int> SurfaceTool::generate_lod(float p_threshold, int p_target_index_coun
|
|||
|
||||
ERR_FAIL_NULL_V(simplify_func, lod);
|
||||
ERR_FAIL_COND_V(p_target_index_count < 0, lod);
|
||||
ERR_FAIL_COND_V(vertex_array.size() == 0, lod);
|
||||
ERR_FAIL_COND_V(index_array.size() == 0, lod);
|
||||
ERR_FAIL_COND_V(vertex_array.is_empty(), lod);
|
||||
ERR_FAIL_COND_V(index_array.is_empty(), lod);
|
||||
ERR_FAIL_COND_V(index_array.size() % 3 != 0, lod);
|
||||
ERR_FAIL_COND_V(index_array.size() < (unsigned int)p_target_index_count, lod);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue