summaryrefslogtreecommitdiffstats
path: root/editor/editor_run_native.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-05-04 01:49:20 +0200
committerkobewi <kobewi4e@gmail.com>2022-07-08 13:40:47 +0200
commitd2900429e81175a9f48240b180f1d8e3ab52865c (patch)
tree9a22ed1cd2ecea275dac8e9420d7a1d56c661382 /editor/editor_run_native.cpp
parentca18a02e00f7009d084c55b7e9de17df634f3d47 (diff)
downloadredot-engine-d2900429e81175a9f48240b180f1d8e3ab52865c.tar.gz
Add static methods for creating Image and ImageTexture
Diffstat (limited to 'editor/editor_run_native.cpp')
-rw-r--r--editor/editor_run_native.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp
index 6ce9e5fa6f..854885c707 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -49,9 +49,7 @@ void EditorRunNative::_notification(int p_what) {
im->clear_mipmaps();
if (!im->is_empty()) {
im->resize(16 * EDSCALE, 16 * EDSCALE);
- Ref<ImageTexture> small_icon;
- small_icon.instantiate();
- small_icon->create_from_image(im);
+ Ref<ImageTexture> small_icon = ImageTexture::create_from_image(im);
MenuButton *mb = memnew(MenuButton);
mb->get_popup()->connect("id_pressed", callable_mp(this, &EditorRunNative::run_native), varray(i));
mb->connect("pressed", callable_mp(this, &EditorRunNative::run_native), varray(-1, i));