1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Removal of Image from Variant, converted to a Resource.

This commit is contained in:
Juan Linietsky
2017-05-17 07:36:47 -03:00
parent d801ff2b3d
commit 98a3296702
110 changed files with 690 additions and 3203 deletions

View File

@@ -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()) {