Skip to content

Commit

Permalink
Update deferred calls to use Callables
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jan 9, 2024
1 parent 8297ec9 commit 0e8f90f
Show file tree
Hide file tree
Showing 92 changed files with 192 additions and 350 deletions.
3 changes: 1 addition & 2 deletions core/variant/callable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
#include "callable.h"

#include "callable_bind.h"
#include "core/object/message_queue.h"
#include "core/object/object.h"
#include "core/object/ref_counted.h"
#include "core/object/script_language.h"

void Callable::call_deferredp(const Variant **p_arguments, int p_argcount) const {
MessageQueue::get_singleton()->push_callablep(*this, p_arguments, p_argcount);
MessageQueue::get_singleton()->push_callablep(*this, p_arguments, p_argcount, true);
}

void Callable::callp(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const {
Expand Down
2 changes: 1 addition & 1 deletion editor/animation_bezier_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {

if (Math::is_finite(minimum_time) && Math::is_finite(maximum_time) && maximum_time - minimum_time > CMP_EPSILON) {
timeline->get_zoom()->set_value(zoom_value);
timeline->call_deferred("set_value", minimum_time);
callable_mp((Range *)timeline, &Range::set_value).call_deferred(minimum_time);
}

if (Math::is_finite(minimum_value) && Math::is_finite(maximum_value)) {
Expand Down
3 changes: 1 addition & 2 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4613,7 +4613,7 @@ void AnimationTrackEditor::_animation_changed() {
}

animation_changing_awaiting_update = true;
call_deferred(SNAME("_animation_update"));
callable_mp(this, &AnimationTrackEditor::_animation_update).call_deferred();
}

void AnimationTrackEditor::_snap_mode_changed(int p_mode) {
Expand Down Expand Up @@ -6478,7 +6478,6 @@ void AnimationTrackEditor::_select_all_tracks_for_copy() {
}

void AnimationTrackEditor::_bind_methods() {
ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update);
ClassDB::bind_method("_track_grab_focus", &AnimationTrackEditor::_track_grab_focus);
ClassDB::bind_method("_redraw_tracks", &AnimationTrackEditor::_redraw_tracks);
ClassDB::bind_method("_clear_selection_for_anim", &AnimationTrackEditor::_clear_selection_for_anim);
Expand Down
3 changes: 1 addition & 2 deletions editor/audio_stream_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
}

frames_todo -= to_read;
singleton->call_deferred(SNAME("_update_emit"), preview->id);
callable_mp(singleton, &AudioStreamPreviewGenerator::_update_emit).call_deferred(preview->id);
}

preview->preview->version++;
Expand Down Expand Up @@ -216,7 +216,6 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
}

void AudioStreamPreviewGenerator::_bind_methods() {
ClassDB::bind_method("_update_emit", &AudioStreamPreviewGenerator::_update_emit);
ClassDB::bind_method(D_METHOD("generate_preview", "stream"), &AudioStreamPreviewGenerator::generate_preview);

ADD_SIGNAL(MethodInfo("preview_updated", PropertyInfo(Variant::INT, "obj_id")));
Expand Down
14 changes: 7 additions & 7 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void FindReplaceBar::_replace_all() {
matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
matches_label->set_text(vformat(TTR("%d replaced."), rc));

text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
callable_mp((Object *)text_editor, &Object::connect).call_deferred("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed), 0U);
results_count = -1;
results_count_to_current = -1;
needs_to_count_results = true;
Expand Down Expand Up @@ -517,10 +517,10 @@ void FindReplaceBar::_show_search(bool p_focus_replace, bool p_show_only) {

if (p_focus_replace) {
search_text->deselect();
replace_text->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)replace_text, &Control::grab_focus).call_deferred();
} else {
replace_text->deselect();
search_text->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)search_text, &Control::grab_focus).call_deferred();
}

if (text_editor->has_selection(0) && !is_selection_only()) {
Expand Down Expand Up @@ -1572,20 +1572,20 @@ void CodeTextEditor::goto_line(int p_line) {
text_editor->remove_secondary_carets();
text_editor->deselect();
text_editor->unfold_line(p_line);
text_editor->call_deferred(SNAME("set_caret_line"), p_line);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_line).call_deferred(p_line, true, true, 0, 0);
}

void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
text_editor->remove_secondary_carets();
text_editor->unfold_line(p_line);
text_editor->call_deferred(SNAME("set_caret_line"), p_line);
text_editor->call_deferred(SNAME("set_caret_column"), p_begin);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_line).call_deferred(p_line, true, true, 0, 0);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_column).call_deferred(p_begin, true, 0);
text_editor->select(p_line, p_begin, p_line, p_end);
}

