Make error obvious.

This commit is contained in:
K. S. Ernest (iFire) Lee 2021-11-10 23:25:29 -08:00
parent 5635219a3b
commit d59a2bf8d5

View file

@ -111,9 +111,12 @@ void ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, String p_strin
if (res != tvg::Result::Success) {
ERR_PRINT("ImageLoaderSVG can't create image.");
}
res = sw_canvas->sync();
if (res != tvg::Result::Success) {
ERR_PRINT("ImageLoaderSVG can't create image.");
}
Vector<uint8_t> image;
image.resize(width * height * sizeof(uint32_t));
sw_canvas->sync();
for (uint32_t y = 0; y < height; y++) {
for (uint32_t x = 0; x < width; x++) {
@ -127,7 +130,6 @@ void ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, String p_strin
free(buffer);
p_image->create(width, height, false, Image::FORMAT_RGBA8, image);
tvg::Initializer::term(tvg::CanvasEngine::Sw);
}
void ImageLoaderSVG::get_recognized_extensions(List<String> *p_extensions) const {