From 50e1108e1874fd387eb74442ea42bc8551b76076 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 5 Oct 2022 13:20:42 +0200 Subject: [PATCH] Replaced PROPS_2D_PRESENT define for the module system's equivalent. --- modules/mesh_data_resource/SCsub | 3 --- .../props_2d/prop_2d_data_mesh_data.cpp | 2 +- .../props_2d/prop_2d_data_mesh_data.h | 2 +- modules/mesh_data_resource/register_types.cpp | 4 ++-- .../material_cache/prop_2d_material_cache.cpp | 3 --- modules/props_2d/prop_2d_instance.cpp | 3 --- modules/props_2d/prop_2d_instance_merger.cpp | 3 --- modules/props_2d/prop_2d_instance_prop_job.cpp | 3 --- modules/terraman_2d/SCsub | 3 --- modules/terraman_2d/library/terrain_2d_library.cpp | 8 +++++--- modules/terraman_2d/library/terrain_2d_library.h | 6 ++++-- .../library/terrain_2d_library_merger.cpp | 10 +++++----- .../library/terrain_2d_library_merger.h | 8 +++++--- .../library/terrain_2d_library_merger_pcm.cpp | 14 +++++++------- .../library/terrain_2d_library_merger_pcm.h | 8 +++++--- .../library/terrain_2d_material_cache.cpp | 6 +++--- .../library/terrain_2d_material_cache.h | 4 +++- modules/terraman_2d/world/terrain_2d_chunk.cpp | 10 +++++----- modules/terraman_2d/world/terrain_2d_chunk.h | 8 ++++---- modules/terraman_2d/world/terrain_2d_world.cpp | 6 +++--- modules/terraman_2d/world/terrain_2d_world.h | 6 ++++-- 21 files changed, 57 insertions(+), 63 deletions(-) diff --git a/modules/mesh_data_resource/SCsub b/modules/mesh_data_resource/SCsub index 5de29810d..5d9115a6d 100644 --- a/modules/mesh_data_resource/SCsub +++ b/modules/mesh_data_resource/SCsub @@ -4,9 +4,6 @@ Import('env') module_env = env.Clone() -if env["module_props_2d_enabled"]: - module_env.Append(CPPDEFINES=['PROPS_2D_PRESENT']) - if env["module_mesh_utils_enabled"]: module_env.Append(CPPDEFINES=['MESH_UTILS_PRESENT']) diff --git a/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.cpp b/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.cpp index 9b6a8c06a..39f3f7a4d 100644 --- a/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.cpp +++ b/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.cpp @@ -24,7 +24,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../nodes/mesh_data_instance.h" #include "scene/resources/material.h" diff --git a/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.h b/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.h index 81b7a781d..6f2aed628 100644 --- a/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.h +++ b/modules/mesh_data_resource/props_2d/prop_2d_data_mesh_data.h @@ -24,7 +24,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data_entry.h" #include "core/math/vector3.h" diff --git a/modules/mesh_data_resource/register_types.cpp b/modules/mesh_data_resource/register_types.cpp index 2c9ac0dc0..56e6e6d09 100644 --- a/modules/mesh_data_resource/register_types.cpp +++ b/modules/mesh_data_resource/register_types.cpp @@ -44,7 +44,7 @@ SOFTWARE. #include "props/prop_data_mesh_data.h" #endif -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../props_2d/singleton/prop_2d_utils.h" #include "props_2d/prop_2d_data_mesh_data.h" #endif @@ -62,7 +62,7 @@ void register_mesh_data_resource_types() { PropUtils::add_processor(processor); #endif -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::register_class(); Ref prop_2d_processor = Ref(memnew(Prop2DDataMeshData)); Prop2DUtils::add_processor(prop_2d_processor); diff --git a/modules/props_2d/material_cache/prop_2d_material_cache.cpp b/modules/props_2d/material_cache/prop_2d_material_cache.cpp index c87e63726..2a784a267 100644 --- a/modules/props_2d/material_cache/prop_2d_material_cache.cpp +++ b/modules/props_2d/material_cache/prop_2d_material_cache.cpp @@ -31,9 +31,6 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" #ifdef MODULE_MESH_DATA_RESOURCE_ENABLED -//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, -//but not when included from here. -#define PROPS_2D_PRESENT 1 #include "../../mesh_data_resource/props_2d/prop_2d_data_mesh_data.h" #endif diff --git a/modules/props_2d/prop_2d_instance.cpp b/modules/props_2d/prop_2d_instance.cpp index 2c4f5743e..bd4942362 100644 --- a/modules/props_2d/prop_2d_instance.cpp +++ b/modules/props_2d/prop_2d_instance.cpp @@ -7,9 +7,6 @@ #include "modules/modules_enabled.gen.h" #ifdef MODULE_MESH_DATA_RESOURCE_ENABLED -//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, -//but not when included from here. -#define PROPS_2D_PRESENT 1 #include "../mesh_data_resource/props_2d/prop_2d_data_mesh_data.h" #endif diff --git a/modules/props_2d/prop_2d_instance_merger.cpp b/modules/props_2d/prop_2d_instance_merger.cpp index aca49ce2f..a5e0ca70f 100644 --- a/modules/props_2d/prop_2d_instance_merger.cpp +++ b/modules/props_2d/prop_2d_instance_merger.cpp @@ -24,9 +24,6 @@ #include "modules/modules_enabled.gen.h" #ifdef MODULE_MESH_DATA_RESOURCE_ENABLED -//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, -//but not when included from here. -#define PROPS_2D_PRESENT 1 #include "../mesh_data_resource/props_2d/prop_2d_data_mesh_data.h" #endif diff --git a/modules/props_2d/prop_2d_instance_prop_job.cpp b/modules/props_2d/prop_2d_instance_prop_job.cpp index f9ab6e87f..83dfa2f21 100644 --- a/modules/props_2d/prop_2d_instance_prop_job.cpp +++ b/modules/props_2d/prop_2d_instance_prop_job.cpp @@ -45,9 +45,6 @@ SOFTWARE. #endif #ifdef MODULE_MESH_DATA_RESOURCE_ENABLED -//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, -//but not when included from here. -#define PROPS_2D_PRESENT 1 #include "../mesh_data_resource/props_2d/prop_2d_data_mesh_data.h" #endif diff --git a/modules/terraman_2d/SCsub b/modules/terraman_2d/SCsub index d13ac50a7..05c3a19d6 100644 --- a/modules/terraman_2d/SCsub +++ b/modules/terraman_2d/SCsub @@ -4,9 +4,6 @@ Import('env') module_env = env.Clone() -if os.path.isdir('../props_2d'): - module_env.Append(CPPDEFINES=['PROPS_2D_PRESENT']) - if os.path.isdir('../mesh_utils'): module_env.Append(CPPDEFINES=['MESH_UTILS_PRESENT']) diff --git a/modules/terraman_2d/library/terrain_2d_library.cpp b/modules/terraman_2d/library/terrain_2d_library.cpp index d6bb489d5..3c6f70a2f 100644 --- a/modules/terraman_2d/library/terrain_2d_library.cpp +++ b/modules/terraman_2d/library/terrain_2d_library.cpp @@ -26,7 +26,9 @@ SOFTWARE. #include "terrain_2d_material_cache.h" -#ifdef PROPS_2D_PRESENT +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #endif @@ -194,7 +196,7 @@ int Terrain2DLibrary::scene_get_num() const { void Terrain2DLibrary::scenes_clear() { } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Ref Terrain2DLibrary::prop_get(const int id) { return Ref(); } @@ -322,7 +324,7 @@ void Terrain2DLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("scene_get_num"), &Terrain2DLibrary::scene_get_num); ClassDB::bind_method(D_METHOD("scenes_clear"), &Terrain2DLibrary::scenes_clear); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("prop_get", "id"), &Terrain2DLibrary::prop_get); ClassDB::bind_method(D_METHOD("prop_add", "value"), &Terrain2DLibrary::prop_add); ClassDB::bind_method(D_METHOD("prop_has", "prop"), &Terrain2DLibrary::prop_has); diff --git a/modules/terraman_2d/library/terrain_2d_library.h b/modules/terraman_2d/library/terrain_2d_library.h index 2c3b33519..22f8c4000 100644 --- a/modules/terraman_2d/library/terrain_2d_library.h +++ b/modules/terraman_2d/library/terrain_2d_library.h @@ -32,12 +32,14 @@ SOFTWARE. #include "../defines.h" +#include "modules/modules_enabled.gen.h" + class Terrain2DMaterialCache; class Terrain2DSurface; class Terrain2DMesher; class PackedScene; class Terrain2DChunk; -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED class Prop2DData; #endif @@ -111,7 +113,7 @@ public: virtual int scene_get_num() const; virtual void scenes_clear(); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED virtual Ref prop_get(const int id); virtual void prop_add(Ref value); virtual bool prop_has(const Ref &value) const; diff --git a/modules/terraman_2d/library/terrain_2d_library_merger.cpp b/modules/terraman_2d/library/terrain_2d_library_merger.cpp index c3a2cc89c..43e09703c 100644 --- a/modules/terraman_2d/library/terrain_2d_library_merger.cpp +++ b/modules/terraman_2d/library/terrain_2d_library_merger.cpp @@ -27,7 +27,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #include "../../props_2d/props/prop_2d_data_prop.h" @@ -153,7 +153,7 @@ void Terrain2DLibraryMerger::set_terra_surfaces(const Vector &surfaces) } } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Ref Terrain2DLibraryMerger::get_prop(const int index) { ERR_FAIL_INDEX_V(index, _props.size(), Ref()); @@ -263,7 +263,7 @@ void Terrain2DLibraryMerger::refresh_rects() { setup_material_albedo(MATERIAL_INDEX_LIQUID, tex); } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED //todo add this back //texture_added = false; for (int i = 0; i < _props.size(); i++) { @@ -356,7 +356,7 @@ Terrain2DLibraryMerger::~Terrain2DLibraryMerger() { _prop_packer.unref(); } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED bool Terrain2DLibraryMerger::process_prop_textures(Ref prop) { if (!prop.is_valid()) { return false; @@ -418,7 +418,7 @@ void Terrain2DLibraryMerger::_bind_methods() { ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &Terrain2DLibraryMerger::set_terra_surfaces); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces"); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("get_props"), &Terrain2DLibraryMerger::get_props); ClassDB::bind_method(D_METHOD("set_props"), &Terrain2DLibraryMerger::set_props); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props"); diff --git a/modules/terraman_2d/library/terrain_2d_library_merger.h b/modules/terraman_2d/library/terrain_2d_library_merger.h index 5f122192a..ef36822ad 100644 --- a/modules/terraman_2d/library/terrain_2d_library_merger.h +++ b/modules/terraman_2d/library/terrain_2d_library_merger.h @@ -32,6 +32,8 @@ SOFTWARE. #include "../data/terrain_2d_light.h" #include "terrain_2d_surface_merger.h" +#include "modules/modules_enabled.gen.h" + class Terrain2DSurfaceSimple; class Terrain2DMesher; class PackedScene; @@ -65,7 +67,7 @@ public: Vector get_terra_surfaces(); void set_terra_surfaces(const Vector &surfaces); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Ref get_prop(const int index); void add_prop(Ref value); bool has_prop(const Ref &value) const; @@ -90,14 +92,14 @@ public: ~Terrain2DLibraryMerger(); protected: -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED bool process_prop_textures(Ref prop); #endif static void _bind_methods(); Vector> _terra_surfaces; -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Vector> _props; #endif diff --git a/modules/terraman_2d/library/terrain_2d_library_merger_pcm.cpp b/modules/terraman_2d/library/terrain_2d_library_merger_pcm.cpp index 29efec9bc..d23227e1a 100644 --- a/modules/terraman_2d/library/terrain_2d_library_merger_pcm.cpp +++ b/modules/terraman_2d/library/terrain_2d_library_merger_pcm.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #include "../../props_2d/props/prop_2d_data_prop.h" @@ -237,7 +237,7 @@ void Terrain2DLibraryMergerPCM::_prop_material_cache_get_key(Ref Vector props; /* - #ifdef PROPS_2D_PRESENT + #ifdef MODULE_PROPS_2D_ENABLED for (int i = 0; i < chunk->prop_get_count(); ++i) { Ref prop = chunk->prop_get(i); @@ -340,7 +340,7 @@ void Terrain2DLibraryMergerPCM::_prop_material_cache_get_key(Ref } /* - #ifdef PROPS_2D_PRESENT + #ifdef MODULE_PROPS_2D_ENABLED for (int i = 0; i < chunk->prop_get_count(); ++i) { Ref prop = chunk->prop_get(i); @@ -528,7 +528,7 @@ void Terrain2DLibraryMergerPCM::set_terra_surfaces(const Vector &surfac } } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Ref Terrain2DLibraryMergerPCM::get_prop(const int index) { ERR_FAIL_INDEX_V(index, _props.size(), Ref()); @@ -639,7 +639,7 @@ void Terrain2DLibraryMergerPCM::refresh_rects() { setup_material_albedo(MATERIAL_INDEX_LIQUID, tex); } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED //todo add this back //texture_added = false; for (int i = 0; i < _props.size(); i++) { @@ -731,7 +731,7 @@ Terrain2DLibraryMergerPCM::~Terrain2DLibraryMergerPCM() { _prop_packer.unref(); } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED bool Terrain2DLibraryMergerPCM::process_prop_textures(Ref prop) { /* if (!prop.is_valid()) { @@ -794,7 +794,7 @@ void Terrain2DLibraryMergerPCM::_bind_methods() { ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &Terrain2DLibraryMergerPCM::set_terra_surfaces); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces"); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("get_props"), &Terrain2DLibraryMergerPCM::get_props); ClassDB::bind_method(D_METHOD("set_props"), &Terrain2DLibraryMergerPCM::set_props); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props"); diff --git a/modules/terraman_2d/library/terrain_2d_library_merger_pcm.h b/modules/terraman_2d/library/terrain_2d_library_merger_pcm.h index 58f012b54..c8df240ba 100644 --- a/modules/terraman_2d/library/terrain_2d_library_merger_pcm.h +++ b/modules/terraman_2d/library/terrain_2d_library_merger_pcm.h @@ -34,6 +34,8 @@ SOFTWARE. #include "core/os/mutex.h" +#include "modules/modules_enabled.gen.h" + class Terrain2DSurfaceSimple; class Terrain2DMesher; class PackedScene; @@ -80,7 +82,7 @@ public: Vector get_terra_surfaces(); void set_terra_surfaces(const Vector &surfaces); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Ref get_prop(const int index); void add_prop(Ref value); bool has_prop(const Ref &value) const; @@ -105,7 +107,7 @@ public: ~Terrain2DLibraryMergerPCM(); protected: -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED bool process_prop_textures(Ref prop); #endif @@ -115,7 +117,7 @@ protected: Map> _prop_material_cache; Vector> _terra_surfaces; -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Vector> _props; #endif diff --git a/modules/terraman_2d/library/terrain_2d_material_cache.cpp b/modules/terraman_2d/library/terrain_2d_material_cache.cpp index 7fed254f6..7cc5196c9 100644 --- a/modules/terraman_2d/library/terrain_2d_material_cache.cpp +++ b/modules/terraman_2d/library/terrain_2d_material_cache.cpp @@ -26,7 +26,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #include "../../props_2d/props/prop_2d_data_prop.h" @@ -161,7 +161,7 @@ Ref Terrain2DMaterialCache::texture_get_merged() { return Ref(); } -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void Terrain2DMaterialCache::prop_add_textures(const Ref &prop) { if (!prop.is_valid()) { return; @@ -275,7 +275,7 @@ void Terrain2DMaterialCache::_bind_methods() { ClassDB::bind_method(D_METHOD("texture_get_merged"), &Terrain2DMaterialCache::texture_get_merged); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("prop_add_textures", "prop"), &Terrain2DMaterialCache::prop_add_textures); ClassDB::bind_method(D_METHOD("prop_remove_textures", "prop"), &Terrain2DMaterialCache::prop_remove_textures); #endif diff --git a/modules/terraman_2d/library/terrain_2d_material_cache.h b/modules/terraman_2d/library/terrain_2d_material_cache.h index 2f5989525..cc9908aca 100644 --- a/modules/terraman_2d/library/terrain_2d_material_cache.h +++ b/modules/terraman_2d/library/terrain_2d_material_cache.h @@ -33,6 +33,8 @@ SOFTWARE. #include "../defines.h" +#include "modules/modules_enabled.gen.h" + class Terrain2DLibrary; class Terrain2DMaterialCache : public Resource { @@ -74,7 +76,7 @@ public: //Also do it for props virtual Ref texture_get_merged(); -#ifdef PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void prop_add_textures(const Ref &prop); void prop_remove_textures(const Ref &prop); #endif diff --git a/modules/terraman_2d/world/terrain_2d_chunk.cpp b/modules/terraman_2d/world/terrain_2d_chunk.cpp index c4cb5acb8..2e7311050 100644 --- a/modules/terraman_2d/world/terrain_2d_chunk.cpp +++ b/modules/terraman_2d/world/terrain_2d_chunk.cpp @@ -739,7 +739,7 @@ void Terrain2DChunk::clear_baked_lights() { call("_clear_baked_lights"); } -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void Terrain2DChunk::prop_add(const Transform2D &tarnsform, const Ref &prop) { ERR_FAIL_COND(!prop.is_valid()); @@ -798,7 +798,7 @@ int Terrain2DChunk::mesh_data_resource_addv(const Vector2 &local_data_pos, const AABB mesh_aabb = e.transform.xform(mesh->get_aabb()); e.is_inside = aabb.encloses(mesh_aabb); - #if PROPS_2D_PRESENT + #ifdef MODULE_PROPS_2D_ENABLED if (get_library().is_valid() && texture.is_valid()) { e.uv_rect = get_library()->get_prop_uv_rect(texture); } else { @@ -845,7 +845,7 @@ int Terrain2DChunk::mesh_data_resource_add(const Transform2D &local_transform, c AABB mesh_aabb = e.transform.xform(mesh->get_aabb()); e.is_inside = aabb.encloses(mesh_aabb); -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED if (get_library().is_valid() && texture.is_valid()) e.uv_rect = get_library()->get_prop_uv_rect(texture); else @@ -1171,7 +1171,7 @@ Terrain2DChunk::~Terrain2DChunk() { _library.unref(); } -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED props_clear(); #endif @@ -1584,7 +1584,7 @@ void Terrain2DChunk::_bind_methods() { //Meshes -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("prop_add", "prop"), &Terrain2DChunk::prop_add); ClassDB::bind_method(D_METHOD("prop_get", "index"), &Terrain2DChunk::prop_get); ClassDB::bind_method(D_METHOD("prop_get_count"), &Terrain2DChunk::prop_get_count); diff --git a/modules/terraman_2d/world/terrain_2d_chunk.h b/modules/terraman_2d/world/terrain_2d_chunk.h index aa070706c..01911589b 100644 --- a/modules/terraman_2d/world/terrain_2d_chunk.h +++ b/modules/terraman_2d/world/terrain_2d_chunk.h @@ -45,7 +45,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #endif @@ -260,7 +260,7 @@ public: void bake_light(Ref light); void clear_baked_lights(); -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void prop_add(const Transform2D &tarnsform, const Ref &prop); Ref prop_get(const int index); Transform2D prop_get_tarnsform(const int index); @@ -359,7 +359,7 @@ protected: virtual void _generation_physics_process(const float delta); protected: -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED struct Prop2DDataStore { Transform2D transform; Ref prop; @@ -440,7 +440,7 @@ protected: Vector> _voxel_structures; -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED Vector _props; #endif diff --git a/modules/terraman_2d/world/terrain_2d_world.cpp b/modules/terraman_2d/world/terrain_2d_world.cpp index 5b8813edc..805622ac5 100644 --- a/modules/terraman_2d/world/terrain_2d_world.cpp +++ b/modules/terraman_2d/world/terrain_2d_world.cpp @@ -30,7 +30,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #include "../../props_2d/props/prop_2d_data_entry.h" #include "../../props_2d/props/prop_2d_data_light.h" @@ -634,7 +634,7 @@ int Terrain2DWorld::generation_get_size() const { return _generating.size(); } -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void Terrain2DWorld::prop_add(Transform transform, const Ref &prop, const bool apply_voxel_scale) { //TODO /* @@ -1286,7 +1286,7 @@ void Terrain2DWorld::_bind_methods() { ClassDB::bind_method(D_METHOD("is_position_walkable", "position"), &Terrain2DWorld::is_position_walkable); ClassDB::bind_method(D_METHOD("on_chunk_mesh_generation_finished", "chunk"), &Terrain2DWorld::on_chunk_mesh_generation_finished); -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED ClassDB::bind_method(D_METHOD("prop_add", "transform", "prop", "apply_voxel_scale"), &Terrain2DWorld::prop_add, DEFVAL(true)); #endif diff --git a/modules/terraman_2d/world/terrain_2d_world.h b/modules/terraman_2d/world/terrain_2d_world.h index 67a45d47c..c42f9a438 100644 --- a/modules/terraman_2d/world/terrain_2d_world.h +++ b/modules/terraman_2d/world/terrain_2d_world.h @@ -35,7 +35,9 @@ SOFTWARE. #include "core/os/os.h" -#if PROPS_2D_PRESENT +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_PROPS_2D_ENABLED #include "../../props_2d/props/prop_2d_data.h" #endif @@ -176,7 +178,7 @@ public: void generation_remove_index(const int index); int generation_get_size() const; -#if PROPS_2D_PRESENT +#ifdef MODULE_PROPS_2D_ENABLED void prop_add(Transform transform, const Ref &prop, const bool apply_scale = true); #endif