void CodeTextEditor::goto_line_centered(int p_line) {
goto_line(p_line);
text_editor->call_deferred(SNAME("center_viewport_to_caret"));
callable_mp((TextEdit *)text_editor, &TextEdit::center_viewport_to_caret).call_deferred(0);
}

void CodeTextEditor::set_executing_line(int p_line) {
Expand Down
2 changes: 1 addition & 1 deletion editor/create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void CreateDialog::_notification(int p_what) {

case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
search_box->call_deferred(SNAME("grab_focus")); // still not visible
callable_mp((Control *)search_box, &Control::grab_focus).call_deferred(); // Still not visible.
search_box->select_all();
} else {
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "create_new_node", Rect2(get_position(), get_size()));
Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_debugger_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ void EditorDebuggerNode::_debugger_wants_stop(int p_id) {
// Ask editor to kill PID.
int pid = get_debugger(p_id)->get_remote_pid();
if (pid) {
EditorNode::get_singleton()->call_deferred(SNAME("stop_child_process"), pid);
callable_mp(EditorNode::get_singleton(), &EditorNode::stop_child_process).call_deferred(pid);
}
}

Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_debugger_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
}
debugger_id = p_debugger; // Needed by hook, could be avoided if every debugger had its own tree
if (scroll_item) {
call_deferred(SNAME("scroll_to_item"), scroll_item);
callable_mp((Tree *)this, &Tree::scroll_to_item).call_deferred(scroll_item, false);
}
last_filter = filter;
updating_scene_tree = false;
Expand Down
9 changes: 4 additions & 5 deletions editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ void EditorAudioBuses::_load_default_layout() {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}

void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
Expand All @@ -1250,7 +1250,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();

} else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
if (new_layout) {
Expand All @@ -1270,14 +1270,13 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
file->set_text(String(TTR("Layout:")) + " " + p_string.get_file());
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}
}

void EditorAudioBuses::_bind_methods() {
ClassDB::bind_method("_update_bus", &EditorAudioBuses::_update_bus);
ClassDB::bind_method("_update_sends", &EditorAudioBuses::_update_sends);
ClassDB::bind_method("_select_layout", &EditorAudioBuses::_select_layout);
}

