From e7f28eabd33bc6425cfba14e6e59457a0598cb62 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 1 Mar 2022 23:23:02 +0100 Subject: [PATCH] Renamed the blocky mesher, world and chunk to simple. --- SCsub | 6 ++--- .../terrain_2d_mesher_simple.cpp} | 14 ++++++------ .../terrain_2d_mesher_simple.h} | 12 +++++----- register_types.cpp | 12 +++++----- .../terrain_2d_chunk_simple.cpp} | 10 ++++----- .../terrain_2d_chunk_simple.h} | 12 +++++----- .../terrain_2d_world_simple.cpp} | 22 +++++++++---------- .../terrain_2d_world_simple.h} | 8 +++---- 8 files changed, 48 insertions(+), 48 deletions(-) rename meshers/{blocky/terrain_2d_mesher_blocky.cpp => simple/terrain_2d_mesher_simple.cpp} (96%) rename meshers/{blocky/terrain_2d_mesher_blocky.h => simple/terrain_2d_mesher_simple.h} (86%) rename world/{blocky/terrain_2d_chunk_blocky.cpp => simple/terrain_2d_chunk_simple.cpp} (85%) rename world/{blocky/terrain_2d_chunk_blocky.h => simple/terrain_2d_chunk_simple.h} (83%) rename world/{blocky/terrain_2d_world_blocky.cpp => simple/terrain_2d_world_simple.cpp} (77%) rename world/{blocky/terrain_2d_world_blocky.h => simple/terrain_2d_world_simple.h} (88%) diff --git a/SCsub b/SCsub index a8c3ae5..13e4cf3 100644 --- a/SCsub +++ b/SCsub @@ -38,7 +38,7 @@ sources = [ "meshers/terrain_2d_mesher.cpp", - "meshers/blocky/terrain_2d_mesher_blocky.cpp", + "meshers/simple/terrain_2d_mesher_simple.cpp", "meshers/default/terrain_2d_mesher_default.cpp", "world/terrain_2d_world.cpp", @@ -47,8 +47,8 @@ sources = [ "world/block_terrain_2d_structure.cpp", "world/terrain_2d_environment_data.cpp", - "world/blocky/terrain_2d_chunk_blocky.cpp", - "world/blocky/terrain_2d_world_blocky.cpp", + "world/simple/terrain_2d_chunk_simple.cpp", + "world/simple/terrain_2d_world_simple.cpp", "world/default/terrain_2d_world_default.cpp", "world/default/terrain_2d_chunk_default.cpp", diff --git a/meshers/blocky/terrain_2d_mesher_blocky.cpp b/meshers/simple/terrain_2d_mesher_simple.cpp similarity index 96% rename from meshers/blocky/terrain_2d_mesher_blocky.cpp rename to meshers/simple/terrain_2d_mesher_simple.cpp index a2cb11f..09df1ca 100644 --- a/meshers/blocky/terrain_2d_mesher_blocky.cpp +++ b/meshers/simple/terrain_2d_mesher_simple.cpp @@ -20,13 +20,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "terrain_2d_mesher_blocky.h" +#include "terrain_2d_mesher_simple.h" #include "core/math/math_funcs.h" #include "../../library/terrain_2d_material_cache.h" -void Terrain2DMesherBlocky::_add_chunk(Ref p_chunk) { +void Terrain2DMesherSimple::_add_chunk(Ref p_chunk) { Ref chunk = p_chunk; ERR_FAIL_COND(!chunk.is_valid()); @@ -36,7 +36,7 @@ void Terrain2DMesherBlocky::_add_chunk(Ref p_chunk) { add_chunk_normal(chunk); } -void Terrain2DMesherBlocky::add_chunk_normal(Ref chunk) { +void Terrain2DMesherSimple::add_chunk_normal(Ref chunk) { //if ((get_build_flags() & Terrain2DChunkDefault::BUILD_FLAG_GENERATE_AO) != 0) // if (!chunk->get_channel(Terrain2DChunkDefault::DEFAULT_CHANNEL_AO)) // chunk->generate_ao(); @@ -340,12 +340,12 @@ void Terrain2DMesherBlocky::add_chunk_normal(Ref chunk) { } } -Terrain2DMesherBlocky::Terrain2DMesherBlocky() { +Terrain2DMesherSimple::Terrain2DMesherSimple() { } -Terrain2DMesherBlocky::~Terrain2DMesherBlocky() { +Terrain2DMesherSimple::~Terrain2DMesherSimple() { } -void Terrain2DMesherBlocky::_bind_methods() { - ClassDB::bind_method(D_METHOD("_add_chunk", "buffer"), &Terrain2DMesherBlocky::_add_chunk); +void Terrain2DMesherSimple::_bind_methods() { + ClassDB::bind_method(D_METHOD("_add_chunk", "buffer"), &Terrain2DMesherSimple::_add_chunk); } diff --git a/meshers/blocky/terrain_2d_mesher_blocky.h b/meshers/simple/terrain_2d_mesher_simple.h similarity index 86% rename from meshers/blocky/terrain_2d_mesher_blocky.h rename to meshers/simple/terrain_2d_mesher_simple.h index 84449dc..f0cea1f 100644 --- a/meshers/blocky/terrain_2d_mesher_blocky.h +++ b/meshers/simple/terrain_2d_mesher_simple.h @@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef TERRAIN_2D_MESHER_BLOCKY_H -#define TERRAIN_2D_MESHER_BLOCKY_H +#ifndef TERRAIN_2D_MESHER_SIMPLE_H +#define TERRAIN_2D_MESHER_SIMPLE_H #include "core/version.h" @@ -37,16 +37,16 @@ SOFTWARE. #include "../default/terrain_2d_mesher_default.h" #include "../../world/default/terrain_2d_chunk_default.h" -class Terrain2DMesherBlocky : public Terrain2DMesherDefault { - GDCLASS(Terrain2DMesherBlocky, Terrain2DMesherDefault); +class Terrain2DMesherSimple : public Terrain2DMesherDefault { + GDCLASS(Terrain2DMesherSimple, Terrain2DMesherDefault); public: void _add_chunk(Ref p_chunk); void add_chunk_normal(Ref chunk); - Terrain2DMesherBlocky(); - ~Terrain2DMesherBlocky(); + Terrain2DMesherSimple(); + ~Terrain2DMesherSimple(); protected: static void _bind_methods(); diff --git a/register_types.cpp b/register_types.cpp index be9411a..90925b5 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -55,10 +55,10 @@ SOFTWARE. #include "world/terrain_2d_world_editor.h" -#include "meshers/blocky/terrain_2d_mesher_blocky.h" +#include "meshers/simple/terrain_2d_mesher_simple.h" -#include "world/blocky/terrain_2d_chunk_blocky.h" -#include "world/blocky/terrain_2d_world_blocky.h" +#include "world/simple/terrain_2d_chunk_simple.h" +#include "world/simple/terrain_2d_world_simple.h" #include "nodes/terrain_2d_light_node.h" @@ -98,9 +98,9 @@ void register_terraman_2d_types() { ClassDB::register_class(); ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); diff --git a/world/blocky/terrain_2d_chunk_blocky.cpp b/world/simple/terrain_2d_chunk_simple.cpp similarity index 85% rename from world/blocky/terrain_2d_chunk_blocky.cpp rename to world/simple/terrain_2d_chunk_simple.cpp index b9871f8..287ec78 100644 --- a/world/blocky/terrain_2d_chunk_blocky.cpp +++ b/world/simple/terrain_2d_chunk_simple.cpp @@ -20,20 +20,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "terrain_2d_chunk_blocky.h" +#include "terrain_2d_chunk_simple.h" #include "../../defines.h" -Terrain2DChunkBlocky::Terrain2DChunkBlocky() { +Terrain2DChunkSimple::Terrain2DChunkSimple() { } -Terrain2DChunkBlocky::~Terrain2DChunkBlocky() { +Terrain2DChunkSimple::~Terrain2DChunkSimple() { } -void Terrain2DChunkBlocky::_setup_channels() { +void Terrain2DChunkSimple::_setup_channels() { channel_set_count(MAX_DEFAULT_CHANNELS); } -void Terrain2DChunkBlocky::_bind_methods() { +void Terrain2DChunkSimple::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::POOL_BYTE_ARRAY, "data_channel"), "channel_set_compressed", "channel_get_compressed", 0); } diff --git a/world/blocky/terrain_2d_chunk_blocky.h b/world/simple/terrain_2d_chunk_simple.h similarity index 83% rename from world/blocky/terrain_2d_chunk_blocky.h rename to world/simple/terrain_2d_chunk_simple.h index 21a06b6..6408238 100644 --- a/world/blocky/terrain_2d_chunk_blocky.h +++ b/world/simple/terrain_2d_chunk_simple.h @@ -20,17 +20,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef TERRAIN_2D_CHUNK_BLOCKY_H -#define TERRAIN_2D_CHUNK_BLOCKY_H +#ifndef TERRAIN_2D_CHUNK_SIMPLE_H +#define TERRAIN_2D_CHUNK_SIMPLE_H #include "../default/terrain_2d_chunk_default.h" -class Terrain2DChunkBlocky : public Terrain2DChunkDefault { - GDCLASS(Terrain2DChunkBlocky, Terrain2DChunkDefault); +class Terrain2DChunkSimple : public Terrain2DChunkDefault { + GDCLASS(Terrain2DChunkSimple, Terrain2DChunkDefault); public: - Terrain2DChunkBlocky(); - ~Terrain2DChunkBlocky(); + Terrain2DChunkSimple(); + ~Terrain2DChunkSimple(); protected: virtual void _setup_channels(); diff --git a/world/blocky/terrain_2d_world_blocky.cpp b/world/simple/terrain_2d_world_simple.cpp similarity index 77% rename from world/blocky/terrain_2d_world_blocky.cpp rename to world/simple/terrain_2d_world_simple.cpp index 2c96758..3adc547 100644 --- a/world/blocky/terrain_2d_world_blocky.cpp +++ b/world/simple/terrain_2d_world_simple.cpp @@ -20,18 +20,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "terrain_2d_world_blocky.h" +#include "terrain_2d_world_simple.h" -#include "terrain_2d_chunk_blocky.h" +#include "terrain_2d_chunk_simple.h" -#include "../../meshers/blocky/terrain_2d_mesher_blocky.h" +#include "../../meshers/simple/terrain_2d_mesher_simple.h" #include "../jobs/terrain_2d_light_job.h" #include "../jobs/terrain_2d_prop_job.h" #include "../jobs/terrain_2d_terrain_job.h" -Ref Terrain2DWorldBlocky::_create_chunk(int x, int y, Ref chunk) { +Ref Terrain2DWorldSimple::_create_chunk(int x, int y, Ref chunk) { if (!chunk.is_valid()) { - chunk = Ref(memnew(Terrain2DChunkBlocky)); + chunk = Ref(memnew(Terrain2DChunkSimple)); } if (chunk->job_get_count() == 0) { @@ -41,16 +41,16 @@ Ref Terrain2DWorldBlocky::_create_chunk(int x, int y, Ref lj; lj.instance(); - tj->set_mesher(Ref(memnew(Terrain2DMesherBlocky()))); + tj->set_mesher(Ref(memnew(Terrain2DMesherSimple()))); - Ref liquid_mesher; + Ref liquid_mesher; liquid_mesher.instance(); liquid_mesher->set_channel_index_type(Terrain2DChunkDefault::DEFAULT_CHANNEL_LIQUID_TYPE); tj->set_liquid_mesher(liquid_mesher); Ref pj; pj.instance(); - pj->set_prop_mesher(Ref(memnew(Terrain2DMesherBlocky))); + pj->set_prop_mesher(Ref(memnew(Terrain2DMesherSimple))); chunk->job_add(lj); chunk->job_add(tj); @@ -60,13 +60,13 @@ Ref Terrain2DWorldBlocky::_create_chunk(int x, int y, Ref _create_chunk(int x, int y, Ref p_chunk);