diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/line_builder.h | 2 | ||||
-rw-r--r-- | scene/gui/control.h | 2 | ||||
-rw-r--r-- | scene/gui/reference_rect.cpp | 18 | ||||
-rw-r--r-- | scene/gui/reference_rect.h | 5 | ||||
-rw-r--r-- | scene/main/node.cpp | 2 | ||||
-rw-r--r-- | scene/main/viewport.h | 2 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 1 | ||||
-rw-r--r-- | scene/resources/material.cpp | 2 | ||||
-rw-r--r-- | scene/resources/texture.h | 2 |
9 files changed, 27 insertions, 9 deletions
diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h index b1c62f84e2..edfdf97c47 100644 --- a/scene/2d/line_builder.h +++ b/scene/2d/line_builder.h @@ -33,8 +33,8 @@ #include "color.h" #include "line_2d.h" -#include "math_2d.h" #include "scene/resources/color_ramp.h" +#include "vector2.h" class LineBuilder { public: diff --git a/scene/gui/control.h b/scene/gui/control.h index 6bea04345b..c6bd2f097d 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -31,13 +31,13 @@ #ifndef CONTROL_H #define CONTROL_H -#include "math_2d.h" #include "rid.h" #include "scene/2d/canvas_item.h" #include "scene/gui/shortcut.h" #include "scene/main/node.h" #include "scene/main/timer.h" #include "scene/resources/theme.h" +#include "transform_2d.h" /** @author Juan Linietsky <reduzio@gmail.com> */ diff --git a/scene/gui/reference_rect.cpp b/scene/gui/reference_rect.cpp index 5e25f43daf..74e68598f4 100644 --- a/scene/gui/reference_rect.cpp +++ b/scene/gui/reference_rect.cpp @@ -39,9 +39,25 @@ void ReferenceRect::_notification(int p_what) { if (!is_inside_tree()) return; if (Engine::get_singleton()->is_editor_hint()) - draw_style_box(get_stylebox("border"), Rect2(Point2(), get_size())); + draw_rect(Rect2(Point2(), get_size()), border_color, false); } } +void ReferenceRect::set_border_color(const Color &color) { + border_color = color; +} + +Color ReferenceRect::get_border_color() const { + return border_color; +} + +void ReferenceRect::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_border_color"), &ReferenceRect::get_border_color); + ClassDB::bind_method(D_METHOD("set_border_color", "color"), &ReferenceRect::set_border_color); + + ADD_PROPERTY(PropertyInfo(Variant::COLOR, "border_color"), "set_border_color", "get_border_color"); +} + ReferenceRect::ReferenceRect() { + border_color = Color(1, 0, 0); } diff --git a/scene/gui/reference_rect.h b/scene/gui/reference_rect.h index 473e348c85..9fad1a06b0 100644 --- a/scene/gui/reference_rect.h +++ b/scene/gui/reference_rect.h @@ -36,12 +36,17 @@ class ReferenceRect : public Control { GDCLASS(ReferenceRect, Control); + Color border_color; protected: void _notification(int p_what); + static void _bind_methods(); public: ReferenceRect(); + + void set_border_color(const Color &color); + Color get_border_color() const; }; #endif // REFERENCE_RECT_H diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 372ad7367e..d6a80bfb1a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2555,7 +2555,7 @@ void Node::clear_internal_tree_resource_paths() { String Node::get_configuration_warning() const { - if (get_script_instance()) { + if (get_script_instance() && get_script_instance()->has_method("_get_configuration_warning")) { return get_script_instance()->call("_get_configuration_warning"); } return String(); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index e717d27069..e4ef373c77 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -31,11 +31,11 @@ #ifndef VIEWPORT_H #define VIEWPORT_H -#include "math_2d.h" #include "scene/main/node.h" #include "scene/resources/texture.h" #include "scene/resources/world_2d.h" #include "servers/visual_server.h" +#include "transform_2d.h" /** @author Juan Linietsky <reduzio@gmail.com> */ diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 2d05f5e19f..0eee2ae393 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -867,7 +867,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const Ref<StyleBoxTexture> ttnc = make_stylebox(full_panel_bg_png, 8, 8, 8, 8); ttnc->set_draw_center(false); - theme->set_stylebox("border", "ReferenceRect", make_stylebox(reference_border_png, 4, 4, 4, 4)); theme->set_stylebox("panelnc", "Panel", ttnc); theme->set_stylebox("panelf", "Panel", tc_sb); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index dc29102492..875b72159a 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -694,8 +694,6 @@ void SpatialMaterial::_update_shader() { } code += "\t\tbase_uv=ofs;\n"; - code += "\t\tif(base_uv.x > 1.0 || base_uv.y > 1.0 || base_uv.x < 0.0 || base_uv.y < 0.0)\n"; - code += "\t\t\tdiscard;\n"; if (features[FEATURE_DETAIL] && detail_uv == DETAIL_UV_2) { code += "\t\tbase_uv2-=ofs;\n"; } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index c15efb6eaa..c1331fb3fe 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -33,9 +33,9 @@ #include "curve.h" #include "io/resource_loader.h" -#include "math_2d.h" #include "os/mutex.h" #include "os/thread_safe.h" +#include "rect2.h" #include "resource.h" #include "scene/resources/color_ramp.h" #include "servers/visual_server.h" |