aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/texture_region_editor_plugin.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-05-17 07:36:47 -0300
committerJuan Linietsky2017-05-17 07:37:45 -0300
commit98a329670227c726a5d7a196e5cba8dbdd54301b (patch)
tree7346f7a3e38eb35b784ac1a68a227d07cc8881b4 /editor/plugins/texture_region_editor_plugin.cpp
parentd801ff2b3db2de105c1b36a74ce116e360143d4e (diff)
downloadgodot-98a329670227c726a5d7a196e5cba8dbdd54301b.tar.gz
godot-98a329670227c726a5d7a196e5cba8dbdd54301b.tar.zst
godot-98a329670227c726a5d7a196e5cba8dbdd54301b.zip
Removal of Image from Variant, converted to a Resource.
Diffstat (limited to 'editor/plugins/texture_region_editor_plugin.cpp')
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 4c49b467d..89995edf0 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -678,12 +678,13 @@ void TextureRegionEditor::_edit_region() {
}
autoslice_cache.clear();
- Image i;
- if (i.load(texture->get_path()) == OK) {
+ Ref<Image> i;
+ i.instance();
+ if (i->load(texture->get_path()) == OK) {
BitMap bm;
bm.create_from_image_alpha(i);
- for (int y = 0; y < i.get_height(); y++) {
- for (int x = 0; x < i.get_width(); x++) {
+ for (int y = 0; y < i->get_height(); y++) {
+ for (int x = 0; x < i->get_width(); x++) {
if (bm.get_bit(Point2(x, y))) {
bool found = false;
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {