diff --git a/SCsub b/SCsub index 7d2dd93..77964e3 100644 --- a/SCsub +++ b/SCsub @@ -4,9 +4,11 @@ Import('env') module_env = env.Clone() -#Should work with just arrays -#if os.path.isdir('../mesh_data_resource'): -# module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT']) +if os.path.isdir('../voxelman'): + module_env.Append(CPPDEFINES=['VOXELMAN_PRESENT']) + +if os.path.isdir('../terraman'): + module_env.Append(CPPDEFINES=['TERRAMAN_PRESENT']) sources = [ diff --git a/biome_terrarin_generator.cpp b/biome_terrarin_generator.cpp index b996786..422624f 100644 --- a/biome_terrarin_generator.cpp +++ b/biome_terrarin_generator.cpp @@ -32,8 +32,10 @@ SOFTWARE. #include "core/math/math_funcs.h" +#ifdef VOXELMAN_PRESENT #include "../voxelman/world/default/voxel_chunk_default.h" #include "../voxelman/world/voxel_chunk.h" +#endif #include "../entity_spell_system/singletons/ess.h" #include "../entity_spell_system/spawners/ess_entity_spawner.h" @@ -46,6 +48,7 @@ void BiomeTerrarinGenerator::set_current_seed(int value) { _current_seed = value; } +#ifdef VOXELMAN_PRESENT void BiomeTerrarinGenerator::generate_simple_terrarin(Ref chunk, bool spawn_mobs) { Ref noise; noise.instance(); @@ -118,6 +121,7 @@ void BiomeTerrarinGenerator::generate_simple_terrarin(Ref chunk, boo // ESS::get_singleton()->get_entity_spawner()->call("spawn_mob", 0, Math::rand() % 3, v); // } } +#endif BiomeTerrarinGenerator::BiomeTerrarinGenerator() { _current_seed = 0; @@ -131,5 +135,7 @@ void BiomeTerrarinGenerator::_bind_methods() { ClassDB::bind_method(D_METHOD("set_current_seed", "value"), &BiomeTerrarinGenerator::set_current_seed); ADD_PROPERTY(PropertyInfo(Variant::INT, "current_seed"), "set_current_seed", "get_current_seed"); +#ifdef VOXELMAN_PRESENT ClassDB::bind_method(D_METHOD("generate_simple_terrarin", "chunk", "spawn_mobs"), &BiomeTerrarinGenerator::generate_simple_terrarin); +#endif } \ No newline at end of file diff --git a/biome_terrarin_generator.h b/biome_terrarin_generator.h index 51b8614..bd01468 100644 --- a/biome_terrarin_generator.h +++ b/biome_terrarin_generator.h @@ -31,7 +31,9 @@ SOFTWARE. #include "core/reference.h" #endif +#ifdef VOXELMAN_PRESENT class VoxelChunk; +#endif class BiomeTerrarinGenerator : public Reference { GDCLASS(BiomeTerrarinGenerator, Reference); @@ -40,7 +42,9 @@ public: int get_current_seed(); void set_current_seed(int value); +#ifdef VOXELMAN_PRESENT void generate_simple_terrarin(Ref chunk, bool spawn_mobs); +#endif BiomeTerrarinGenerator(); ~BiomeTerrarinGenerator();