Skip to content

Commit

Permalink
Lower min brush size; Reduce bounds error to info
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Sep 24, 2024
1 parent f83779d commit 93dade4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/terrain_3d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Ref<Terrain3DRegion> Terrain3DEditor::_operate_region(const Vector2i &p_region_l
}
if (data->get_region_map_index(p_region_loc) < 0) {
if (can_print) {
LOG(ERROR, "Location ", p_region_loc, " out of bounds. Max: ",
LOG(INFO, "Location ", p_region_loc, " out of bounds. Max: ",
-Terrain3DData::REGION_MAP_SIZE / 2, " to ", Terrain3DData::REGION_MAP_SIZE / 2 - 1);
}
return Ref<Terrain3DRegion>();
Expand Down Expand Up @@ -608,7 +608,7 @@ void Terrain3DEditor::set_brush_data(const Dictionary &p_data) {

// Santize settings
// size is redundantly clamped differently in _operate_map and instancer::add_transforms
_brush_data["size"] = CLAMP(real_t(p_data.get("size", 10.f)), 0.5f, 4096.f); // Diameter in meters
_brush_data["size"] = CLAMP(real_t(p_data.get("size", 10.f)), 0.1f, 4096.f); // Diameter in meters
_brush_data["strength"] = CLAMP(real_t(p_data.get("strength", .1f)) * .01f, .01f, 1000.f); // 1-100k% (max of 1000m per click)
// mouse_pressure injected in editor.gd and sanitized in _operate_map()
_brush_data["height"] = CLAMP(real_t(p_data.get("height", 0.f)), -65536.f, 65536.f); // Meters
Expand Down
2 changes: 1 addition & 1 deletion src/terrain_3d_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ inline bool gd_is_nav(const uint32_t p_pixel) { return is_nav(p_pixel); }

inline bool is_auto(const uint32_t p_pixel) { return (p_pixel & 0x1) == 1; }
inline bool is_auto(const float p_pixel) { return is_auto(as_uint(p_pixel)); }
inline uint32_t enc_auto(const bool p_autosh) { return p_autosh & 0x1; }
inline uint32_t enc_auto(const bool p_auto) { return p_auto & 0x1; }
inline bool gd_is_auto(const uint32_t p_pixel) { return is_auto(p_pixel); }

///////////////////////////
Expand Down

0 comments on commit 93dade4

Please sign in to comment.