diff options
author | VolTer <mew.pur.pur@abv.bg> | 2023-01-02 16:52:05 +0200 |
---|---|---|
committer | VolTer <mew.pur.pur@abv.bg> | 2023-01-02 16:52:05 +0200 |
commit | 1af833be95129f1449ab3bc3609891738310b4ee (patch) | |
tree | 47c105066167776bf0d634cb04c5993098e01f50 /scene | |
parent | 1c5cfc4675826db05d6e7dc42b337e8b1282de08 (diff) |
Rename get_points_count() to get_point_count() internally
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/line_builder.cpp | 4 | ||||
-rw-r--r-- | scene/resources/gradient.cpp | 4 | ||||
-rw-r--r-- | scene/resources/gradient.h | 2 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 2bbe88b0e0..3936724dd4 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -380,7 +380,7 @@ void LineBuilder::build() { current_distance1 += pos0.distance_to(pos1); } if (_interpolate_color) { - color1 = gradient->get_color(gradient->get_points_count() - 1); + color1 = gradient->get_color(gradient->get_point_count() - 1); } if (retrieve_curve) { width_factor = curve->sample_baked(1.f); @@ -406,7 +406,7 @@ void LineBuilder::build() { // End cap (round) if (end_cap_mode == Line2D::LINE_CAP_ROUND) { // Note: color is not used in case we don't interpolate... - Color color = _interpolate_color ? gradient->get_color(gradient->get_points_count() - 1) : Color(0, 0, 0); + Color color = _interpolate_color ? gradient->get_color(gradient->get_point_count() - 1) : Color(0, 0, 0); float dist = 0; if (texture_mode == Line2D::LINE_TEXTURE_TILE) { dist = width_factor / tile_aspect; diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index f04eb75d86..4890bb32c4 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -58,7 +58,7 @@ void Gradient::_bind_methods() { ClassDB::bind_method(D_METHOD("sample", "offset"), &Gradient::get_color_at_offset); - ClassDB::bind_method(D_METHOD("get_point_count"), &Gradient::get_points_count); + ClassDB::bind_method(D_METHOD("get_point_count"), &Gradient::get_point_count); ClassDB::bind_method(D_METHOD("set_offsets", "offsets"), &Gradient::set_offsets); ClassDB::bind_method(D_METHOD("get_offsets"), &Gradient::get_offsets); @@ -190,6 +190,6 @@ Color Gradient::get_color(int pos) { return points[pos].color; } -int Gradient::get_points_count() const { +int Gradient::get_point_count() const { return points.size(); } diff --git a/scene/resources/gradient.h b/scene/resources/gradient.h index 2b91331ab0..16ddf5df2a 100644 --- a/scene/resources/gradient.h +++ b/scene/resources/gradient.h @@ -171,7 +171,7 @@ public: } } - int get_points_count() const; + int get_point_count() const; }; VARIANT_ENUM_CAST(Gradient::InterpolationMode); diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 2106619a6b..9c600b580c 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2310,9 +2310,9 @@ void GradientTexture2D::_update() { Ref<Image> image; image.instantiate(); - if (gradient->get_points_count() <= 1) { // No need to interpolate. + if (gradient->get_point_count() <= 1) { // No need to interpolate. image->initialize_data(width, height, false, (use_hdr) ? Image::FORMAT_RGBAF : Image::FORMAT_RGBA8); - image->fill((gradient->get_points_count() == 1) ? gradient->get_color(0) : Color(0, 0, 0, 1)); + image->fill((gradient->get_point_count() == 1) ? gradient->get_color(0) : Color(0, 0, 0, 1)); } else { if (use_hdr) { image->initialize_data(width, height, false, Image::FORMAT_RGBAF); |