mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-18 15:27:17 +01:00
Clear surfaces in ImmediateMesh before adding a new one.
This commit is contained in:
parent
4db7bba945
commit
15a5bea727
@ -256,6 +256,12 @@ void ImmediateMesh::surface_end() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sc = VisualServer::get_singleton()->mesh_get_surface_count(mesh);
|
||||||
|
|
||||||
|
for (int i = 0; i < sc; ++i) {
|
||||||
|
VisualServer::get_singleton()->mesh_remove_surface(mesh, 0);
|
||||||
|
}
|
||||||
|
|
||||||
VisualServer::get_singleton()->mesh_add_surface(mesh, format, static_cast<VS::PrimitiveType>(active_surface_data.primitive), surface_array_create_cache, vertices.size(), PoolByteArray(), 0, aabb);
|
VisualServer::get_singleton()->mesh_add_surface(mesh, format, static_cast<VS::PrimitiveType>(active_surface_data.primitive), surface_array_create_cache, vertices.size(), PoolByteArray(), 0, aabb);
|
||||||
|
|
||||||
if (active_surface_data.material.is_valid()) {
|
if (active_surface_data.material.is_valid()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user