feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -31,13 +31,17 @@
#include "polygon_2d.h"
#include "core/math/geometry_2d.h"
#ifndef NAVIGATION_2D_DISABLED
#include "scene/resources/2d/navigation_mesh_source_geometry_data_2d.h"
#include "scene/resources/2d/navigation_polygon.h"
#include "servers/navigation_server_2d.h"
#endif // NAVIGATION_2D_DISABLED
#include "skeleton_2d.h"
#ifndef NAVIGATION_2D_DISABLED
Callable Polygon2D::_navmesh_source_geometry_parsing_callback;
RID Polygon2D::_navmesh_source_geometry_parser;
#endif // NAVIGATION_2D_DISABLED
#ifdef TOOLS_ENABLED
Dictionary Polygon2D::_edit_get_state() const {
@ -153,7 +157,7 @@ void Polygon2D::_notification(int p_what) {
Vector<float> weights;
int len = polygon.size();
if ((invert || polygons.size() == 0) && internal_vertices > 0) {
if ((invert || polygons.is_empty()) && internal_vertices > 0) {
//if no polygons are around, internal vertices must not be drawn, else let them be
len -= internal_vertices;
}
@ -323,7 +327,7 @@ void Polygon2D::_notification(int p_what) {
Vector<int> index_array;
if (invert || polygons.size() == 0) {
if (invert || polygons.is_empty()) {
index_array = Geometry2D::triangulate_polygon(points);
} else {
//draw individual polygons
@ -610,6 +614,7 @@ NodePath Polygon2D::get_skeleton() const {
return skeleton;
}
#ifndef NAVIGATION_2D_DISABLED
void Polygon2D::navmesh_parse_init() {
ERR_FAIL_NULL(NavigationServer2D::get_singleton());
if (!_navmesh_source_geometry_parser.is_valid()) {
@ -639,6 +644,7 @@ void Polygon2D::navmesh_parse_source_geometry(const Ref<NavigationPolygon> &p_na
p_source_geometry_data->add_obstruction_outline(shape_outline);
}
}
#endif // NAVIGATION_2D_DISABLED
void Polygon2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_polygon", "polygon"), &Polygon2D::set_polygon);