mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-14 22:51:11 +01:00
Also moved away from the old VOXELMAN_PRESENT macro.
This commit is contained in:
parent
ea2a36c4ea
commit
14c44e5727
@ -4,9 +4,6 @@ Import('env')
|
|||||||
|
|
||||||
module_env = env.Clone()
|
module_env = env.Clone()
|
||||||
|
|
||||||
if os.path.isdir('../voxelman'):
|
|
||||||
module_env.Append(CPPDEFINES=['VOXELMAN_PRESENT'])
|
|
||||||
|
|
||||||
if os.path.isdir('../terraman'):
|
if os.path.isdir('../terraman'):
|
||||||
module_env.Append(CPPDEFINES=['TERRAMAN_PRESENT'])
|
module_env.Append(CPPDEFINES=['TERRAMAN_PRESENT'])
|
||||||
|
|
||||||
|
@ -26,7 +26,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/math/math_funcs.h"
|
#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/default/voxel_chunk_default.h"
|
||||||
#include "../voxelman/world/voxel_chunk.h"
|
#include "../voxelman/world/voxel_chunk.h"
|
||||||
#endif
|
#endif
|
||||||
@ -42,7 +44,7 @@ void BiomeTerrainGenerator::set_current_seed(int value) {
|
|||||||
_current_seed = value;
|
_current_seed = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
void BiomeTerrainGenerator::generate_simple_terrarin(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
void BiomeTerrainGenerator::generate_simple_terrarin(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
||||||
Ref<OpenSimplexNoise> noise;
|
Ref<OpenSimplexNoise> noise;
|
||||||
noise.instance();
|
noise.instance();
|
||||||
@ -129,7 +131,7 @@ void BiomeTerrainGenerator::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_current_seed", "value"), &BiomeTerrainGenerator::set_current_seed);
|
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");
|
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);
|
ClassDB::bind_method(D_METHOD("generate_simple_terrarin", "chunk", "spawn_mobs"), &BiomeTerrainGenerator::generate_simple_terrarin);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "core/object/reference.h"
|
#include "core/object/reference.h"
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#include "modules/modules_enabled.gen.h"
|
||||||
|
|
||||||
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
class VoxelChunk;
|
class VoxelChunk;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -35,7 +37,7 @@ public:
|
|||||||
int get_current_seed();
|
int get_current_seed();
|
||||||
void set_current_seed(int value);
|
void set_current_seed(int value);
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
void generate_simple_terrarin(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
void generate_simple_terrarin(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "modules/modules_enabled.gen.h"
|
#include "modules/modules_enabled.gen.h"
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
#include "../../voxelman/world/voxel_chunk.h"
|
#include "../../voxelman/world/voxel_chunk.h"
|
||||||
|
|
||||||
bool GroundClutter::should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z) {
|
bool GroundClutter::should_spawn(Ref<VoxelChunk> 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);
|
ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter::add_textures_to);
|
||||||
#endif
|
#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(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")));
|
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")));
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ SOFTWARE.
|
|||||||
#include "../../texture_packer/texture_packer.h"
|
#include "../../texture_packer/texture_packer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
#include "../../voxelman/meshers/voxel_mesher.h"
|
#include "../../voxelman/meshers/voxel_mesher.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ class GroundClutter : public Resource {
|
|||||||
GDCLASS(GroundClutter, Resource);
|
GDCLASS(GroundClutter, Resource);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
bool should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z);
|
bool should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z);
|
||||||
|
|
||||||
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
|
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
|
||||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "modules/modules_enabled.gen.h"
|
#include "modules/modules_enabled.gen.h"
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
#include "../../voxelman/world/voxel_chunk.h"
|
#include "../../voxelman/world/voxel_chunk.h"
|
||||||
|
|
||||||
bool GroundClutter2D::should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z) {
|
bool GroundClutter2D::should_spawn(Ref<VoxelChunk> 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);
|
ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter2D::add_textures_to);
|
||||||
#endif
|
#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(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")));
|
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")));
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ SOFTWARE.
|
|||||||
#include "../../texture_packer/texture_packer.h"
|
#include "../../texture_packer/texture_packer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
#include "../../voxelman/meshers/voxel_mesher.h"
|
#include "../../voxelman/meshers/voxel_mesher.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ class GroundClutter2D : public Resource {
|
|||||||
GDCLASS(GroundClutter2D, Resource);
|
GDCLASS(GroundClutter2D, Resource);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef VOXELMAN_PRESENT
|
#ifdef MODULE_VOXELMAN_ENABLED
|
||||||
bool should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z);
|
bool should_spawn(Ref<VoxelChunk> chunk, int x, int y, int z);
|
||||||
|
|
||||||
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
|
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
|
||||||
|
Loading…
Reference in New Issue
Block a user