Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navigation] Add some missing compile checks #88679

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/navigation/godot_navigation_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,11 @@ void GodotNavigationServer::bake_from_source_geometry_data_async(const Ref<Navig
}

bool GodotNavigationServer::is_baking_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh) const {
#ifdef _3D_DISABLED
return false;
#else
return NavMeshGenerator3D::get_singleton()->is_baking(p_navigation_mesh);
#endif // _3D_DISABLED
}

COMMAND_1(free, RID, p_object) {
Expand Down
4 changes: 4 additions & 0 deletions modules/navigation/godot_navigation_server_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ void GodotNavigationServer2D::bake_from_source_geometry_data_async(const Ref<Nav
}

bool GodotNavigationServer2D::is_baking_navigation_polygon(Ref<NavigationPolygon> p_navigation_polygon) const {
#ifdef CLIPPER2_ENABLED
return NavMeshGenerator2D::get_singleton()->is_baking(p_navigation_polygon);
#else
return false;
#endif
}

GodotNavigationServer2D::GodotNavigationServer2D() {}
Expand Down
4 changes: 4 additions & 0 deletions modules/navigation/nav_mesh_generator_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#ifdef CLIPPER2_ENABLED

#include "nav_mesh_generator_2d.h"

#include "core/config/project_settings.h"
Expand Down Expand Up @@ -902,3 +904,5 @@ void NavMeshGenerator2D::generator_bake_from_source_geometry_data(Ref<Navigation
p_navigation_mesh->add_polygon(new_polygons[i]);
}
}

#endif // CLIPPER2_ENABLED
4 changes: 4 additions & 0 deletions modules/navigation/nav_mesh_generator_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#ifndef NAV_MESH_GENERATOR_2D_H
#define NAV_MESH_GENERATOR_2D_H

#ifdef CLIPPER2_ENABLED

#include "core/object/class_db.h"
#include "core/object/worker_thread_pool.h"

Expand Down Expand Up @@ -98,4 +100,6 @@ class NavMeshGenerator2D : public Object {
~NavMeshGenerator2D();
};

#endif // CLIPPER2_ENABLED

#endif // NAV_MESH_GENERATOR_2D_H
Loading