From 2c048ea16429cfa4e6b200a4fe519ee9db7c3f99 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Tue, 8 Dec 2020 22:51:48 +0100 Subject: [PATCH] Cleanup unused engine code --- core/io/packet_peer.cpp | 9 +- core/io/packet_peer.h | 1 - core/io/resource_importer.cpp | 4 - core/io/resource_importer.h | 1 - core/math/vector3.cpp | 33 ------ core/math/vector3.h | 1 - core/object/object.cpp | 4 - core/object/object.h | 2 - core/object/script_language.h | 2 - editor/animation_track_editor.cpp | 4 - editor/animation_track_editor.h | 1 - editor/editor_data.cpp | 5 - editor/editor_data.h | 1 - editor/editor_export.cpp | 7 -- editor/editor_export.h | 2 - editor/editor_file_system.cpp | 4 - editor/editor_file_system.h | 1 - editor/editor_node.cpp | 17 --- editor/editor_node.h | 3 - editor/editor_settings.cpp | 5 - editor/multi_node_edit.cpp | 4 - editor/multi_node_edit.h | 1 - .../plugins/animation_tree_editor_plugin.cpp | 3 - editor/plugins/animation_tree_editor_plugin.h | 1 - editor/plugins/script_editor_plugin.cpp | 11 -- editor/plugins/script_editor_plugin.h | 1 - editor/plugins/theme_editor_plugin.cpp | 7 -- editor/run_settings_dialog.cpp | 85 -------------- editor/run_settings_dialog.h | 69 ----------- editor/scene_tree_dock.cpp | 17 --- editor/scene_tree_dock.h | 1 - editor/scene_tree_editor.cpp | 4 - editor/scene_tree_editor.h | 1 - platform/server/os_server.cpp | 8 -- platform/server/os_server.h | 2 - scene/2d/line_builder.cpp | 33 ------ scene/3d/audio_stream_player_3d.cpp | 3 - scene/gui/control.cpp | 107 ------------------ scene/gui/control.h | 8 -- scene/gui/rich_text_label.cpp | 14 --- scene/gui/rich_text_label.h | 1 - scene/gui/scroll_bar.cpp | 12 -- scene/gui/scroll_bar.h | 1 - scene/gui/tree.cpp | 10 -- scene/gui/tree.h | 2 - scene/main/window.cpp | 10 -- scene/main/window.h | 2 - scene/resources/packed_scene.cpp | 10 -- scene/resources/packed_scene.h | 1 - scene/resources/style_box.cpp | 10 -- scene/resources/style_box.h | 1 - scene/resources/theme.cpp | 48 -------- scene/resources/theme.h | 8 -- servers/camera_server.h | 5 +- servers/rendering_server.cpp | 9 -- servers/rendering_server.h | 2 - 56 files changed, 4 insertions(+), 615 deletions(-) delete mode 100644 editor/run_settings_dialog.cpp delete mode 100644 editor/run_settings_dialog.h diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index b6cc5bf42a0..3da494a8ef0 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -151,11 +151,6 @@ void PacketPeer::_bind_methods() { /***************/ -void PacketPeerStream::_set_stream_peer(REF p_peer) { - ERR_FAIL_COND_MSG(p_peer.is_null(), "It's not a reference to a valid Resource object."); - set_stream_peer(p_peer); -} - void PacketPeerStream::_bind_methods() { ClassDB::bind_method(D_METHOD("set_stream_peer", "peer"), &PacketPeerStream::set_stream_peer); ClassDB::bind_method(D_METHOD("get_stream_peer"), &PacketPeerStream::get_stream_peer); @@ -263,10 +258,8 @@ int PacketPeerStream::get_max_packet_size() const { } void PacketPeerStream::set_stream_peer(const Ref &p_peer) { - //ERR_FAIL_COND(p_peer.is_null()); - if (p_peer.ptr() != peer.ptr()) { - ring_buffer.advance_read(ring_buffer.data_left()); // reset the ring buffer + ring_buffer.advance_read(ring_buffer.data_left()); // Reset the ring buffer. } peer = p_peer; diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index f7f080aa438..a25fa038753 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -86,7 +86,6 @@ class PacketPeerStream : public PacketPeer { Error _poll_buffer() const; protected: - void _set_stream_peer(REF p_peer); static void _bind_methods(); public: diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index c88331cf9e5..9b14d2c763d 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -192,10 +192,6 @@ bool ResourceFormatImporter::recognize_path(const String &p_path, const String & return FileAccess::exists(p_path + ".import"); } -bool ResourceFormatImporter::can_be_imported(const String &p_path) const { - return ResourceFormatLoader::recognize_path(p_path); -} - int ResourceFormatImporter::get_import_order(const String &p_path) const { Ref importer; diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index 30bbd43c184..1b300bf656b 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -70,7 +70,6 @@ public: virtual String get_import_group_file(const String &p_path) const; virtual bool exists(const String &p_path) const; - virtual bool can_be_imported(const String &p_path) const; virtual int get_import_order(const String &p_path) const; String get_internal_resource_path(const String &p_path) const; diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 23f5bb88fe5..09354d8e79a 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -72,39 +72,6 @@ Vector3 Vector3::snapped(Vector3 p_val) const { return v; } -Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const { - Vector3 p0 = p_pre_a; - Vector3 p1 = *this; - Vector3 p2 = p_b; - Vector3 p3 = p_post_b; - - { - //normalize - - real_t ab = p0.distance_to(p1); - real_t bc = p1.distance_to(p2); - real_t cd = p2.distance_to(p3); - - if (ab > 0) { - p0 = p1 + (p0 - p1) * (bc / ab); - } - if (cd > 0) { - p3 = p2 + (p3 - p2) * (bc / cd); - } - } - - real_t t = p_weight; - real_t t2 = t * t; - real_t t3 = t2 * t; - - Vector3 out; - out = 0.5 * ((p1 * 2.0) + - (-p0 + p2) * t + - (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 + - (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); - return out; -} - Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const { Vector3 p0 = p_pre_a; Vector3 p1 = *this; diff --git a/core/math/vector3.h b/core/math/vector3.h index 69e79627f38..5af84377fd5 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -89,7 +89,6 @@ struct Vector3 { _FORCE_INLINE_ Vector3 lerp(const Vector3 &p_to, real_t p_weight) const; _FORCE_INLINE_ Vector3 slerp(const Vector3 &p_to, real_t p_weight) const; Vector3 cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const; - Vector3 cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const; Vector3 move_toward(const Vector3 &p_to, const real_t p_delta) const; _FORCE_INLINE_ Vector3 cross(const Vector3 &p_b) const; diff --git a/core/object/object.cpp b/core/object/object.cpp index 37643161227..681e1188ff7 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -823,10 +823,6 @@ void Object::property_list_changed_notify() { _change_notify(); } -void Object::cancel_delete() { - _predelete_ok = true; -} - void Object::set_script_and_instance(const Variant &p_script, ScriptInstance *p_instance) { //this function is not meant to be used in any of these ways ERR_FAIL_COND(p_script.is_null()); diff --git a/core/object/object.h b/core/object/object.h index 5bf9600c5ad..dc004f38a9a 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -525,8 +525,6 @@ protected: static void get_valid_parents_static(List *p_parents); static void _get_valid_parents_static(List *p_parents); - void cancel_delete(); - virtual void _changed_callback(Object *p_changed, const char *p_prop); //Variant _call_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant()); diff --git a/core/object/script_language.h b/core/object/script_language.h index ddd884a4f35..f5d65cf42d3 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -274,8 +274,6 @@ class ScriptCodeCompletionCache { static ScriptCodeCompletionCache *singleton; public: - virtual RES get_cached_resource(const String &p_path) = 0; - static ScriptCodeCompletionCache *get_singleton() { return singleton; } ScriptCodeCompletionCache(); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 717e4628aef..7411af22804 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -2217,10 +2217,6 @@ void AnimationTrackEdit::draw_bg(int p_clip_left, int p_clip_right) { void AnimationTrackEdit::draw_fg(int p_clip_left, int p_clip_right) { } -void AnimationTrackEdit::draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos) { - draw_texture_region_clipped(p_texture, Rect2(p_pos, p_texture->get_size()), Rect2(Point2(), p_texture->get_size())); -} - void AnimationTrackEdit::draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region) { int clip_left = timeline->get_name_limit(); int clip_right = get_size().width - timeline->get_buttons_width(); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 5e12791e349..3cb31fe21e1 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -207,7 +207,6 @@ public: virtual void draw_fg(int p_clip_left, int p_clip_right); //helper - void draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos); void draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region); void draw_rect_clipped(const Rect2 &p_rect, const Color &p_color, bool p_filled = true); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 975405aec48..eab1ecf373d 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -691,11 +691,6 @@ void EditorData::set_edited_scene_version(uint64_t version, int p_scene_idx) { } } -uint64_t EditorData::get_edited_scene_version() const { - ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), 0); - return edited_scene[current_edited_scene].version; -} - uint64_t EditorData::get_scene_version(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0); return edited_scene[p_idx].version; diff --git a/editor/editor_data.h b/editor/editor_data.h index e4ef9f56a51..0d27e069877 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -190,7 +190,6 @@ public: void set_scene_path(int p_idx, const String &p_path); Ref