diff options
| author | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2020-10-25 18:32:44 +0200 |
|---|---|---|
| committer | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2020-10-25 18:32:44 +0200 |
| commit | 8ce2f401ddce843a433e6a20fdf5c24bb9cc5a6d (patch) | |
| tree | 948ce82b1943c264ef85e4ff2cbd48d2acbc8c9e /scene/resources | |
| parent | b67ccf1a6f326c5d4d5fa1cc7cd15eff3573f8f7 (diff) | |
| download | redot-engine-8ce2f401ddce843a433e6a20fdf5c24bb9cc5a6d.tar.gz | |
Fixup `ColorRamp` to `Gradient` renames
Diffstat (limited to 'scene/resources')
| -rw-r--r-- | scene/resources/gradient.cpp | 20 | ||||
| -rw-r--r-- | scene/resources/texture.cpp | 6 |
2 files changed, 7 insertions, 19 deletions
diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index b720653f91..6b41b97e45 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -32,14 +32,8 @@ #include "core/core_string_names.h" -//setter and getter names for property serialization -#define COLOR_RAMP_GET_OFFSETS "get_offsets" -#define COLOR_RAMP_GET_COLORS "get_colors" -#define COLOR_RAMP_SET_OFFSETS "set_offsets" -#define COLOR_RAMP_SET_COLORS "set_colors" - Gradient::Gradient() { - //Set initial color ramp transition from black to white + //Set initial gradient transition from black to white points.resize(2); points.write[0].color = Color(0, 0, 0, 1); points.write[0].offset = 0; @@ -65,14 +59,14 @@ void Gradient::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_count"), &Gradient::get_points_count); - ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_OFFSETS, "offsets"), &Gradient::set_offsets); - ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_OFFSETS), &Gradient::get_offsets); + ClassDB::bind_method(D_METHOD("set_offsets", "offsets"), &Gradient::set_offsets); + ClassDB::bind_method(D_METHOD("get_offsets"), &Gradient::get_offsets); - ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_COLORS, "colors"), &Gradient::set_colors); - ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_COLORS), &Gradient::get_colors); + ClassDB::bind_method(D_METHOD("set_colors", "colors"), &Gradient::set_colors); + ClassDB::bind_method(D_METHOD("get_colors"), &Gradient::get_colors); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "offsets"), COLOR_RAMP_SET_OFFSETS, COLOR_RAMP_GET_OFFSETS); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "colors"), COLOR_RAMP_SET_COLORS, COLOR_RAMP_GET_COLORS); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "offsets"), "set_offsets", "get_offsets"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "colors"), "set_colors", "get_colors"); } Vector<float> Gradient::get_offsets() const { diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 6291d2dddb..328882fe64 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1738,12 +1738,6 @@ CurveTexture::~CurveTexture() { ////////////////// -//setter and getter names for property serialization -#define COLOR_RAMP_GET_OFFSETS "get_offsets" -#define COLOR_RAMP_GET_COLORS "get_colors" -#define COLOR_RAMP_SET_OFFSETS "set_offsets" -#define COLOR_RAMP_SET_COLORS "set_colors" - GradientTexture::GradientTexture() { update_pending = false; width = 2048; |