EditorAudioBuses::EditorAudioBuses() {
Expand Down Expand Up @@ -1370,7 +1369,7 @@ void EditorAudioBuses::open_layout(const String &p_path) {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}

void AudioBusesEditorPlugin::edit(Object *p_node) {
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_autoload_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void EditorAutoloadSettings::_notification(int p_what) {

for (const AutoloadInfo &info : autoload_cache) {
if (info.node && info.in_editor) {
get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
callable_mp((Node *)get_tree()->get_root(), &Node::add_child).call_deferred(info.node, false, Node::INTERNAL_MODE_DISABLED);
}
}
browse_button->set_icon(get_editor_theme_icon(SNAME("Folder")));
Expand Down Expand Up @@ -533,7 +533,7 @@ void EditorAutoloadSettings::update_autoload() {
}
if (info.in_editor) {
ERR_CONTINUE(!info.node);
get_tree()->get_root()->call_deferred(SNAME("remove_child"), info.node);
callable_mp((Node *)get_tree()->get_root(), &Node::remove_child).call_deferred(info.node);
}

if (info.node) {
Expand Down
3 changes: 1 addition & 2 deletions editor/editor_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,6 @@ void EditorSelection::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node);
ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::get_selected_nodes);
ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"), &EditorSelection::_get_transformable_selected_nodes);
ClassDB::bind_method(D_METHOD("_emit_change"), &EditorSelection::_emit_change);
ADD_SIGNAL(MethodInfo("selection_changed"));
}

Expand Down Expand Up @@ -1290,7 +1289,7 @@ void EditorSelection::update() {
changed = false;
if (!emitted) {
emitted = true;
call_deferred(SNAME("_emit_change"));
callable_mp(this, &EditorSelection::_emit_change).call_deferred();
}
}

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ EditorFileSystem::EditorFileSystem() {
using_fat32_or_exfat = (da->get_filesystem_type() == "FAT32" || da->get_filesystem_type() == "exFAT");

scan_total = 0;
MessageQueue::get_singleton()->push_callable(callable_mp(ResourceUID::get_singleton(), &ResourceUID::clear)); // Will be updated on scan.
callable_mp(ResourceUID::get_singleton(), &ResourceUID::clear).call_deferred(); // Will be updated on scan.
ResourceSaver::set_get_resource_id_for_path(_resource_saver_get_resource_id_for_path);
}

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ void EditorHelp::_help_callback(const String &p_topic) {
}

if (class_desc->is_ready()) {
class_desc->call_deferred(SNAME("scroll_to_paragraph"), line);
callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).call_deferred(line);
} else {
scroll_to = line;
}
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_help_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void EditorHelpSearch::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (!is_visible()) {
results_tree->call_deferred(SNAME("clear")); // Wait for the Tree's mouse event propagation.
callable_mp(results_tree, &Tree::clear).call_deferred(); // Wait for the Tree's mouse event propagation.
get_ok_button()->set_disabled(true);
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size()));
}
Expand Down
9 changes: 4 additions & 5 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,14 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
new_coords.y++;
}
if (new_coords.x < int64_t(object->get("hframes")) && new_coords.y < int64_t(object->get("vframes"))) {
call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
callable_mp(this, &EditorProperty::emit_changed).call_deferred(property, new_coords, "", false);
}
} else {
if (int64_t(object->get(property)) + 1 < (int64_t(object->get("hframes")) * int64_t(object->get("vframes")))) {
call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
callable_mp(this, &EditorProperty::emit_changed).call_deferred(property, object->get(property).operator int64_t() + 1, "", false);
}
}

call_deferred(SNAME("update_property"));
callable_mp(this, &EditorProperty::update_property).call_deferred();
}
}
if (delete_rect.has_point(mpos)) {
Expand Down Expand Up @@ -3980,7 +3979,7 @@ void EditorInspector::_notification(int p_what) {

case NOTIFICATION_PROCESS: {
if (update_scroll_request >= 0) {
get_v_scroll_bar()->call_deferred(SNAME("set_value"), update_scroll_request);
callable_mp((Range *)get_v_scroll_bar(), &Range::set_value).call_deferred(update_scroll_request);
update_scroll_request = -1;
}
if (update_tree_pending) {
Expand Down
19 changes: 6 additions & 13 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/class_db.h"
#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/os/time.h"
Expand Down Expand Up @@ -668,7 +667,7 @@ void EditorNode::_notification(int p_what) {

command_palette->register_shortcuts_as_command();

MessageQueue::get_singleton()->push_callable(callable_mp(this, &EditorNode::_begin_first_scan));
callable_mp(this, &EditorNode::_begin_first_scan).call_deferred();

/* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */
} break;
Expand Down Expand Up @@ -1107,7 +1106,7 @@ void EditorNode::_scan_external_changes() {
}

if (need_reload) {
disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3);
callable_mp((Window *)disk_changed, &Window::popup_centered_ratio).call_deferred(0.3);
}
}

Expand Down Expand Up @@ -3707,7 +3706,7 @@ void EditorNode::_set_current_scene_nocheck(int p_idx) {
callable_mp(scene_tabs, &EditorSceneTabs::update_scene_tabs).call_deferred();

if (tabs_to_close.is_empty()) {
call_deferred(SNAME("_set_main_scene_state"), state, get_edited_scene()); // Do after everything else is done setting up.
callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
}
}

Expand Down Expand Up @@ -4097,7 +4096,7 @@ bool EditorNode::has_previous_scenes() const {

void EditorNode::edit_foreign_resource(Ref<Resource> p_resource) {
load_scene(p_resource->get_path().get_slice("::", 0));
InspectorDock::get_singleton()->call_deferred("edit_resource", p_resource);
callable_mp(InspectorDock::get_singleton(), &InspectorDock::edit_resource).call_deferred(p_resource);
}

bool EditorNode::is_resource_read_only(Ref<Resource> p_resource, bool p_foreign_resources_are_writable) {
Expand Down Expand Up @@ -4176,7 +4175,7 @@ void EditorNode::_add_to_recent_scenes(const String &p_scene) {
void EditorNode::_open_recent_scene(int p_idx) {
if (p_idx == recent_scenes->get_item_count() - 1) {
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", Array());
call_deferred(SNAME("_update_recent_scenes"));
callable_mp(this, &EditorNode::_update_recent_scenes).call_deferred();
} else {
Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scenes", Array());
ERR_FAIL_INDEX(p_idx, rc.size());
Expand Down Expand Up @@ -5259,7 +5258,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String

int selected_tab_idx = p_layout->get_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx");
if (selected_tab_idx >= 0 && selected_tab_idx < dock_slot[i]->get_tab_count()) {
dock_slot[i]->call_deferred("set_current_tab", selected_tab_idx);
callable_mp(dock_slot[i], &TabContainer::set_current_tab).call_deferred(selected_tab_idx);
}
}

Expand Down Expand Up @@ -6677,15 +6676,9 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("push_item", "object", "property", "inspector_only"), &EditorNode::push_item, DEFVAL(""), DEFVAL(false));

ClassDB::bind_method("set_edited_scene", &EditorNode::set_edited_scene);
ClassDB::bind_method("open_request", &EditorNode::open_request);
ClassDB::bind_method("edit_foreign_resource", &EditorNode::edit_foreign_resource);
ClassDB::bind_method("is_resource_read_only", &EditorNode::is_resource_read_only);

ClassDB::bind_method("stop_child_process", &EditorNode::stop_child_process);

ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state);
ClassDB::bind_method("_update_recent_scenes", &EditorNode::_update_recent_scenes);

ADD_SIGNAL(MethodInfo("request_help_search"));
ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::PACKED_STRING_ARRAY, "args")));
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "obj")));
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,13 @@ void EditorPlugin::remove_translation_parser_plugin(const Ref<EditorTranslationP
void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer, bool p_first_priority) {
ERR_FAIL_COND(!p_importer.is_valid());
ResourceFormatImporter::get_singleton()->add_importer(p_importer, p_first_priority);
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred();
}

