diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-12 13:44:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 13:44:43 +0200 |
commit | 4f51211dfb5bc894ffaf285a450b3670123348b8 (patch) | |
tree | 1989c843c8e188309c326c5a0b1a8dee01662f5f /core | |
parent | 5f8f8e4922765f729f3176ea0ae8eb807a0281d5 (diff) | |
parent | 6aa5bc23470fbf82492a825663f3c13cde0d1323 (diff) |
Merge pull request #11028 from mrawlingst/color-RGBA32
Change Color.to_32() to Color.to_rgba32() and lowercase other functions
Diffstat (limited to 'core')
-rw-r--r-- | core/color.cpp | 12 | ||||
-rw-r--r-- | core/color.h | 6 | ||||
-rw-r--r-- | core/variant_call.cpp | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/core/color.cpp b/core/color.cpp index ab264d31d4..259a4988b1 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -34,7 +34,7 @@ #include "math_funcs.h" #include "print_string.h" -uint32_t Color::to_ARGB32() const { +uint32_t Color::to_argb32() const { uint32_t c = (uint8_t)(a * 255); c <<= 8; @@ -47,7 +47,7 @@ uint32_t Color::to_ARGB32() const { return c; } -uint32_t Color::to_ABGR32() const { +uint32_t Color::to_abgr32() const { uint32_t c = (uint8_t)(a * 255); c <<= 8; c |= (uint8_t)(b * 255); @@ -59,15 +59,15 @@ uint32_t Color::to_ABGR32() const { return c; } -uint32_t Color::to_32() const { +uint32_t Color::to_rgba32() const { - uint32_t c = (uint8_t)(a * 255); - c <<= 8; - c |= (uint8_t)(r * 255); + uint32_t c = (uint8_t)(r * 255); c <<= 8; c |= (uint8_t)(g * 255); c <<= 8; c |= (uint8_t)(b * 255); + c <<= 8; + c |= (uint8_t)(a * 255); return c; } diff --git a/core/color.h b/core/color.h index cd5510cf01..d3d5db09f9 100644 --- a/core/color.h +++ b/core/color.h @@ -51,9 +51,9 @@ struct Color { bool operator==(const Color &p_color) const { return (r == p_color.r && g == p_color.g && b == p_color.b && a == p_color.a); } bool operator!=(const Color &p_color) const { return (r != p_color.r || g != p_color.g || b != p_color.b || a != p_color.a); } - uint32_t to_32() const; - uint32_t to_ARGB32() const; - uint32_t to_ABGR32() const; + uint32_t to_rgba32() const; + uint32_t to_argb32() const; + uint32_t to_abgr32() const; float gray() const; float get_h() const; float get_s() const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index dc1c24d234..d5bd79c890 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -428,8 +428,8 @@ struct _VariantCall { VCALL_LOCALMEM2R(Quat, slerpni); VCALL_LOCALMEM4R(Quat, cubic_slerp); - VCALL_LOCALMEM0R(Color, to_32); - VCALL_LOCALMEM0R(Color, to_ARGB32); + VCALL_LOCALMEM0R(Color, to_rgba32); + VCALL_LOCALMEM0R(Color, to_argb32); VCALL_LOCALMEM0R(Color, gray); VCALL_LOCALMEM0R(Color, inverted); VCALL_LOCALMEM0R(Color, contrasted); @@ -1524,8 +1524,8 @@ void register_variant_methods() { ADDFUNC2(QUAT, QUAT, Quat, slerpni, QUAT, "b", REAL, "t", varray()); ADDFUNC4(QUAT, QUAT, Quat, cubic_slerp, QUAT, "b", QUAT, "pre_a", QUAT, "post_b", REAL, "t", varray()); - ADDFUNC0(COLOR, INT, Color, to_32, varray()); - ADDFUNC0(COLOR, INT, Color, to_ARGB32, varray()); + ADDFUNC0(COLOR, INT, Color, to_rgba32, varray()); + ADDFUNC0(COLOR, INT, Color, to_argb32, varray()); ADDFUNC0(COLOR, REAL, Color, gray, varray()); ADDFUNC0(COLOR, COLOR, Color, inverted, varray()); ADDFUNC0(COLOR, COLOR, Color, contrasted, varray()); |