2016-05-01 06:00:02 -07:00
|
|
|
#include "register_types.h"
|
2020-01-26 12:29:44 -08:00
|
|
|
#include "edition/voxel_tool.h"
|
2020-02-19 11:26:14 -08:00
|
|
|
#include "generators/graph/voxel_generator_graph.h"
|
2020-02-17 14:05:16 -08:00
|
|
|
#include "generators/voxel_generator_flat.h"
|
2020-01-26 14:43:47 -08:00
|
|
|
#include "generators/voxel_generator_heightmap.h"
|
|
|
|
#include "generators/voxel_generator_image.h"
|
|
|
|
#include "generators/voxel_generator_noise.h"
|
|
|
|
#include "generators/voxel_generator_noise_2d.h"
|
2020-02-17 14:05:16 -08:00
|
|
|
#include "generators/voxel_generator_waves.h"
|
2020-01-26 16:04:13 -08:00
|
|
|
#include "meshers/blocky/voxel_library.h"
|
2019-04-28 09:58:29 -07:00
|
|
|
#include "meshers/blocky/voxel_mesher_blocky.h"
|
|
|
|
#include "meshers/dmc/voxel_mesher_dmc.h"
|
|
|
|
#include "meshers/transvoxel/voxel_mesher_transvoxel.h"
|
2019-08-23 17:44:27 -07:00
|
|
|
#include "streams/voxel_stream_block_files.h"
|
2019-05-27 16:40:09 -07:00
|
|
|
#include "streams/voxel_stream_file.h"
|
2019-08-17 11:56:21 -07:00
|
|
|
#include "streams/voxel_stream_region_files.h"
|
2019-04-28 09:58:29 -07:00
|
|
|
#include "terrain/voxel_box_mover.h"
|
2019-05-03 16:02:10 -07:00
|
|
|
#include "terrain/voxel_lod_terrain.h"
|
2019-04-28 09:58:29 -07:00
|
|
|
#include "terrain/voxel_map.h"
|
|
|
|
#include "terrain/voxel_terrain.h"
|
2016-05-01 06:00:02 -07:00
|
|
|
#include "voxel_buffer.h"
|
2020-01-02 12:31:05 -08:00
|
|
|
#include "voxel_memory_pool.h"
|
2020-01-17 12:43:28 -08:00
|
|
|
#include "voxel_string_names.h"
|
2016-05-01 06:00:02 -07:00
|
|
|
|
|
|
|
void register_voxel_types() {
|
|
|
|
|
2019-04-28 09:58:29 -07:00
|
|
|
// Storage
|
2017-03-24 17:23:36 -07:00
|
|
|
ClassDB::register_class<VoxelBuffer>();
|
|
|
|
ClassDB::register_class<VoxelMap>();
|
2019-04-28 09:58:29 -07:00
|
|
|
|
|
|
|
// Voxel types
|
|
|
|
ClassDB::register_class<Voxel>();
|
|
|
|
ClassDB::register_class<VoxelLibrary>();
|
|
|
|
|
|
|
|
// Nodes
|
2017-03-24 17:23:36 -07:00
|
|
|
ClassDB::register_class<VoxelTerrain>();
|
2019-05-03 16:02:10 -07:00
|
|
|
ClassDB::register_class<VoxelLodTerrain>();
|
2019-04-28 09:58:29 -07:00
|
|
|
|
2019-05-27 16:40:09 -07:00
|
|
|
// Streams
|
2019-05-25 08:07:38 -07:00
|
|
|
ClassDB::register_class<VoxelStream>();
|
2019-05-27 16:40:09 -07:00
|
|
|
ClassDB::register_class<VoxelStreamFile>();
|
2019-08-17 11:43:08 -07:00
|
|
|
ClassDB::register_class<VoxelStreamBlockFiles>();
|
2019-08-17 11:56:21 -07:00
|
|
|
ClassDB::register_class<VoxelStreamRegionFiles>();
|
2019-04-28 09:58:29 -07:00
|
|
|
|
2020-01-26 14:34:26 -08:00
|
|
|
// Generators
|
|
|
|
ClassDB::register_class<VoxelGenerator>();
|
2020-02-17 14:05:16 -08:00
|
|
|
ClassDB::register_class<VoxelGeneratorFlat>();
|
|
|
|
ClassDB::register_class<VoxelGeneratorWaves>();
|
2020-01-26 14:34:26 -08:00
|
|
|
ClassDB::register_class<VoxelGeneratorHeightmap>();
|
|
|
|
ClassDB::register_class<VoxelGeneratorImage>();
|
|
|
|
ClassDB::register_class<VoxelGeneratorNoise2D>();
|
|
|
|
ClassDB::register_class<VoxelGeneratorNoise>();
|
2020-02-19 11:26:14 -08:00
|
|
|
ClassDB::register_class<VoxelGeneratorGraph>();
|
2020-01-26 14:34:26 -08:00
|
|
|
|
2019-04-28 09:58:29 -07:00
|
|
|
// Helpers
|
2018-09-30 16:11:33 -07:00
|
|
|
ClassDB::register_class<VoxelBoxMover>();
|
2019-09-24 10:48:30 -07:00
|
|
|
ClassDB::register_class<VoxelRaycastResult>();
|
2019-09-03 14:54:40 -07:00
|
|
|
ClassDB::register_class<VoxelTool>();
|
2019-04-28 09:58:29 -07:00
|
|
|
|
|
|
|
// Meshers
|
2019-04-28 12:48:59 -07:00
|
|
|
ClassDB::register_class<VoxelMesher>();
|
2019-04-28 09:58:29 -07:00
|
|
|
ClassDB::register_class<VoxelMesherBlocky>();
|
|
|
|
ClassDB::register_class<VoxelMesherTransvoxel>();
|
|
|
|
ClassDB::register_class<VoxelMesherDMC>();
|
2019-08-29 14:55:02 -07:00
|
|
|
|
2020-01-02 12:31:05 -08:00
|
|
|
VoxelMemoryPool::create_singleton();
|
2020-01-17 12:43:28 -08:00
|
|
|
VoxelStringNames::create_singleton();
|
2020-02-19 11:26:14 -08:00
|
|
|
VoxelGeneratorGraph::NodeTypeDB::create_singleton();
|
2020-01-02 12:23:36 -08:00
|
|
|
|
2019-08-29 14:55:02 -07:00
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
VoxelDebug::create_debug_box_mesh();
|
|
|
|
#endif
|
2016-05-01 06:00:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void unregister_voxel_types() {
|
2019-08-29 14:55:02 -07:00
|
|
|
|
2020-01-25 17:59:53 -08:00
|
|
|
unsigned int used_blocks = VoxelMemoryPool::get_singleton()->debug_get_used_blocks();
|
|
|
|
if (used_blocks > 0) {
|
|
|
|
ERR_PRINT(String("VoxelMemoryPool: {0} memory blocks are still used when unregistering the module. Recycling leak?").format(varray(used_blocks)));
|
|
|
|
}
|
2020-01-02 12:31:05 -08:00
|
|
|
VoxelMemoryPool::destroy_singleton();
|
2020-01-25 17:59:53 -08:00
|
|
|
|
2020-01-17 12:43:28 -08:00
|
|
|
VoxelStringNames::destroy_singleton();
|
2020-01-02 12:23:36 -08:00
|
|
|
|
2020-02-19 11:26:14 -08:00
|
|
|
VoxelGeneratorGraph::NodeTypeDB::destroy_singleton();
|
|
|
|
|
2019-08-29 14:55:02 -07:00
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
VoxelDebug::free_debug_box_mesh();
|
|
|
|
#endif
|
2016-05-01 06:00:02 -07:00
|
|
|
}
|