diff --git a/SCsub b/SCsub index 54a4863..1646880 100644 --- a/SCsub +++ b/SCsub @@ -3,6 +3,8 @@ Import('env') env.add_source_files(env.modules_sources,"register_types.cpp") env.add_source_files(env.modules_sources,"vector3i.cpp") env.add_source_files(env.modules_sources,"polypartition.cpp") +env.add_source_files(env.modules_sources,"geometry_2d.cpp") +env.add_source_files(env.modules_sources,"array_lt_op.cpp") env.add_source_files(env.modules_sources,"rtile_set.cpp") #if env["tools"]: diff --git a/array_lt_op.cpp b/array_lt_op.cpp new file mode 100644 index 0000000..482e740 --- /dev/null +++ b/array_lt_op.cpp @@ -0,0 +1,20 @@ + +#include "array_lt_op.h" + +bool operator<(const Array &p_array_a, const Array &p_array_b) { + int a_len = p_array_a.size(); + int b_len = p_array_b.size(); + + int min_cmp = MIN(a_len, b_len); + + for (int i = 0; i < min_cmp; i++) { + if (p_array_a.operator[](i) < p_array_b[i]) { + return true; + } else if (p_array_b[i] < p_array_a.operator[](i)) { + return false; + } + } + + return a_len < b_len; +} + diff --git a/array_lt_op.h b/array_lt_op.h index 3399e18..f1cc6b0 100644 --- a/array_lt_op.h +++ b/array_lt_op.h @@ -6,22 +6,6 @@ #include "core/math/math_defs.h" #include "core/variant.h" -bool operator<(const Array &p_array_a, const Array &p_array_b) { - int a_len = p_array_a.size(); - int b_len = p_array_b.size(); - - int min_cmp = MIN(a_len, b_len); - - for (int i = 0; i < min_cmp; i++) { - if (p_array_a.operator[](i) < p_array_b[i]) { - return true; - } else if (p_array_b[i] < p_array_a.operator[](i)) { - return false; - } - } - - return a_len < b_len; -} - +bool operator<(const Array &p_array_a, const Array &p_array_b); #endif diff --git a/geometry_2d.cpp b/geometry_2d.cpp index 4eb6c86..772bbf1 100644 --- a/geometry_2d.cpp +++ b/geometry_2d.cpp @@ -31,9 +31,9 @@ #include "geometry_2d.h" #include "thirdparty/misc/clipper.hpp" -#include "thirdparty/misc/polypartition.h" +#include "polypartition.h" #define STB_RECT_PACK_IMPLEMENTATION -#include "stb_rect_pack.h" +#include "thirdparty/stb_rect_pack/stb_rect_pack.h" #define SCALE_FACTOR 100000.0 // Based on CMP_EPSILON. diff --git a/register_types.cpp b/register_types.cpp index b9bbaf0..37d5022 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -22,6 +22,8 @@ SOFTWARE. #include "register_types.h" +#include "rtile_set.h" + #ifdef TOOLS_ENABLED #endif @@ -29,6 +31,13 @@ void register_rtile_map_types() { #ifdef TOOLS_ENABLED // EditorPlugins::add_by_type(); #endif + + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_virtual_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); } void unregister_rtile_map_types() { diff --git a/rtile_set.h b/rtile_set.h index 6c841da..1c5401f 100644 --- a/rtile_set.h +++ b/rtile_set.h @@ -31,7 +31,6 @@ #ifndef RTILE_SET_H #define RTILE_SET_H -#include "array_lt_op.h" #include "core/resource.h" #include "core/object.h" #include "core/vector.h" @@ -53,6 +52,8 @@ #include "scene/resources/texture.h" #endif +#include "array_lt_op.h" + class RTileMap; struct RTileMapQuadrant; class RTileSetSource;