diff --git a/SCsub b/SCsub index 6e7ccd6..2aeb4fc 100644 --- a/SCsub +++ b/SCsub @@ -71,6 +71,7 @@ sources = [ if has_texture_packer: sources.append("library/terraman_library_merger.cpp") + sources.append("library/terraman_library_merger_pcm.cpp") sources.append("library/terra_surface_merger.cpp") if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': diff --git a/config.py b/config.py index 493f761..41be662 100644 --- a/config.py +++ b/config.py @@ -24,6 +24,7 @@ def get_doc_classes(): "TerramanLibraryMerger", "TerramanLibrarySimple", "TerramanLibrary", + "TerramanLibraryMergerPCM", "TerraCubePoints", "TerraMesherCubic", diff --git a/library/terraman_library_merger.h b/library/terraman_library_merger.h index 85b4785..a278a2f 100644 --- a/library/terraman_library_merger.h +++ b/library/terraman_library_merger.h @@ -104,7 +104,6 @@ protected: static void _bind_methods(); -private: Vector > _voxel_surfaces; #ifdef PROPS_PRESENT Vector > _props; diff --git a/library/terraman_library_merger_pcm.cpp b/library/terraman_library_merger_pcm.cpp new file mode 100644 index 0000000..9c4d22b --- /dev/null +++ b/library/terraman_library_merger_pcm.cpp @@ -0,0 +1,36 @@ +/* +Copyright (c) 2019-2021 Péter Magyar + +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 "terraman_library_merger_pcm.h" + +bool TerramanLibraryMergerPCM::_supports_caching() { + return true; +} + +TerramanLibraryMergerPCM::TerramanLibraryMergerPCM() { +} + +TerramanLibraryMergerPCM::~TerramanLibraryMergerPCM() { +} + +void TerramanLibraryMergerPCM::_bind_methods() { +} diff --git a/library/terraman_library_merger_pcm.h b/library/terraman_library_merger_pcm.h new file mode 100644 index 0000000..02f369a --- /dev/null +++ b/library/terraman_library_merger_pcm.h @@ -0,0 +1,52 @@ +/* +Copyright (c) 2019-2021 Péter Magyar + +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. +*/ + +#ifndef TERRAMAN_LIBRARY_MERGER_PCM_H +#define TERRAMAN_LIBRARY_MERGER_PCM_H + +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/io/resource.h" +#include "core/templates/map.h" +#else +#include "core/resource.h" +#include "core/map.h" +#endif + +#include "terraman_library_merger.h" + +//pcm = per chunk material +class TerramanLibraryMergerPCM : public TerramanLibraryMerger { + GDCLASS(TerramanLibraryMergerPCM, TerramanLibraryMerger) + +public: + bool _supports_caching(); + + TerramanLibraryMergerPCM(); + ~TerramanLibraryMergerPCM(); + +protected: + static void _bind_methods(); +}; + +#endif diff --git a/register_types.cpp b/register_types.cpp index ff06e02..31bfcb2 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -32,6 +32,7 @@ SOFTWARE. #ifdef TEXTURE_PACKER_PRESENT #include "library/terra_surface_merger.h" #include "library/terraman_library_merger.h" +#include "library/terraman_library_merger_pcm.h" #endif #include "data/terra_light.h" @@ -80,6 +81,7 @@ void register_terraman_types() { #ifdef TEXTURE_PACKER_PRESENT ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); #endif ClassDB::register_class();