feat: added slope handle
This commit is contained in:
parent
07f193a04b
commit
b34362c7ae
10 changed files with 80 additions and 40 deletions
|
|
@ -31,19 +31,25 @@ void TerrainMeshGenerator::enter_tree() {
|
|||
}
|
||||
|
||||
void TerrainMeshGenerator::process() {
|
||||
if (this->input_lock.try_lock()) {
|
||||
set_process(!this->input_queue.is_empty());
|
||||
this->input_lock.unlock();
|
||||
}
|
||||
if (this->output_lock.try_lock()) {
|
||||
for (TerrainMeshTask &task : this->output_queue) {
|
||||
task.mesh->clear_surfaces();
|
||||
task.out_surface->commit(task.mesh);
|
||||
for (TerrainMeshTask &queued : this->input_queue) {
|
||||
if (queued.mesh == task.mesh) {
|
||||
goto exit_outer;
|
||||
}
|
||||
}
|
||||
task.callback.call();
|
||||
}
|
||||
exit_outer:
|
||||
this->output_queue.clear();
|
||||
this->output_lock.unlock();
|
||||
}
|
||||
if (this->input_lock.try_lock()) {
|
||||
set_process(!this->input_queue.is_empty());
|
||||
this->input_lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
void TerrainMeshGenerator::on_configuration_changed() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue