diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-03-14 16:24:17 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-03-14 16:24:17 -0300 |
commit | f1c58e4b189bfde0397bd489ed7b9a25d8f8947a (patch) | |
tree | f4223065ec66869e80c19ffe51dc897eb617a5b2 /tools/editor/plugins | |
parent | 05036ed0addb5634ff2e92bba1055d8e99b3f982 (diff) |
Tilemap Editor: Use ItemList::set_item_icon_region in tile palette
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 2df6aec64e..ea46458cdf 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -231,16 +231,10 @@ void TileMapEditor::_update_palette() { if (tex.is_valid()) { Rect2 region = tileset->tile_get_region(E->get()); - if (!region.has_no_area()) { - Image data = VS::get_singleton()->texture_get_data(tex->get_rid()); + if (!region.has_no_area()) + palette->set_item_icon_region(palette->get_item_count()-1, region); - Ref<ImageTexture> img = memnew( ImageTexture ); - img->create_from_image(data.get_rect(region)); - - palette->set_item_icon(palette->get_item_count()-1, img); - } else { - palette->set_item_icon(palette->get_item_count()-1, tex); - } + palette->set_item_icon(palette->get_item_count()-1, tex); } palette->set_item_metadata(palette->get_item_count()-1, E->get()); |