diff --git a/modules/broken_seals_module/SCsub b/modules/broken_seals_module/SCsub index 72db892cd..6e5ebb868 100644 --- a/modules/broken_seals_module/SCsub +++ b/modules/broken_seals_module/SCsub @@ -4,9 +4,6 @@ Import('env') module_env = env.Clone() -if os.path.isdir('../voxelman'): - module_env.Append(CPPDEFINES=['VOXELMAN_PRESENT']) - if os.path.isdir('../terraman'): module_env.Append(CPPDEFINES=['TERRAMAN_PRESENT']) diff --git a/modules/broken_seals_module/biome_terrain_generator.cpp b/modules/broken_seals_module/biome_terrain_generator.cpp index c32cf90f0..17242cea4 100644 --- a/modules/broken_seals_module/biome_terrain_generator.cpp +++ b/modules/broken_seals_module/biome_terrain_generator.cpp @@ -26,7 +26,9 @@ SOFTWARE. #include "core/math/math_funcs.h" -#ifdef VOXELMAN_PRESENT +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_VOXELMAN_ENABLED #include "../voxelman/world/default/voxel_chunk_default.h" #include "../voxelman/world/voxel_chunk.h" #endif @@ -42,7 +44,7 @@ void BiomeTerrainGenerator::set_current_seed(int value) { _current_seed = value; } -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED void BiomeTerrainGenerator::generate_simple_terrarin(Ref chunk, bool spawn_mobs) { Ref noise; noise.instance(); @@ -129,7 +131,7 @@ void BiomeTerrainGenerator::_bind_methods() { ClassDB::bind_method(D_METHOD("set_current_seed", "value"), &BiomeTerrainGenerator::set_current_seed); ADD_PROPERTY(PropertyInfo(Variant::INT, "current_seed"), "set_current_seed", "get_current_seed"); -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED ClassDB::bind_method(D_METHOD("generate_simple_terrarin", "chunk", "spawn_mobs"), &BiomeTerrainGenerator::generate_simple_terrarin); #endif } diff --git a/modules/broken_seals_module/biome_terrain_generator.h b/modules/broken_seals_module/biome_terrain_generator.h index b0f7069ea..67917807c 100644 --- a/modules/broken_seals_module/biome_terrain_generator.h +++ b/modules/broken_seals_module/biome_terrain_generator.h @@ -24,7 +24,9 @@ SOFTWARE. #include "core/object/reference.h" -#ifdef VOXELMAN_PRESENT +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_VOXELMAN_ENABLED class VoxelChunk; #endif @@ -35,7 +37,7 @@ public: int get_current_seed(); void set_current_seed(int value); -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED void generate_simple_terrarin(Ref chunk, bool spawn_mobs); #endif diff --git a/modules/props/clutter/ground_clutter.cpp b/modules/props/clutter/ground_clutter.cpp index b7309f041..cfabd9203 100644 --- a/modules/props/clutter/ground_clutter.cpp +++ b/modules/props/clutter/ground_clutter.cpp @@ -24,7 +24,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED #include "../../voxelman/world/voxel_chunk.h" bool GroundClutter::should_spawn(Ref chunk, int x, int y, int z) { @@ -60,7 +60,7 @@ void GroundClutter::_bind_methods() { ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter::add_textures_to); #endif -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "should"), "_should_spawn", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "y"), PropertyInfo(Variant::INT, "z"))); BIND_VMETHOD(MethodInfo("_add_meshes_to", PropertyInfo(Variant::OBJECT, "mesher", PROPERTY_HINT_RESOURCE_TYPE, "VoxelMesher"), PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "y"), PropertyInfo(Variant::INT, "z"))); diff --git a/modules/props/clutter/ground_clutter.h b/modules/props/clutter/ground_clutter.h index 2b5ffdbe3..8ada83dd6 100644 --- a/modules/props/clutter/ground_clutter.h +++ b/modules/props/clutter/ground_clutter.h @@ -30,7 +30,7 @@ SOFTWARE. #include "../../texture_packer/texture_packer.h" #endif -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED #include "../../voxelman/meshers/voxel_mesher.h" #endif @@ -41,7 +41,7 @@ class GroundClutter : public Resource { GDCLASS(GroundClutter, Resource); public: -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED bool should_spawn(Ref chunk, int x, int y, int z); void add_meshes_to(Ref mesher, Ref chunk, int x, int y, int z); diff --git a/modules/props_2d/clutter/ground_clutter_2d.cpp b/modules/props_2d/clutter/ground_clutter_2d.cpp index d71291869..c6cd1c36a 100644 --- a/modules/props_2d/clutter/ground_clutter_2d.cpp +++ b/modules/props_2d/clutter/ground_clutter_2d.cpp @@ -24,7 +24,7 @@ SOFTWARE. #include "modules/modules_enabled.gen.h" -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED #include "../../voxelman/world/voxel_chunk.h" bool GroundClutter2D::should_spawn(Ref chunk, int x, int y, int z) { @@ -60,7 +60,7 @@ void GroundClutter2D::_bind_methods() { ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter2D::add_textures_to); #endif -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "should"), "_should_spawn", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "y"), PropertyInfo(Variant::INT, "z"))); BIND_VMETHOD(MethodInfo("_add_meshes_to", PropertyInfo(Variant::OBJECT, "mesher", PROPERTY_HINT_RESOURCE_TYPE, "VoxelMesher"), PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "y"), PropertyInfo(Variant::INT, "z"))); diff --git a/modules/props_2d/clutter/ground_clutter_2d.h b/modules/props_2d/clutter/ground_clutter_2d.h index 895652e48..e8b543332 100644 --- a/modules/props_2d/clutter/ground_clutter_2d.h +++ b/modules/props_2d/clutter/ground_clutter_2d.h @@ -30,7 +30,7 @@ SOFTWARE. #include "../../texture_packer/texture_packer.h" #endif -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED #include "../../voxelman/meshers/voxel_mesher.h" #endif @@ -41,7 +41,7 @@ class GroundClutter2D : public Resource { GDCLASS(GroundClutter2D, Resource); public: -#ifdef VOXELMAN_PRESENT +#ifdef MODULE_VOXELMAN_ENABLED bool should_spawn(Ref chunk, int x, int y, int z); void add_meshes_to(Ref mesher, Ref chunk, int x, int y, int z);