2021-11-22 22:00:45 +01:00
|
|
|
/*
|
2022-02-22 10:33:06 +01:00
|
|
|
Copyright (c) 2019-2022 Péter Magyar
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "register_types.h"
|
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
#include "core/object/class_db.h"
|
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "library/terrain_2d_surface.h"
|
|
|
|
#include "library/terrain_2d_surface_simple.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "library/terrain_2d_library.h"
|
|
|
|
#include "library/terrain_2d_library_simple.h"
|
2022-03-01 23:43:07 +01:00
|
|
|
#include "library/terrain_2d_material_cache.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
#ifdef TEXTURE_PACKER_PRESENT
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "library/terrain_2d_library_merger.h"
|
|
|
|
#include "library/terrain_2d_library_merger_pcm.h"
|
|
|
|
#include "library/terrain_2d_material_cache_pcm.h"
|
2022-03-01 23:43:07 +01:00
|
|
|
#include "library/terrain_2d_surface_merger.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
#endif
|
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "data/terrain_2d_light.h"
|
|
|
|
#include "meshers/terrain_2d_mesher.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "world/block_terrain_2d_structure.h"
|
|
|
|
#include "world/terrain_2d_chunk.h"
|
|
|
|
#include "world/terrain_2d_environment_data.h"
|
|
|
|
#include "world/terrain_2d_structure.h"
|
|
|
|
#include "world/terrain_2d_world.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "world/default/terrain_2d_chunk_default.h"
|
|
|
|
#include "world/default/terrain_2d_world_default.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "level_generator/terrain_2d_level_generator.h"
|
|
|
|
#include "level_generator/terrain_2d_level_generator_flat.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "areas/terrain_2d_world_area.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "world/terrain_2d_world_editor.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-03-01 23:23:02 +01:00
|
|
|
#include "meshers/simple/terrain_2d_mesher_simple.h"
|
|
|
|
#include "world/simple/terrain_2d_chunk_simple.h"
|
|
|
|
#include "world/simple/terrain_2d_world_simple.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-03-01 23:43:07 +01:00
|
|
|
#include "meshers/isometric/terrain_2d_mesher_isometric.h"
|
|
|
|
#include "world/isometric/terrain_2d_chunk_isometric.h"
|
|
|
|
#include "world/isometric/terrain_2d_world_isometric.h"
|
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "nodes/terrain_2d_light_node.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2022-02-22 11:09:36 +01:00
|
|
|
#include "world/jobs/terrain_2d_job.h"
|
|
|
|
#include "world/jobs/terrain_2d_light_job.h"
|
|
|
|
#include "world/jobs/terrain_2d_prop_job.h"
|
|
|
|
#include "world/jobs/terrain_2d_terrain_job.h"
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
void initialize_terraman_2d_module(ModuleInitializationLevel p_level) {
|
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
|
|
|
GDREGISTER_CLASS(Terrain2DMesher);
|
|
|
|
GDREGISTER_CLASS(Terrain2DMesherDefault);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DSurface);
|
|
|
|
GDREGISTER_CLASS(Terrain2DSurfaceSimple);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DLibrary);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLibrarySimple);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DMaterialCache);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
#ifdef TEXTURE_PACKER_PRESENT
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DSurfaceMerger);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLibraryMerger);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLibraryMergerPCM);
|
|
|
|
GDREGISTER_CLASS(Terrain2DMaterialCachePCM);
|
2021-11-22 22:00:45 +01:00
|
|
|
#endif
|
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DLight);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLightNode);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DWorld);
|
|
|
|
GDREGISTER_CLASS(Terrain2DChunk);
|
|
|
|
GDREGISTER_CLASS(Terrain2DStructure);
|
|
|
|
GDREGISTER_CLASS(BlockTerrain2DStructure);
|
|
|
|
GDREGISTER_CLASS(Terrain2DEnvironmentData);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DChunkDefault);
|
|
|
|
GDREGISTER_CLASS(Terrain2DWorldDefault);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DMesherSimple);
|
|
|
|
GDREGISTER_CLASS(Terrain2DWorldSimple);
|
|
|
|
GDREGISTER_CLASS(Terrain2DChunkSimple);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DMesherIsometric);
|
|
|
|
GDREGISTER_CLASS(Terrain2DWorldIsometric);
|
|
|
|
GDREGISTER_CLASS(Terrain2DChunkIsometric);
|
2022-03-01 23:43:07 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DLevelGenerator);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLevelGeneratorFlat);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DWorldArea);
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
GDREGISTER_CLASS(Terrain2DJob);
|
|
|
|
GDREGISTER_CLASS(Terrain2DTerrain2DJob);
|
|
|
|
GDREGISTER_CLASS(Terrain2DLightJob);
|
|
|
|
GDREGISTER_CLASS(Terrain2DProp2DJob);
|
|
|
|
}
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
#ifdef TOOLS_ENABLED
|
2023-01-08 15:55:27 +01:00
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
|
|
|
|
EditorPlugins::add_by_type<Terrain2DWorldEditorPlugin>();
|
|
|
|
}
|
2021-11-22 22:00:45 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2023-01-08 15:55:27 +01:00
|
|
|
void uninitialize_terraman_2d_module(ModuleInitializationLevel p_level) {
|
2021-11-22 22:00:45 +01:00
|
|
|
}
|