Cleaned up the props module aswell.

This commit is contained in:
Relintai 2022-03-18 03:22:03 +01:00
parent dc34206f3a
commit d3f5ed6511
38 changed files with 28 additions and 396 deletions

View File

@ -52,7 +52,6 @@ GroundClutter::~GroundClutter() {
}
void GroundClutter::_bind_methods() {
#ifdef TEXTURE_PACKER_PRESENT
BIND_VMETHOD(MethodInfo("_add_textures_to", PropertyInfo(Variant::OBJECT, "packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker")));

View File

@ -22,16 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/io/resource.h"
#else
#include "core/resource.h"
#endif
#ifdef TEXTURE_PACKER_PRESENT
#include "../../texture_packer/texture_packer.h"

View File

@ -22,16 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/templates/vector.h"
#else
#include "core/vector.h"
#endif
#include "ground_clutter.h"
@ -53,7 +46,7 @@ private:
static void _bind_methods();
private:
Vector<Ref<Texture> > _textures;
Vector<Ref<Texture>> _textures;
};
#endif

View File

@ -26,21 +26,11 @@ SOFTWARE.
#include "../singleton/prop_utils.h"
#include "core/os/keyboard.h"
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "core/os/input.h"
#define CONNECT(sig, obj, target_method_class, method) connect(sig, obj, #method)
#define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, obj, #method)
#else
#include "core/input/input.h"
#define CONNECT(sig, obj, target_method_class, method) connect(sig, callable_mp(obj, &target_method_class::method))
#define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, callable_mp(obj, &target_method_class::method))
#endif
void PropEditorPlugin::convert_active_scene_to_prop_data() {
SceneTree *st = SceneTree::get_singleton();
@ -109,14 +99,9 @@ void PropEditorPlugin::_convert_selected_scene_to_prop_data(Variant param) {
PropEditorPlugin::PropEditorPlugin(EditorNode *p_node) {
editor = p_node;
#if VERSION_MAJOR < 4
editor->add_tool_menu_item("Convert active scene to PropData", this, "convert_active_scene_to_prop_data");
editor->add_tool_menu_item("Convert selected scene(s) to PropData", this, "convert_selected_scene_to_prop_data");
#if VERSION_MINOR >= 4
editor->add_tool_menu_item("(Prop) Find room points.", this, "find_room_points");
#endif
#else
#endif
HBoxContainer *container = memnew(HBoxContainer);

View File

@ -22,16 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "core/version.h"
class PropEditorPlugin : public EditorPlugin {
GDCLASS(PropEditorPlugin, EditorPlugin);
EditorNode *editor;

View File

@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/io/reference.h"
#else
#include "core/reference.h"
#endif
#ifdef MESH_UTILS_PRESENT
#include "../../mesh_utils/fast_quadratic_mesh_simplifier.h"
@ -63,19 +54,19 @@ public:
int get_lod_index() const;
void set_lod_index(const int value);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> get_fqms();
void set_fqms(const Ref<FastQuadraticMeshSimplifier> &val);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> get_fqms();
void set_fqms(const Ref<FastQuadraticMeshSimplifier> &val);
float get_simplification_step_ratio() const;
void set_simplification_step_ratio(const float value);
float get_simplification_step_ratio() const;
void set_simplification_step_ratio(const float value);
int get_simplification_steps() const;
void set_simplification_steps(const int value);
int get_simplification_steps() const;
void set_simplification_steps(const int value);
float get_simplification_agressiveness() const;
void set_simplification_agressiveness(const float value);
#endif
float get_simplification_agressiveness() const;
void set_simplification_agressiveness(const float value);
#endif
PropMesherJobStep();
~PropMesherJobStep();
@ -86,12 +77,12 @@ protected:
PropMesherJobStepType _job_type;
int _lod_index;
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> _fqms;
float _simplification_step_ratio;
int _simplification_steps;
float _simplification_agressiveness;
#endif
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> _fqms;
float _simplification_step_ratio;
int _simplification_steps;
float _simplification_agressiveness;
#endif
};
VARIANT_ENUM_CAST(PropMesherJobStep::PropMesherJobStepType);

View File

@ -22,23 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "scene/resources/texture.h"
#if THREAD_POOL_PRESENT
#include "../../thread_pool/thread_pool_job.h"
#endif
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/reference.h"
#define Texture Texture2D
#else
#include "core/reference.h"
#endif
#if TEXTURE_PACKER_PRESENT
class TexturePacker;

View File

@ -25,7 +25,7 @@ SOFTWARE.
Vector3 PropLight::get_position() {
return _position;
}
void PropLight::set_position(const Vector3 &pos) {
void PropLight::set_position(const Vector3 &pos) {
_position = pos;
}

View File

@ -22,20 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/reference.h"
#include "core/templates/vector.h"
#include "core/math/color.h"
#else
#include "core/color.h"
#include "core/reference.h"
#include "core/vector.h"
#include "core/color.h"
#endif
class PropLight : public Reference {
GDCLASS(PropLight, Reference);

View File

@ -34,17 +34,6 @@ SOFTWARE.
#undef PROPS_PRESENT
#endif
#if VERSION_MAJOR > 3
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
r.push_back(arr[i]); \
} \
return r;
#else
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
@ -52,8 +41,6 @@ SOFTWARE.
} \
return r;
#endif
bool PropMaterialCache::get_initialized() {
return _initialized;
}

View File

@ -22,24 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/io/resource.h"
#include "core/math/color.h"
#include "core/templates/vector.h"
#else
#include "core/color.h"
#include "core/resource.h"
#include "core/vector.h"
#endif
#include "core/math/rect2.h"
#include "scene/resources/material.h"
#include "core/os/mutex.h"
#include "scene/resources/material.h"
class PropData;

View File

@ -22,22 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "prop_material_cache.h"
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/io/resource.h"
#include "core/math/color.h"
#include "core/templates/vector.h"
#else
#include "core/color.h"
#include "core/resource.h"
#include "core/vector.h"
#endif
#include "core/math/rect2.h"
#include "scene/resources/material.h"

View File

@ -22,18 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "scene/3d/spatial.h"
#else
#include "scene/3d/node_3d.h"
#define Spatial Node3D
#endif
#include "core/math/vector3.h"

View File

@ -2,15 +2,7 @@
#include "../mesh_data_resource/nodes/mesh_data_instance.h"
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "scene/3d/light.h"
#else
#include "scene/3d/light_3d.h"
#define OmniLight OmniLight3D
#define Light Light3D
#endif
#if MESH_DATA_RESOURCE_PRESENT
//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling,

View File

@ -22,18 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "scene/3d/spatial.h"
#else
#include "scene/3d/node_3d.h"
#define Spatial Node3D
#endif
#include "scene/resources/material.h"

View File

@ -22,26 +22,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "scene/resources/texture.h"
#if THREAD_POOL_PRESENT
#include "../thread_pool/thread_pool_job.h"
#else
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/reference.h"
#define Texture Texture2D
#else
#include "core/reference.h"
#endif
#endif
class PropData;
class PropInstance;

View File

@ -4,26 +4,9 @@
//#include "../thread_pool/thread_pool.h"
#include "core/version.h"
#include "servers/visual_server.h"
#include "scene/resources/world.h"
#include "servers/visual_server.h"
#if VERSION_MAJOR > 3
#include "core/config/engine.h"
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
r.push_back(arr[i]); \
} \
return r;
#include "servers/rendering_server.h"
typedef class RenderingServer VS;
#define GET_WORLD get_world_3d
#else
#include "core/engine.h"
#define VARIANT_ARRAY_GET(arr) \
@ -37,8 +20,6 @@ typedef class RenderingServer VS;
#define GET_WORLD get_world
#endif
#if MESH_DATA_RESOURCE_PRESENT
//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling,
//but not when included from here.

View File

@ -22,20 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "prop_instance.h"
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "scene/3d/spatial.h"
#else
#include "scene/3d/node_3d.h"
#define Spatial Node3D
#endif
#include "core/math/vector3.h"

View File

@ -22,13 +22,7 @@ SOFTWARE.
#include "prop_instance_prop_job.h"
#include "core/version.h"
#if VERSION_MAYOR > 3
#define GET_WORLD get_world_3d
#else
#define GET_WORLD get_world
#endif
#include "jobs/prop_mesher_job_step.h"
#include "lights/prop_light.h"

View File

@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "prop_instance_job.h"
class PropMesher;

View File

@ -26,13 +26,7 @@ SOFTWARE.
#include "prop_data_light.h"
#include "prop_data_prop.h"
#if VERSION_MAJOR < 4
#include "servers/physics_server.h"
#else
#include "servers/physics_server_3d.h"
#define Shape Shape3D
#endif
int PropData::get_id() const {
return _id;
@ -81,11 +75,7 @@ int PropData::get_prop_count() const {
Vector<Variant> PropData::get_props() {
Vector<Variant> r;
for (int i = 0; i < _props.size(); i++) {
#if VERSION_MAJOR < 4
r.push_back(_props[i].get_ref_ptr());
#else
r.push_back(_props[i]);
#endif
}
return r;
}

View File

@ -22,23 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/ref_counted.h"
#ifndef Reference
#define Reference RefCounted
#endif
#include "core/math/transform_3d.h"
#include "core/templates/vector.h"
#else
#include "core/math/transform.h"
#include "core/reference.h"
#include "core/vector.h"
#include "core/math/transform.h"
#endif
#include "core/math/rect2.h"
#include "core/math/vector2.h"

View File

@ -26,18 +26,12 @@ SOFTWARE.
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "scene/3d/spatial.h"
#else
#include "scene/3d/node_3d.h"
#define Spatial Node3D
#endif
#if TEXTURE_PACKER_PRESENT
#include "../../texture_packer/texture_packer.h"
#endif
#include "../prop_mesher.h"
Transform PropDataEntry::get_transform() const {
@ -115,5 +109,4 @@ void PropDataEntry::_bind_methods() {
ClassDB::bind_method(D_METHOD("_processor_process", "prop_data", "node", "transform"), &PropDataEntry::_processor_process);
ClassDB::bind_method(D_METHOD("_processor_get_node_for", "transform"), &PropDataEntry::_processor_get_node_for);
ClassDB::bind_method(D_METHOD("_processor_evaluate_children"), &PropDataEntry::_processor_evaluate_children);
}

View File

@ -22,22 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/io/resource.h"
#include "core/math/transform_3d.h"
#ifndef Transform
#define Transform Transform3D
#endif
#else
#include "core/resource.h"
#include "core/math/transform.h"
#endif
#include "core/resource.h"
class PropData;
class PropMesher;

View File

@ -24,13 +24,7 @@ SOFTWARE.
#include "prop_data.h"
#if VERSION_MAJOR < 4
#include "scene/3d/light.h"
#else
#include "scene/3d/light_3d.h"
#define OmniLight OmniLight3D
#define Light Light3D
#endif
Color PropDataLight::get_light_color() const {
return _light_color;

View File

@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/math/color.h"
#else
#include "core/color.h"
#endif
#include "prop_data_entry.h"

View File

@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#include "prop_data_entry.h"

View File

@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/math/vector3.h"
#include "prop_data_entry.h"

View File

@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/math/vector3.h"
#include "prop_data_entry.h"

View File

@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/math/vector3.h"
#include "prop_data_entry.h"

View File

@ -27,13 +27,8 @@ SOFTWARE.
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#else
#include "core/engine.h"
#include "core/project_settings.h"
#endif
#include "../jobs/prop_texture_job.h"
@ -46,17 +41,6 @@ SOFTWARE.
#include "core/hashfuncs.h"
#if VERSION_MAJOR > 3
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
r.push_back(arr[i]); \
} \
return r;
#else
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
@ -64,8 +48,6 @@ SOFTWARE.
} \
return r;
#endif
PropCache *PropCache::_instance;
PropCache *PropCache::get_singleton() {
@ -352,7 +334,6 @@ void PropCache::material_cache_custom_key_unref(const uint64_t key) {
Ref<Resource> PropCache::load_resource(const String &path, const String &type_hint) {
_ResourceLoader *rl = _ResourceLoader::get_singleton();
#if VERSION_MAJOR < 4
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, type_hint);
ERR_FAIL_COND_V(!resl.is_valid(), Ref<Resource>());
@ -360,9 +341,6 @@ Ref<Resource> PropCache::load_resource(const String &path, const String &type_hi
resl->wait();
return resl->get_resource();
#else
return rl->load(path, type_hint);
#endif
}
PropCache::PropCache() {
@ -375,11 +353,7 @@ PropCache::PropCache() {
#endif
#ifdef TEXTURE_PACKER_PRESENT
#if VERSION_MAJOR < 4
_texture_flags = GLOBAL_DEF("props/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
#else
_texture_flags = GLOBAL_DEF("props/texture_flags", 0);
#endif
_max_atlas_size = GLOBAL_DEF("props/max_atlas_size", 1024);
_keep_original_atlases = GLOBAL_DEF("props/keep_original_atlases", false);

View File

@ -22,26 +22,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/core_bind.h"
#include "core/math/color.h"
#include "core/object/object.h"
#include "core/object/reference.h"
#include "core/templates/hash_map.h"
#include "core/templates/vector.h"
#else
#include "core/bind/core_bind.h"
#include "core/color.h"
#include "core/hash_map.h"
#include "core/object.h"
#include "core/reference.h"
#include "core/vector.h"
#endif
#include "scene/resources/material.h"

View File

@ -25,14 +25,10 @@ SOFTWARE.
#include "../props/prop_data.h"
#include "../props/prop_data_entry.h"
#include "core/version.h"
#if VERSION_MINOR >= 4
#include "core/math/quick_hull.h"
#include "scene/3d/portal.h"
#include "scene/3d/room.h"
#include "scene/3d/room_manager.h"
#endif
#include "scene/3d/mesh_instance.h"
@ -40,23 +36,17 @@ SOFTWARE.
#include "../../mesh_data_resource/nodes/mesh_data_instance.h"
#endif
#if VERSION_MAJOR > 3
#include "core/config/engine.h"
#else
#include "core/engine.h"
#endif
PropUtils *PropUtils::_instance;
Vector<Ref<PropDataEntry> > PropUtils::_processors;
Vector<Ref<PropDataEntry>> PropUtils::_processors;
PropUtils *PropUtils::get_singleton() {
return _instance;
}
Ref<PropData> PropUtils::convert_tree(Node *root) {
#if VERSION_MAJOR < 4
ERR_FAIL_COND_V(!ObjectDB::instance_validate(root), Ref<PropData>());
#endif
Ref<PropData> data;
data.instance();
@ -68,9 +58,7 @@ Ref<PropData> PropUtils::convert_tree(Node *root) {
}
void PropUtils::_convert_tree(Ref<PropData> prop_data, Node *node, const Transform &transform) {
#if VERSION_MAJOR < 4
ERR_FAIL_COND(!ObjectDB::instance_validate(node));
#endif
for (int i = 0; i < PropUtils::_processors.size(); ++i) {
Ref<PropDataEntry> proc = PropUtils::_processors.get(i);
@ -161,7 +149,7 @@ bool PropUtils::generate_room_points_node(Node *node) {
void PropUtils::generate_room_points(Room *room) {
ERR_FAIL_COND(!ObjectDB::instance_validate(room));
Vector<PoolVector<Vector3> > mesh_arrays;
Vector<PoolVector<Vector3>> mesh_arrays;
get_mesh_arrays(room, &mesh_arrays);
@ -306,7 +294,7 @@ bool PropUtils::is_plane_unique(const PoolVector<Plane> &planes, const Plane &p)
return true;
}
void PropUtils::get_mesh_arrays(Node *node, Vector<PoolVector<Vector3> > *arrs) {
void PropUtils::get_mesh_arrays(Node *node, Vector<PoolVector<Vector3>> *arrs) {
ERR_FAIL_COND(!ObjectDB::instance_validate(node));
for (int i = 0; i < node->get_child_count(); ++i) {

View File

@ -22,31 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/object.h"
#include "core/object/reference.h"
#include "core/templates/vector.h"
#include "scene/3d/node_3d.h"
#else
#include "core/object.h"
#include "core/reference.h"
#include "core/vector.h"
#include "scene/3d/spatial.h"
#endif
#include "scene/main/node.h"
class PropData;
class PropDataEntry;
#if VERSION_MINOR >= 4
class Room;
#endif
class PropUtils : public Object {
GDCLASS(PropUtils, Object);
@ -57,12 +43,10 @@ public:
Ref<PropData> convert_tree(Node *root);
void _convert_tree(Ref<PropData> prop_data, Node *node, const Transform &transform);
#if VERSION_MINOR >= 4
bool generate_room_points_node(Node *node);
void generate_room_points(Room *room);
void get_mesh_arrays(Node *node, Vector<PoolVector<Vector3>> *arrs);
bool is_plane_unique(const PoolVector<Plane> &planes, const Plane &p);
#endif
static int add_processor(const Ref<PropDataEntry> &processor);
static Ref<PropDataEntry> get_processor(const int index);

View File

@ -1,18 +1,10 @@
#include "tiled_wall.h"
#include "core/version.h"
#include "scene/resources/texture.h"
#if VERSION_MAJOR < 4
#include "core/image.h"
#define GET_WORLD get_world
#else
#include "core/io/image.h"
#define GET_WORLD get_world_3d
#endif
#if TEXTURE_PACKER_PRESENT
#include "../../texture_packer/texture_resource/packer_image_resource.h"
@ -23,9 +15,9 @@
#include "../singleton/prop_cache.h"
#include "core/core_string_names.h"
#include "tiled_wall_data.h"
#include "servers/physics_server.h"
#include "scene/resources/world.h"
#include "servers/physics_server.h"
#include "tiled_wall_data.h"
int TiledWall::get_width() const {
return _width;
@ -243,11 +235,7 @@ void TiledWall::clear_mesh() {
if (_mesh_rid != RID()) {
if (VS::get_singleton()->mesh_get_surface_count(_mesh_rid) > 0)
#if VERSION_MAJOR < 4
VS::get_singleton()->mesh_remove_surface(_mesh_rid, 0);
#else
VS::get_singleton()->mesh_clear(_mesh_rid);
#endif
}
}

View File

@ -22,21 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#include "scene/resources/texture.h"
#if VERSION_MAJOR < 4
#include "scene/3d/visual_instance.h"
#else
#include "scene/3d/node_3d.h"
#define SpatialMaterial StandardMaterial3D
#define Spatial Node3D
#define Texture Texture2D
#endif
#include "core/math/vector3.h"

View File

@ -22,15 +22,7 @@ SOFTWARE.
#include "tiled_wall_data.h"
#if VERSION_MAJOR < 4
#include "servers/physics_server.h"
#else
#include "servers/physics_server_3d.h"
#define Shape Shape3D
#endif
#if VERSION_MAJOR <= 3
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
@ -39,17 +31,6 @@ SOFTWARE.
} \
return r;
#else
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
r.push_back(arr[i].get_ref_ptr()); \
} \
return r;
#endif
#define VARIANT_ARRAY_SET(arr, arr_into, type) \
arr_into.clear(); \
for (int i = 0; i < arr.size(); i++) { \
@ -100,11 +81,7 @@ int TiledWallData::get_texture_count() const {
Vector<Variant> TiledWallData::get_textures() {
Vector<Variant> r;
for (int i = 0; i < _textures.size(); i++) {
#if VERSION_MAJOR < 4
r.push_back(_textures[i].get_ref_ptr());
#else
r.push_back(_textures[i]);
#endif
}
return r;
}
@ -148,11 +125,7 @@ int TiledWallData::get_flavour_texture_count() const {
Vector<Variant> TiledWallData::get_flavour_textures() {
Vector<Variant> r;
for (int i = 0; i < _flavour_textures.size(); i++) {
#if VERSION_MAJOR < 4
r.push_back(_flavour_textures[i].get_ref_ptr());
#else
r.push_back(_flavour_textures[i]);
#endif
}
return r;
}

View File

@ -22,18 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/version.h"
#if VERSION_MAJOR > 3
#include "core/object/reference.h"
#include "core/templates/vector.h"
#else
#include "core/reference.h"
#include "core/vector.h"
#endif
#include "core/math/rect2.h"
#include "core/math/transform.h"