summaryrefslogtreecommitdiff
path: root/servers/visual_server.cpp
diff options
context:
space:
mode:
authorNils ANDRÉ-CHANG <nils@nilsand.re>2019-09-12 21:28:49 +0100
committerNils ANDRÉ-CHANG <nils@nilsand.re>2019-09-26 20:36:12 +0100
commit0024dd7bb5a8a5194ed0283fc506edcd8b4a7737 (patch)
tree86316cccbf4fda58a275a7451e37fda83465bb20 /servers/visual_server.cpp
parentcafb888361eba08297dd88b18dc71f4d418525c0 (diff)
parent24e1039eb6fe32115e8d1a62a84965e9be19a2ed (diff)
Merge branch 'master' into tab_key
Diffstat (limited to 'servers/visual_server.cpp')
-rw-r--r--servers/visual_server.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index c6468694fd..13fcda2402 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1118,7 +1118,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
}
offsets[i] = elem_size;
continue;
- } break;
+ }
default: {
ERR_FAIL();
}
@@ -1145,11 +1145,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
Vector<AABB> bone_aabb;
Error err = _surface_set_data(p_arrays, format, offsets, total_elem_size, vertex_array, array_len, index_array, index_array_len, aabb, bone_aabb);
-
- if (err) {
- ERR_EXPLAIN("Invalid array format for surface");
- ERR_FAIL();
- }
+ ERR_FAIL_COND_MSG(err, "Invalid array format for surface.");
Vector<PoolVector<uint8_t> > blend_shape_data;
@@ -1162,10 +1158,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
AABB laabb;
Error err2 = _surface_set_data(p_blend_shapes[i], format & ~ARRAY_FORMAT_INDEX, offsets, total_elem_size, vertex_array_shape, array_len, noindex, 0, laabb, bone_aabb);
aabb.merge_with(laabb);
- if (err2 != OK) {
- ERR_EXPLAIN("Invalid blend shape array format for surface");
- ERR_FAIL();
- }
+ ERR_FAIL_COND_MSG(err2 != OK, "Invalid blend shape array format for surface.");
blend_shape_data.push_back(vertex_array_shape);
}
@@ -1286,7 +1279,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_
}
offsets[i] = elem_size;
continue;
- } break;
+ }
default: {
ERR_FAIL_V(Array());
}