diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:36:47 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:37:45 -0300 |
commit | 98a329670227c726a5d7a196e5cba8dbdd54301b (patch) | |
tree | 7346f7a3e38eb35b784ac1a68a227d07cc8881b4 /scene/resources/sky_box.cpp | |
parent | d801ff2b3db2de105c1b36a74ce116e360143d4e (diff) |
Removal of Image from Variant, converted to a Resource.
Diffstat (limited to 'scene/resources/sky_box.cpp')
-rw-r--r-- | scene/resources/sky_box.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index 241675569f..2fd074de0f 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -88,24 +88,25 @@ void ImageSkyBox::set_image_path(ImagePath p_image, const String &p_path) { if (all_ok) { - Image images[IMAGE_PATH_MAX]; + Ref<Image> images[IMAGE_PATH_MAX]; int w = 0, h = 0; Image::Format format; for (int i = 0; i < IMAGE_PATH_MAX; i++) { - Error err = ImageLoader::load_image(image_path[i], &images[i]); + images[i].instance(); + Error err = ImageLoader::load_image(image_path[i], images[i]); if (err) { ERR_PRINTS("Error loading image for skybox: " + image_path[i]); return; } if (i == 0) { - w = images[0].get_width(); - h = images[0].get_height(); - format = images[0].get_format(); + w = images[0]->get_width(); + h = images[0]->get_height(); + format = images[0]->get_format(); } else { - if (images[i].get_width() != w || images[i].get_height() != h || images[i].get_format() != format) { - ERR_PRINTS("Image size mismatch (" + itos(images[i].get_width()) + "," + itos(images[i].get_height()) + ":" + Image::get_format_name(images[i].get_format()) + " when it should be " + itos(w) + "," + itos(h) + ":" + Image::get_format_name(format) + "): " + image_path[i]); + if (images[i]->get_width() != w || images[i]->get_height() != h || images[i]->get_format() != format) { + ERR_PRINTS("Image size mismatch (" + itos(images[i]->get_width()) + "," + itos(images[i]->get_height()) + ":" + Image::get_format_name(images[i]->get_format()) + " when it should be " + itos(w) + "," + itos(h) + ":" + Image::get_format_name(format) + "): " + image_path[i]); return; } } |