Use LocalVector for Curve and Gradient

This commit is contained in:
Nazarii
2025-01-08 11:13:05 +02:00
parent 76c8e76560
commit 8bfb5d74b3
7 changed files with 141 additions and 149 deletions
+11 -8
View File
@@ -200,10 +200,11 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a basic noise texture with mip
noise_texture->set_noise(noise);
Ref<Gradient> gradient = memnew(Gradient);
Vector<Gradient::Point> points;
points.push_back({ 0.0, Color(1, 0, 0) });
points.push_back({ 1.0, Color(0, 0, 1) });
gradient->set_points(points);
Vector<float> offsets = { 0.0, 1.0 };
Vector<Color> colors = { Color(1, 0, 0), Color(0, 0, 1) };
gradient->set_offsets(offsets);
gradient->set_colors(colors);
noise_texture->set_color_ramp(gradient);
noise_texture->set_width(16);
noise_texture->set_height(16);
@@ -251,10 +252,12 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a seamless noise texture") {
SUBCASE("16x16 modulated with default (transparent)black and white gradient (RGBA8), with seamless blend skirt of 1.0") {
Ref<Gradient> gradient = memnew(Gradient);
Vector<Gradient::Point> points;
points.push_back({ 0.0, Color(0, 0, 0, 0) });
points.push_back({ 1.0, Color(1, 1, 1, 1) });
gradient->set_points(points);
Vector<float> offsets = { 0.0, 1.0 };
Vector<Color> colors = { Color(0, 0, 0, 0), Color(1, 1, 1, 1) };
gradient->set_offsets(offsets);
gradient->set_colors(colors);
noise_texture->set_color_ramp(gradient);
noise_texture->set_seamless_blend_skirt(1.0);
noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_rgba));