Remove unused values from the build flags enum.

This commit is contained in:
Relintai 2022-02-24 17:04:35 +01:00
parent bac9329808
commit f722a9ea6b
4 changed files with 11 additions and 18 deletions

View File

@ -170,7 +170,7 @@ void Terrain2DMesherDefault::_bake_liquid_colors(Ref<Terrain2DChunk> chunk) {
}
Terrain2DMesherDefault::Terrain2DMesherDefault() {
_build_flags = Terrain2DChunkDefault::BUILD_FLAG_CREATE_COLLIDER | Terrain2DChunkDefault::BUILD_FLAG_CREATE_LODS;
_build_flags = Terrain2DChunkDefault::BUILD_FLAG_CREATE_COLLIDER;
_format = VisualServer::ARRAY_FORMAT_NORMAL | VisualServer::ARRAY_FORMAT_TEX_UV;
}

View File

@ -39,7 +39,7 @@ SOFTWARE.
#include "../jobs/terrain_2d_prop_job.h"
#include "../jobs/terrain_2d_terrain_job.h"
const String Terrain2DChunkDefault::BINDING_STRING_BUILD_FLAGS = "Use Isolevel,Use Lighting,Use AO,Use RAO,Generate AO,Generate RAO,Bake Lights,Create Collider,Create Lods";
const String Terrain2DChunkDefault::BINDING_STRING_BUILD_FLAGS = "Use Lighting,Use AO,Use RAO,Generate AO,Generate RAO,Bake Lights,Create Collider";
_FORCE_INLINE_ int Terrain2DChunkDefault::get_build_flags() const {
return _build_flags;
@ -828,7 +828,7 @@ Terrain2DChunkDefault::Terrain2DChunkDefault() {
_enabled = true;
_build_flags = BUILD_FLAG_CREATE_COLLIDER | BUILD_FLAG_CREATE_LODS;
_build_flags = BUILD_FLAG_CREATE_COLLIDER;
}
Terrain2DChunkDefault::~Terrain2DChunkDefault() {
@ -942,7 +942,6 @@ void Terrain2DChunkDefault::_bind_methods() {
BIND_CONSTANT(MESH_TYPE_INDEX_AREA);
BIND_CONSTANT(MESH_TYPE_INDEX_TEXTURE_RID);
BIND_ENUM_CONSTANT(BUILD_FLAG_USE_ISOLEVEL);
BIND_ENUM_CONSTANT(BUILD_FLAG_USE_LIGHTING);
BIND_ENUM_CONSTANT(BUILD_FLAG_USE_AO);
BIND_ENUM_CONSTANT(BUILD_FLAG_USE_RAO);
@ -950,5 +949,4 @@ void Terrain2DChunkDefault::_bind_methods() {
BIND_ENUM_CONSTANT(BUILD_FLAG_AUTO_GENERATE_RAO);
BIND_ENUM_CONSTANT(BUILD_FLAG_BAKE_LIGHTS);
BIND_ENUM_CONSTANT(BUILD_FLAG_CREATE_COLLIDER);
BIND_ENUM_CONSTANT(BUILD_FLAG_CREATE_LODS);
}

View File

@ -88,15 +88,13 @@ public:
};
enum BuildFlags {
BUILD_FLAG_USE_ISOLEVEL = 1 << 0,
BUILD_FLAG_USE_LIGHTING = 1 << 1,
BUILD_FLAG_USE_AO = 1 << 2,
BUILD_FLAG_USE_RAO = 1 << 3,
BUILD_FLAG_GENERATE_AO = 1 << 4,
BUILD_FLAG_AUTO_GENERATE_RAO = 1 << 5,
BUILD_FLAG_BAKE_LIGHTS = 1 << 6,
BUILD_FLAG_CREATE_COLLIDER = 1 << 7,
BUILD_FLAG_CREATE_LODS = 1 << 8,
BUILD_FLAG_USE_LIGHTING = 1 << 0,
BUILD_FLAG_USE_AO = 1 << 1,
BUILD_FLAG_USE_RAO = 1 << 2,
BUILD_FLAG_GENERATE_AO = 1 << 3,
BUILD_FLAG_AUTO_GENERATE_RAO = 1 << 4,
BUILD_FLAG_BAKE_LIGHTS = 1 << 5,
BUILD_FLAG_CREATE_COLLIDER = 1 << 6,
};
public:

View File

@ -159,7 +159,7 @@ int Terrain2DWorldDefault::_get_channel_index_info(const Terrain2DWorld::Channel
}
Terrain2DWorldDefault::Terrain2DWorldDefault() {
_build_flags = Terrain2DChunkDefault::BUILD_FLAG_CREATE_COLLIDER | Terrain2DChunkDefault::BUILD_FLAG_CREATE_LODS;
_build_flags = Terrain2DChunkDefault::BUILD_FLAG_CREATE_COLLIDER;
set_data_margin_start(1);
set_data_margin_end(1);
@ -198,9 +198,6 @@ void Terrain2DWorldDefault::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_INTERNAL_PROCESS: {
if ((get_build_flags() & Terrain2DChunkDefault::BUILD_FLAG_CREATE_LODS) == 0)
return;
if (!get_player()) {
return;
}