You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Expose is_baking method in navigation servers and region nodes.
This commit is contained in:
@@ -157,11 +157,10 @@ void NavMeshGenerator2D::bake_from_source_geometry_data(Ref<NavigationPolygon> p
|
||||
return;
|
||||
}
|
||||
|
||||
baking_navmesh_mutex.lock();
|
||||
if (baking_navmeshes.has(p_navigation_mesh)) {
|
||||
baking_navmesh_mutex.unlock();
|
||||
if (is_baking(p_navigation_mesh)) {
|
||||
ERR_FAIL_MSG("NavigationPolygon is already baking. Wait for current bake to finish.");
|
||||
}
|
||||
baking_navmesh_mutex.lock();
|
||||
baking_navmeshes.insert(p_navigation_mesh);
|
||||
baking_navmesh_mutex.unlock();
|
||||
|
||||
@@ -193,11 +192,10 @@ void NavMeshGenerator2D::bake_from_source_geometry_data_async(Ref<NavigationPoly
|
||||
return;
|
||||
}
|
||||
|
||||
baking_navmesh_mutex.lock();
|
||||
if (baking_navmeshes.has(p_navigation_mesh)) {
|
||||
baking_navmesh_mutex.unlock();
|
||||
if (is_baking(p_navigation_mesh)) {
|
||||
ERR_FAIL_MSG("NavigationPolygon is already baking. Wait for current bake to finish.");
|
||||
}
|
||||
baking_navmesh_mutex.lock();
|
||||
baking_navmeshes.insert(p_navigation_mesh);
|
||||
baking_navmesh_mutex.unlock();
|
||||
|
||||
@@ -212,6 +210,13 @@ void NavMeshGenerator2D::bake_from_source_geometry_data_async(Ref<NavigationPoly
|
||||
generator_task_mutex.unlock();
|
||||
}
|
||||
|
||||
bool NavMeshGenerator2D::is_baking(Ref<NavigationPolygon> p_navigation_polygon) {
|
||||
baking_navmesh_mutex.lock();
|
||||
bool baking = baking_navmeshes.has(p_navigation_polygon);
|
||||
baking_navmesh_mutex.unlock();
|
||||
return baking;
|
||||
}
|
||||
|
||||
void NavMeshGenerator2D::generator_thread_bake(void *p_arg) {
|
||||
NavMeshGeneratorTask2D *generator_task = static_cast<NavMeshGeneratorTask2D *>(p_arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user