summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/class_db.h4
-rw-r--r--core/color.cpp3
-rw-r--r--core/image.cpp4
-rw-r--r--core/variant_call.cpp6
4 files changed, 12 insertions, 5 deletions
diff --git a/core/class_db.h b/core/class_db.h
index f1d1879236..66a67f6c9f 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -39,6 +39,10 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
+/** To bind more then 6 parameters include this:
+ * #include "method_bind_ext.gen.inc"
+ */
+
#define DEFVAL(m_defval) (m_defval)
//#define SIMPLE_METHODDEF
diff --git a/core/color.cpp b/core/color.cpp
index fcfcf20355..0d8cad1a5e 100644
--- a/core/color.cpp
+++ b/core/color.cpp
@@ -506,8 +506,11 @@ Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) {
return Color(m + r, m + g, m + b, p_a);
}
+// FIXME: Remove once Godot 3.1 has been released
float Color::gray() const {
+ ERR_EXPLAIN("Color.gray() is deprecated and will be removed in a future version. Use Color.get_v() for a better grayscale approximation.");
+ WARN_DEPRECATED
return (r + g + b) / 3.0;
}
diff --git a/core/image.cpp b/core/image.cpp
index c94f2c3534..2fd7ea5c14 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -2230,10 +2230,10 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
switch (format) {
case FORMAT_L8: {
- ptr[ofs] = uint8_t(CLAMP(p_color.gray() * 255.0, 0, 255));
+ ptr[ofs] = uint8_t(CLAMP(p_color.get_v() * 255.0, 0, 255));
} break;
case FORMAT_LA8: {
- ptr[ofs * 2 + 0] = uint8_t(CLAMP(p_color.gray() * 255.0, 0, 255));
+ ptr[ofs * 2 + 0] = uint8_t(CLAMP(p_color.get_v() * 255.0, 0, 255));
ptr[ofs * 2 + 1] = uint8_t(CLAMP(p_color.a * 255.0, 0, 255));
} break;
case FORMAT_R8: {
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 45d7748382..1c50df75f5 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1920,9 +1920,9 @@ void register_variant_methods() {
transform_x.set(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0);
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", transform_z);
- _VariantCall::add_variant_constant(Variant::PLANE, "X", Plane(Vector3(1, 0, 0), 0));
- _VariantCall::add_variant_constant(Variant::PLANE, "Y", Plane(Vector3(0, 1, 0), 0));
- _VariantCall::add_variant_constant(Variant::PLANE, "Z", Plane(Vector3(0, 0, 1), 0));
+ _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_YZ", Plane(Vector3(1, 0, 0), 0));
+ _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_XZ", Plane(Vector3(0, 1, 0), 0));
+ _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_XY", Plane(Vector3(0, 0, 1), 0));
_VariantCall::add_variant_constant(Variant::QUAT, "IDENTITY", Quat(0, 0, 0, 1));
}