mirror of
https://github.com/Relintai/voxelman.git
synced 2025-04-13 21:00:47 +02:00
Removed the temp mesh array I just added from voxel chunk.
This commit is contained in:
parent
656f0ba9fa
commit
370e14f6c8
@ -780,18 +780,15 @@ void VoxelChunk::_build_phase(int phase) {
|
|||||||
|
|
||||||
ERR_FAIL_COND(!mesher.is_valid());
|
ERR_FAIL_COND(!mesher.is_valid());
|
||||||
|
|
||||||
temp_mesh_arr = mesher->build_mesh();
|
if (mesher->get_vertex_count() == 0) {
|
||||||
|
next_phase();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_mesh_rid != RID())
|
if (_mesh_rid != RID())
|
||||||
VS::get_singleton()->mesh_clear(_mesh_rid);
|
VS::get_singleton()->mesh_clear(_mesh_rid);
|
||||||
|
|
||||||
PoolVector3Array v = temp_mesh_arr[VisualServer::ARRAY_VERTEX];
|
Array temp_mesh_arr = mesher->build_mesh();
|
||||||
|
|
||||||
if (temp_mesh_arr.size() == 0 || v.size() == 0) {
|
|
||||||
temp_mesh_arr.clear();
|
|
||||||
next_phase();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_mesh_rid == RID()) {
|
if (_mesh_rid == RID()) {
|
||||||
allocate_main_mesh();
|
allocate_main_mesh();
|
||||||
@ -802,8 +799,6 @@ void VoxelChunk::_build_phase(int phase) {
|
|||||||
if (_library->get_material().is_valid())
|
if (_library->get_material().is_valid())
|
||||||
VS::get_singleton()->mesh_surface_set_material(_mesh_rid, 0, _library->get_material()->get_rid());
|
VS::get_singleton()->mesh_surface_set_material(_mesh_rid, 0, _library->get_material()->get_rid());
|
||||||
|
|
||||||
temp_mesh_arr.clear();
|
|
||||||
|
|
||||||
next_phase();
|
next_phase();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -393,7 +393,6 @@ protected:
|
|||||||
Mutex *_build_phase_done_mutex;
|
Mutex *_build_phase_done_mutex;
|
||||||
bool _build_phase_done;
|
bool _build_phase_done;
|
||||||
Thread *_build_thread;
|
Thread *_build_thread;
|
||||||
Array temp_mesh_arr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(VoxelChunk::DefaultChannels);
|
VARIANT_ENUM_CAST(VoxelChunk::DefaultChannels);
|
||||||
|
Loading…
Reference in New Issue
Block a user