diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-12-09 13:01:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 13:01:50 +0100 |
commit | 114f97ff110aa0b5c54ea1c8279b21dc73c5efc8 (patch) | |
tree | 065ed6b74f7e0171c1bc9f8d94fcee2f01d7f7cb /scene | |
parent | e48d1b3f518d24a5ff0cb7f636c07162873fa63e (diff) | |
parent | 2c048ea16429cfa4e6b200a4fe519ee9db7c3f99 (diff) |
Merge pull request #44128 from KoBeWi/🧹
Cleanup unused engine code
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/line_builder.cpp | 33 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 3 | ||||
-rw-r--r-- | scene/gui/control.cpp | 107 | ||||
-rw-r--r-- | scene/gui/control.h | 8 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 14 | ||||
-rw-r--r-- | scene/gui/rich_text_label.h | 1 | ||||
-rw-r--r-- | scene/gui/scroll_bar.cpp | 12 | ||||
-rw-r--r-- | scene/gui/scroll_bar.h | 1 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 10 | ||||
-rw-r--r-- | scene/gui/tree.h | 2 | ||||
-rw-r--r-- | scene/main/window.cpp | 10 | ||||
-rw-r--r-- | scene/main/window.h | 2 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 10 | ||||
-rw-r--r-- | scene/resources/packed_scene.h | 1 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 10 | ||||
-rw-r--r-- | scene/resources/style_box.h | 1 | ||||
-rw-r--r-- | scene/resources/theme.cpp | 48 | ||||
-rw-r--r-- | scene/resources/theme.h | 8 |
18 files changed, 0 insertions, 281 deletions
diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index f1522dbaeb..e0116d9bad 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -459,39 +459,6 @@ void LineBuilder::strip_begin(Vector2 up, Vector2 down, Color color, float uvx) _last_index[DOWN] = vi + 1; } -void LineBuilder::strip_new_quad(Vector2 up, Vector2 down, Color color, float uvx) { - int vi = vertices.size(); - - vertices.push_back(vertices[_last_index[UP]]); - vertices.push_back(vertices[_last_index[DOWN]]); - vertices.push_back(up); - vertices.push_back(down); - - if (_interpolate_color) { - colors.push_back(color); - colors.push_back(color); - colors.push_back(color); - colors.push_back(color); - } - - if (texture_mode != Line2D::LINE_TEXTURE_NONE) { - uvs.push_back(uvs[_last_index[UP]]); - uvs.push_back(uvs[_last_index[DOWN]]); - uvs.push_back(Vector2(uvx, UP)); - uvs.push_back(Vector2(uvx, DOWN)); - } - - indices.push_back(vi); - indices.push_back(vi + 3); - indices.push_back(vi + 1); - indices.push_back(vi); - indices.push_back(vi + 2); - indices.push_back(vi + 3); - - _last_index[UP] = vi + 2; - _last_index[DOWN] = vi + 3; -} - void LineBuilder::strip_add_quad(Vector2 up, Vector2 down, Color color, float uvx) { int vi = vertices.size(); diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index b093788d75..37bc032356 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -327,9 +327,6 @@ float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { return att; } -void _update_sound() { -} - void AudioStreamPlayer3D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { velocity_tracker->reset(get_global_transform().origin); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index f9b7d828f4..b471bb9d4e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -223,13 +223,6 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) { } data.icon_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_shaders/")) { - String dname = name.get_slicec('/', 1); - if (data.shader_override.has(dname)) { - data.shader_override[dname]->disconnect("changed", callable_mp(this, &Control::_override_changed)); - } - data.shader_override.erase(dname); - notification(NOTIFICATION_THEME_CHANGED); } else if (name.begins_with("custom_styles/")) { String dname = name.get_slicec('/', 1); if (data.style_override.has(dname)) { @@ -264,9 +257,6 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) { if (name.begins_with("custom_icons/")) { String dname = name.get_slicec('/', 1); add_theme_icon_override(dname, p_value); - } else if (name.begins_with("custom_shaders/")) { - String dname = name.get_slicec('/', 1); - add_theme_shader_override(dname, p_value); } else if (name.begins_with("custom_styles/")) { String dname = name.get_slicec('/', 1); add_theme_style_override(dname, p_value); @@ -318,9 +308,6 @@ bool Control::_get(const StringName &p_name, Variant &r_ret) const { if (sname.begins_with("custom_icons/")) { String name = sname.get_slicec('/', 1); r_ret = data.icon_override.has(name) ? Variant(data.icon_override[name]) : Variant(); - } else if (sname.begins_with("custom_shaders/")) { - String name = sname.get_slicec('/', 1); - r_ret = data.shader_override.has(name) ? Variant(data.shader_override[name]) : Variant(); } else if (sname.begins_with("custom_styles/")) { String name = sname.get_slicec('/', 1); r_ret = data.style_override.has(name) ? Variant(data.style_override[name]) : Variant(); @@ -368,18 +355,6 @@ void Control::_get_property_list(List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_shader_list(get_class_name(), &names); - for (List<StringName>::Element *E = names.front(); E; E = E->next()) { - uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; - if (data.shader_override.has(E->get())) { - hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; - } - - p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_shaders/" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "Shader,VisualShader", hint)); - } - } - { - List<StringName> names; theme->get_stylebox_list(get_class_name(), &names); for (List<StringName>::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; @@ -481,10 +456,6 @@ bool Control::is_layout_rtl() const { } } -void Control::_resize(const Size2 &p_size) { - _size_changed(); -} - //moved theme configuration here, so controls can set up even if still not inside active scene void Control::add_child_notify(Node *p_child) { @@ -901,35 +872,6 @@ Ref<Texture2D> Control::get_icons(Control *p_theme_owner, Window *p_theme_owner_ return Theme::get_default()->get_icon(p_name, p_node_type); } -Ref<Shader> Control::get_theme_shader(const StringName &p_name, const StringName &p_node_type) const { - if (p_node_type == StringName() || p_node_type == get_class_name()) { - const Ref<Shader> *sdr = data.shader_override.getptr(p_name); - if (sdr) { - return *sdr; - } - } - - StringName type = p_node_type ? p_node_type : get_class_name(); - - return get_shaders(data.theme_owner, data.theme_owner_window, p_name, type); -} - -Ref<Shader> Control::get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { - Ref<Shader> shader; - - if (_find_theme_item(p_theme_owner, p_theme_owner_window, shader, &Theme::get_shader, &Theme::has_shader, p_name, p_node_type)) { - return shader; - } - - if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_shader(p_name, p_node_type)) { - return Theme::get_project_default()->get_shader(p_name, p_node_type); - } - } - - return Theme::get_default()->get_shader(p_name, p_node_type); -} - Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const { if (p_node_type == StringName() || p_node_type == get_class_name()) { const Ref<StyleBox> *style = data.style_override.getptr(p_name); @@ -1078,11 +1020,6 @@ bool Control::has_theme_icon_override(const StringName &p_name) const { return tex != nullptr; } -bool Control::has_theme_shader_override(const StringName &p_name) const { - const Ref<Shader> *sdr = data.shader_override.getptr(p_name); - return sdr != nullptr; -} - bool Control::has_theme_stylebox_override(const StringName &p_name) const { const Ref<StyleBox> *style = data.style_override.getptr(p_name); return style != nullptr; @@ -1133,31 +1070,6 @@ bool Control::has_icons(Control *p_theme_owner, Window *p_theme_owner_window, co return Theme::get_default()->has_icon(p_name, p_node_type); } -bool Control::has_theme_shader(const StringName &p_name, const StringName &p_node_type) const { - if (p_node_type == StringName() || p_node_type == get_class_name()) { - if (has_theme_shader_override(p_name)) { - return true; - } - } - - StringName type = p_node_type ? p_node_type : get_class_name(); - - return has_shaders(data.theme_owner, data.theme_owner_window, p_name, type); -} - -bool Control::has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_shader, p_name, p_node_type)) { - return true; - } - - if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_shader(p_name, p_node_type)) { - return true; - } - } - return Theme::get_default()->has_shader(p_name, p_node_type); -} - bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const { if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_stylebox_override(p_name)) { @@ -1891,23 +1803,6 @@ void Control::add_theme_icon_override(const StringName &p_name, const Ref<Textur notification(NOTIFICATION_THEME_CHANGED); } -void Control::add_theme_shader_override(const StringName &p_name, const Ref<Shader> &p_shader) { - if (data.shader_override.has(p_name)) { - data.shader_override[p_name]->disconnect("changed", callable_mp(this, &Control::_override_changed)); - } - - // clear if "null" is passed instead of a shader - if (p_shader.is_null()) { - data.shader_override.erase(p_name); - } else { - data.shader_override[p_name] = p_shader; - if (data.shader_override[p_name].is_valid()) { - data.shader_override[p_name]->connect("changed", callable_mp(this, &Control::_override_changed), Vector<Variant>(), CONNECT_REFERENCE_COUNTED); - } - } - notification(NOTIFICATION_THEME_CHANGED); -} - void Control::add_theme_style_override(const StringName &p_name, const Ref<StyleBox> &p_style) { if (data.style_override.has(p_name)) { data.style_override[p_name]->disconnect("changed", callable_mp(this, &Control::_override_changed)); @@ -2905,7 +2800,6 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_theme"), &Control::get_theme); ClassDB::bind_method(D_METHOD("add_theme_icon_override", "name", "texture"), &Control::add_theme_icon_override); - ClassDB::bind_method(D_METHOD("add_theme_shader_override", "name", "shader"), &Control::add_theme_shader_override); ClassDB::bind_method(D_METHOD("add_theme_stylebox_override", "name", "stylebox"), &Control::add_theme_style_override); ClassDB::bind_method(D_METHOD("add_theme_font_override", "name", "font"), &Control::add_theme_font_override); ClassDB::bind_method(D_METHOD("add_theme_font_size_override", "name", "font_size"), &Control::add_theme_font_size_override); @@ -2920,7 +2814,6 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_theme_constant", "name", "node_type"), &Control::get_theme_constant, DEFVAL("")); ClassDB::bind_method(D_METHOD("has_theme_icon_override", "name"), &Control::has_theme_icon_override); - ClassDB::bind_method(D_METHOD("has_theme_shader_override", "name"), &Control::has_theme_shader_override); ClassDB::bind_method(D_METHOD("has_theme_stylebox_override", "name"), &Control::has_theme_stylebox_override); ClassDB::bind_method(D_METHOD("has_theme_font_override", "name"), &Control::has_theme_font_override); ClassDB::bind_method(D_METHOD("has_theme_font_size_override", "name"), &Control::has_theme_font_size_override); diff --git a/scene/gui/control.h b/scene/gui/control.h index e1f05dfe64..8496729f05 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -212,7 +212,6 @@ private: NodePath focus_prev; HashMap<StringName, Ref<Texture2D>> icon_override; - HashMap<StringName, Ref<Shader>> shader_override; HashMap<StringName, Ref<StyleBox>> style_override; HashMap<StringName, Ref<Font>> font_override; HashMap<StringName, int> font_size_override; @@ -238,7 +237,6 @@ private: void _update_minimum_size(); void _update_scroll(); - void _resize(const Size2 &p_size); void _compute_margins(Rect2 p_rect, const float p_anchors[4], float (&r_margins)[4]); void _compute_anchors(Rect2 p_rect, const float p_margins[4], float (&r_anchors)[4]); @@ -264,7 +262,6 @@ private: _FORCE_INLINE_ static bool _has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type); static Ref<Texture2D> get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); - static Ref<Shader> get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static Ref<StyleBox> get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static Ref<Font> get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static int get_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); @@ -272,7 +269,6 @@ private: static int get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static bool has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); - static bool has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static bool has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static bool has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); static bool has_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); @@ -456,7 +452,6 @@ public: /* SKINNING */ void add_theme_icon_override(const StringName &p_name, const Ref<Texture2D> &p_icon); - void add_theme_shader_override(const StringName &p_name, const Ref<Shader> &p_shader); void add_theme_style_override(const StringName &p_name, const Ref<StyleBox> &p_style); void add_theme_font_override(const StringName &p_name, const Ref<Font> &p_font); void add_theme_font_size_override(const StringName &p_name, int p_font_size); @@ -464,7 +459,6 @@ public: void add_theme_constant_override(const StringName &p_name, int p_constant); Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const; - Ref<Shader> get_theme_shader(const StringName &p_name, const StringName &p_node_type = StringName()) const; Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const; Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const; int get_theme_font_size(const StringName &p_name, const StringName &p_node_type = StringName()) const; @@ -472,7 +466,6 @@ public: int get_theme_constant(const StringName &p_name, const StringName &p_node_type = StringName()) const; bool has_theme_icon_override(const StringName &p_name) const; - bool has_theme_shader_override(const StringName &p_name) const; bool has_theme_stylebox_override(const StringName &p_name) const; bool has_theme_font_override(const StringName &p_name) const; bool has_theme_font_size_override(const StringName &p_name) const; @@ -480,7 +473,6 @@ public: bool has_theme_constant_override(const StringName &p_name) const; bool has_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const; - bool has_theme_shader(const StringName &p_name, const StringName &p_node_type = StringName()) const; bool has_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const; bool has_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const; bool has_theme_font_size(const StringName &p_name, const StringName &p_node_type = StringName()) const; diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 08214b958e..e3b645591c 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1424,20 +1424,6 @@ bool RichTextLabel::_find_strikethrough(Item *p_item) { return false; } -bool RichTextLabel::_find_by_type(Item *p_item, ItemType p_type) { - ERR_FAIL_INDEX_V((int)p_type, 19, false); - - Item *item = p_item; - - while (item) { - if (item->type == p_type) { - return true; - } - item = item->parent; - } - return false; -} - void RichTextLabel::_fetch_item_fx_stack(Item *p_item, Vector<ItemFX *> &r_stack) { Item *item = p_item; while (item) { diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 67a3f466a6..2c74eb741d 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -375,7 +375,6 @@ private: bool _find_strikethrough(Item *p_item); bool _find_meta(Item *p_item, Variant *r_meta, ItemMeta **r_item = nullptr); bool _find_layout_subitem(Item *from, Item *to); - bool _find_by_type(Item *p_item, ItemType p_type); void _fetch_item_fx_stack(Item *p_item, Vector<ItemFX *> &r_stack); static Color _get_color_from_string(const String &p_color_str, const Color &p_default_color); diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 9340d98ede..70de63fd40 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -449,18 +449,6 @@ double ScrollBar::get_area_offset() const { return ofs; } -double ScrollBar::get_click_pos(const Point2 &p_pos) const { - float pos = (orientation == VERTICAL) ? p_pos.y : p_pos.x; - pos -= get_area_offset(); - - float area = get_area_size(); - if (area == 0) { - return 0; - } else { - return pos / area; - } -} - double ScrollBar::get_grabber_offset() const { return (get_area_size()) * get_as_ratio(); } diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index 75f5ad1647..358ed74965 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -61,7 +61,6 @@ class ScrollBar : public Range { double get_grabber_min_size() const; double get_area_size() const; double get_area_offset() const; - double get_click_pos(const Point2 &p_pos) const; double get_grabber_offset() const; static void set_can_focus_by_default(bool p_can_focus); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 6bd8003ef0..063a5e7ac1 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -597,12 +597,6 @@ String TreeItem::get_button_tooltip(int p_column, int p_idx) const { return cells[p_column].buttons[p_idx].tooltip; } -int TreeItem::get_button_id(int p_column, int p_idx) const { - ERR_FAIL_INDEX_V(p_column, cells.size(), -1); - ERR_FAIL_INDEX_V(p_idx, cells[p_column].buttons.size(), -1); - return cells[p_column].buttons[p_idx].id; -} - void TreeItem::erase_button(int p_column, int p_idx) { ERR_FAIL_INDEX(p_column, cells.size()); ERR_FAIL_INDEX(p_idx, cells[p_column].buttons.size()); @@ -4081,10 +4075,6 @@ void Tree::set_cursor_can_exit_tree(bool p_enable) { cursor_can_exit_tree = p_enable; } -bool Tree::can_cursor_exit_tree() const { - return cursor_can_exit_tree; -} - void Tree::set_hide_folding(bool p_hide) { hide_folding = p_hide; update(); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 4c3d03c91a..82422b8be3 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -227,7 +227,6 @@ public: int get_button_count(int p_column) const; String get_button_tooltip(int p_column, int p_idx) const; Ref<Texture2D> get_button(int p_column, int p_idx) const; - int get_button_id(int p_column, int p_idx) const; void erase_button(int p_column, int p_idx); int get_button_by_id(int p_column, int p_id) const; void set_button(int p_column, int p_idx, const Ref<Texture2D> &p_button); @@ -633,7 +632,6 @@ public: void scroll_to_item(TreeItem *p_item); void set_cursor_can_exit_tree(bool p_enable); - bool can_cursor_exit_tree() const; VScrollBar *get_vscroll_bar() { return v_scroll; } diff --git a/scene/main/window.cpp b/scene/main/window.cpp index d88c8fb3af..ad87139332 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1167,11 +1167,6 @@ Ref<Texture2D> Window::get_theme_icon(const StringName &p_name, const StringName return Control::get_icons(theme_owner, theme_owner_window, p_name, type); } -Ref<Shader> Window::get_theme_shader(const StringName &p_name, const StringName &p_type) const { - StringName type = p_type ? p_type : get_class_name(); - return Control::get_shaders(theme_owner, theme_owner_window, p_name, type); -} - Ref<StyleBox> Window::get_theme_stylebox(const StringName &p_name, const StringName &p_type) const { StringName type = p_type ? p_type : get_class_name(); return Control::get_styleboxs(theme_owner, theme_owner_window, p_name, type); @@ -1202,11 +1197,6 @@ bool Window::has_theme_icon(const StringName &p_name, const StringName &p_type) return Control::has_icons(theme_owner, theme_owner_window, p_name, type); } -bool Window::has_theme_shader(const StringName &p_name, const StringName &p_type) const { - StringName type = p_type ? p_type : get_class_name(); - return Control::has_shaders(theme_owner, theme_owner_window, p_name, type); -} - bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_type) const { StringName type = p_type ? p_type : get_class_name(); return Control::has_styleboxs(theme_owner, theme_owner_window, p_name, type); diff --git a/scene/main/window.h b/scene/main/window.h index a9a17ab9ba..20f8309952 100644 --- a/scene/main/window.h +++ b/scene/main/window.h @@ -253,7 +253,6 @@ public: Rect2i get_usable_parent_rect() const; Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const; - Ref<Shader> get_theme_shader(const StringName &p_name, const StringName &p_type = StringName()) const; Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const; Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const; int get_theme_font_size(const StringName &p_name, const StringName &p_type = StringName()) const; @@ -261,7 +260,6 @@ public: int get_theme_constant(const StringName &p_name, const StringName &p_type = StringName()) const; bool has_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_shader(const StringName &p_name, const StringName &p_type = StringName()) const; bool has_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const; bool has_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const; bool has_theme_font_size(const StringName &p_name, const StringName &p_type = StringName()) const; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 5ce253f970..09674f3465 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1481,16 +1481,6 @@ int SceneState::add_name(const StringName &p_name) { return names.size() - 1; } -int SceneState::find_name(const StringName &p_name) const { - for (int i = 0; i < names.size(); i++) { - if (names[i] == p_name) { - return i; - } - } - - return -1; -} - int SceneState::add_value(const Variant &p_value) { variants.push_back(p_value); return variants.size() - 1; diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index b8b3f84ecc..fce3891507 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -172,7 +172,6 @@ public: //build API int add_name(const StringName &p_name); - int find_name(const StringName &p_name) const; int add_value(const Variant &p_value); int add_node_path(const NodePath &p_path); int add_node(int p_parent, int p_owner, int p_type, int p_name, int p_instance, int p_index); diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index a8bf44c5c0..14197c6c68 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -404,16 +404,6 @@ void StyleBoxFlat::set_corner_radius_individual(const int radius_top_left, const emit_changed(); } -int StyleBoxFlat::get_corner_radius_min() const { - int smallest = corner_radius[0]; - for (int i = 1; i < 4; i++) { - if (smallest > corner_radius[i]) { - smallest = corner_radius[i]; - } - } - return smallest; -} - void StyleBoxFlat::set_corner_radius(const Corner p_corner, const int radius) { ERR_FAIL_INDEX((int)p_corner, 4); corner_radius[p_corner] = radius; diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index a1237776c6..7dd806e840 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -184,7 +184,6 @@ public: //CORNER void set_corner_radius_all(int radius); void set_corner_radius_individual(const int radius_top_left, const int radius_top_right, const int radius_botton_right, const int radius_bottom_left); - int get_corner_radius_min() const; void set_corner_radius(Corner p_corner, const int radius); int get_corner_radius(Corner p_corner) const; diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index d130470275..6a752d32e7 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -421,52 +421,6 @@ void Theme::get_icon_list(StringName p_node_type, List<StringName> *p_list) cons } } -void Theme::set_shader(const StringName &p_name, const StringName &p_node_type, const Ref<Shader> &p_shader) { - bool new_value = !shader_map.has(p_node_type) || !shader_map[p_node_type].has(p_name); - - shader_map[p_node_type][p_name] = p_shader; - - if (new_value) { - _change_notify(); - emit_changed(); - } -} - -Ref<Shader> Theme::get_shader(const StringName &p_name, const StringName &p_node_type) const { - if (shader_map.has(p_node_type) && shader_map[p_node_type].has(p_name) && shader_map[p_node_type][p_name].is_valid()) { - return shader_map[p_node_type][p_name]; - } else { - return nullptr; - } -} - -bool Theme::has_shader(const StringName &p_name, const StringName &p_node_type) const { - return (shader_map.has(p_node_type) && shader_map[p_node_type].has(p_name) && shader_map[p_node_type][p_name].is_valid()); -} - -void Theme::clear_shader(const StringName &p_name, const StringName &p_node_type) { - ERR_FAIL_COND(!shader_map.has(p_node_type)); - ERR_FAIL_COND(!shader_map[p_node_type].has(p_name)); - - shader_map[p_node_type].erase(p_name); - _change_notify(); - emit_changed(); -} - -void Theme::get_shader_list(const StringName &p_node_type, List<StringName> *p_list) const { - ERR_FAIL_NULL(p_list); - - if (!shader_map.has(p_node_type)) { - return; - } - - const StringName *key = nullptr; - - while ((key = shader_map[p_node_type].next(key))) { - p_list->push_back(*key); - } -} - void Theme::set_stylebox(const StringName &p_name, const StringName &p_node_type, const Ref<StyleBox> &p_style) { //ERR_FAIL_COND(p_style.is_null()); @@ -782,7 +736,6 @@ void Theme::clear() { icon_map.clear(); style_map.clear(); font_map.clear(); - shader_map.clear(); color_map.clear(); constant_map.clear(); @@ -837,7 +790,6 @@ void Theme::copy_theme(const Ref<Theme> &p_other) { color_map = p_other->color_map; constant_map = p_other->constant_map; - shader_map = p_other->shader_map; _change_notify(); emit_changed(); diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 4175e19112..6ac47e8931 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -34,7 +34,6 @@ #include "core/io/resource.h" #include "core/io/resource_loader.h" #include "scene/resources/font.h" -#include "scene/resources/shader.h" #include "scene/resources/style_box.h" #include "scene/resources/texture.h" @@ -48,7 +47,6 @@ class Theme : public Resource { HashMap<StringName, HashMap<StringName, Ref<StyleBox>>> style_map; HashMap<StringName, HashMap<StringName, Ref<Font>>> font_map; HashMap<StringName, HashMap<StringName, int>> font_size_map; - HashMap<StringName, HashMap<StringName, Ref<Shader>>> shader_map; HashMap<StringName, HashMap<StringName, Color>> color_map; HashMap<StringName, HashMap<StringName, int>> constant_map; @@ -102,12 +100,6 @@ public: void clear_icon(const StringName &p_name, const StringName &p_node_type); void get_icon_list(StringName p_node_type, List<StringName> *p_list) const; - void set_shader(const StringName &p_name, const StringName &p_node_type, const Ref<Shader> &p_shader); - Ref<Shader> get_shader(const StringName &p_name, const StringName &p_node_type) const; - bool has_shader(const StringName &p_name, const StringName &p_node_type) const; - void clear_shader(const StringName &p_name, const StringName &p_node_type); - void get_shader_list(const StringName &p_node_type, List<StringName> *p_list) const; - void set_stylebox(const StringName &p_name, const StringName &p_node_type, const Ref<StyleBox> &p_style); Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_node_type) const; bool has_stylebox(const StringName &p_name, const StringName &p_node_type) const; |