diff --git a/simplify.h b/simplify.h index 347521b..b9bbf64 100644 --- a/simplify.h +++ b/simplify.h @@ -19,7 +19,6 @@ #include "core/math/vector3.h" #include "core/ustring.h" #include "scene/resources/mesh.h" -#include "servers/visual_server.h" #include //FLT_EPSILON, DBL_EPSILON #include @@ -27,6 +26,19 @@ #include #include +#include "core/version.h" + +#if VERSION_MAJOR < 4 +#include "servers/visual_server.h" +#else +#include "servers/rendering_server.h" + +typedef class RenderingServer VisualServer; +typedef class RenderingServer VS; + +#define PoolVector Vector +#endif + namespace Simplify { struct vector3 { @@ -1069,8 +1081,9 @@ public: PoolVector pindices = arrays.get(ArrayMesh::ARRAY_INDEX); - if ((pindices.size() % 3) != 0) + if ((pindices.size() % 3) != 0) { ERR_FAIL_MSG("The index array length must be a multiple of 3 in order to represent triangles."); + } //std::vector > uvMap;