summaryrefslogtreecommitdiffstats
path: root/editor/plugins/tiles/tiles_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/tiles/tiles_editor_plugin.cpp')
-rw-r--r--editor/plugins/tiles/tiles_editor_plugin.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp
index b96f3f21b8..65f52bc92c 100644
--- a/editor/plugins/tiles/tiles_editor_plugin.cpp
+++ b/editor/plugins/tiles/tiles_editor_plugin.cpp
@@ -36,10 +36,10 @@
#include "editor/editor_interface.h"
#include "editor/editor_node.h"
-#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
+#include "editor/themes/editor_scale.h"
#include "scene/2d/tile_map.h"
#include "scene/gui/box_container.h"
@@ -68,6 +68,9 @@ void TilesEditorUtils::_thread_func(void *ud) {
}
void TilesEditorUtils::_thread() {
+ CallQueue queue;
+ MessageQueue::set_thread_singleton_override(&queue);
+
pattern_thread_exited.clear();
while (!pattern_thread_exit.is_set()) {
pattern_preview_sem.wait();
@@ -125,7 +128,9 @@ void TilesEditorUtils::_thread() {
tile_map->set_position(-(scale * encompassing_rect.get_center()) + thumbnail_size2 / 2);
// Add the viewport at the last moment to avoid rendering too early.
- EditorNode::get_singleton()->call_deferred("add_child", viewport);
+ callable_mp((Node *)EditorNode::get_singleton(), &Node::add_child).call_deferred(viewport, false, Node::INTERNAL_MODE_DISABLED);
+
+ MessageQueue::get_singleton()->flush();
RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<TilesEditorUtils *>(this), &TilesEditorUtils::_preview_frame_started), Object::CONNECT_ONE_SHOT);
@@ -139,7 +144,11 @@ void TilesEditorUtils::_thread() {
viewport->queue_free();
}
}
+
+ MessageQueue::get_singleton()->flush();
}
+
+ MessageQueue::get_singleton()->flush();
pattern_thread_exited.set();
}