Skip to content

Commit

Permalink
Fix override warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Aug 1, 2024
1 parent 7b492e3 commit 860de6b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/terrain_3d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ void Terrain3DEditor::_operate_map(const Vector3 &p_global_position, const real_
_region_modified(p_global_position);
}
}
if (_tool < 0 || _tool >= REGION) {
LOG(ERROR, "Invalid tool selected");
return;
}

Terrain3DStorage::MapType map_type;
switch (_tool) {
Expand All @@ -99,6 +95,7 @@ void Terrain3DEditor::_operate_map(const Vector3 &p_global_position, const real_
map_type = Terrain3DStorage::TYPE_COLOR;
break;
default:
LOG(ERROR, "Invalid tool selected");
return;
}

Expand Down Expand Up @@ -522,6 +519,9 @@ Dictionary Terrain3DEditor::_get_undo_data() const {
data["multimeshes"] = _terrain->get_storage()->get_multimeshes().duplicate(true);
LOG(DEBUG, "Storing Multimesh: ", data["multimeshes"]);
break;

default:
return data;
}
return data;
}
Expand Down Expand Up @@ -688,7 +688,7 @@ void Terrain3DEditor::operate(const Vector3 &p_global_position, const real_t p_c

if (_tool == REGION) {
_operate_region(p_global_position);
} else if (_tool >= 0 && _tool < REGION) {
} else if (_tool >= 0 && _tool < TOOL_MAX) {
_operate_map(p_global_position, p_camera_direction);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/terrain_3d_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ class Terrain3DEditor : public Object {
};

enum Tool {
REGION,
HEIGHT,
TEXTURE,
COLOR,
ROUGHNESS,
ANGLE,
SCALE,
AUTOSHADER,
HOLES,
NAVIGATION,
INSTANCER,
REGION,
ANGLE, // used for picking, TODO change to a picking tool
SCALE, // used for picking
TOOL_MAX,
};

static inline const char *TOOLNAME[] = {
"Region",
"Height",
"Texture",
"Color",
"Roughness",
"Angle",
"Scale",
"Auto Shader",
"Holes",
"Navigation",
"Instancer",
"Region",
"Angle",
"Scale",
"TOOL_MAX",
};

Expand Down
2 changes: 1 addition & 1 deletion src/terrain_3d_mesh_asset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Ref<ArrayMesh> Terrain3DMeshAsset::_get_generated_mesh() const {
int i, j, prevrow, thisrow, point = 0;
float x, z;
Size2 start_pos = Vector2(_generated_size.x * -0.5, -0.5f);
Vector3 normal = normal = Vector3(0.0, 0.0, 1.0);
Vector3 normal = Vector3(0.0, 0.0, 1.0);

#define ADD_TANGENT(m_x, m_y, m_z, m_d) \
tangents.push_back(m_x); \
Expand Down
10 changes: 5 additions & 5 deletions src/terrain_3d_mesh_asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class Terrain3DMeshAsset : public Terrain3DAssetResource {
Terrain3DMeshAsset();
~Terrain3DMeshAsset() {}

void clear();
void clear() override;

void set_name(const String &p_name);
String get_name() const { return _name; }
void set_name(const String &p_name) override;
String get_name() const override { return _name; }

void set_id(const int p_new_id);
int get_id() const { return _id; }
void set_id(const int p_new_id) override;
int get_id() const override { return _id; }

void set_height_offset(const real_t p_offset);
real_t get_height_offset() const { return _height_offset; }
Expand Down
10 changes: 5 additions & 5 deletions src/terrain_3d_texture_asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class Terrain3DTextureAsset : public Terrain3DAssetResource {
Terrain3DTextureAsset();
~Terrain3DTextureAsset();

void clear();
void clear() override;

void set_name(const String &p_name);
String get_name() const { return _name; }
void set_name(const String &p_name) override;
String get_name() const override { return _name; }

void set_id(const int p_new_id);
int get_id() const { return _id; }
void set_id(const int p_new_id) override;
int get_id() const override { return _id; }

void set_albedo_color(const Color &p_color);
Color get_albedo_color() const { return _albedo_color; }
Expand Down

0 comments on commit 860de6b

Please sign in to comment.