void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
ERR_FAIL_COND(!p_importer.is_valid());
ResourceFormatImporter::get_singleton()->remove_importer(p_importer);
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred();
}

void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) {
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3013,7 +3013,7 @@ void EditorPropertyResource::_resource_selected(const Ref<Resource> &p_resource,
if (extensions.find(parent.get_extension()) && (!EditorNode::get_singleton()->get_edited_scene() || EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path() != parent)) {
// If the resource belongs to another (non-imported) scene, edit it in that scene instead.
if (!FileAccess::exists(parent + ".import")) {
EditorNode::get_singleton()->call_deferred("edit_foreign_resource", p_resource);
callable_mp(EditorNode::get_singleton(), &EditorNode::edit_foreign_resource).call_deferred(p_resource);
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_properties_array_dict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ void EditorPropertyArray::update_property() {
new_prop->connect(SNAME("object_id_selected"), callable_mp(this, &EditorPropertyArray::_object_id_selected));
new_prop->set_h_size_flags(SIZE_EXPAND_FILL);
new_prop->set_read_only(is_read_only());
slot.prop->call_deferred("add_sibling", new_prop);
slot.prop->call_deferred("queue_free");
callable_mp((Node *)slot.prop, &Node::add_sibling).call_deferred(new_prop, false);
callable_mp((Node *)slot.prop, &Node::queue_free).call_deferred();
slot.prop = new_prop;
slot.set_index(idx);
}
Expand Down
3 changes: 1 addition & 2 deletions editor/editor_resource_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/message_queue.h"
#include "core/variant/variant_utility.h"
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
Expand Down Expand Up @@ -123,7 +122,7 @@ void EditorResourcePreview::_preview_ready(const String &p_path, int p_hash, con
cache[p_path] = item;
}

MessageQueue::get_singleton()->push_call(id, p_func, p_path, p_texture, p_small_texture, p_ud);
Callable(id, p_func).call_deferred(p_path, p_texture, p_small_texture, p_ud);
}

void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<ImageTexture> &r_small_texture, const QueueItem &p_item, const String &cache_base, Dictionary &p_metadata) {
Expand Down
Loading

0 comments on commit 0e8f90f

Please sign in to comment.