Fix stex import into black textures when lossless and lossy are selected, closes #8801
This commit is contained in:
parent
6161e731d0
commit
d093b78f12
@ -406,7 +406,7 @@ Image::Format StreamTexture::get_format() const {
|
|||||||
return format;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> image, int p_size_limit) {
|
Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> &image, int p_size_limit) {
|
||||||
|
|
||||||
ERR_FAIL_COND_V(image.is_null(), ERR_INVALID_PARAMETER);
|
ERR_FAIL_COND_V(image.is_null(), ERR_INVALID_PARAMETER);
|
||||||
|
|
||||||
@ -502,6 +502,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
|
|||||||
memdelete(f);
|
memdelete(f);
|
||||||
ERR_FAIL_COND_V(img->empty(), ERR_FILE_CORRUPT);
|
ERR_FAIL_COND_V(img->empty(), ERR_FILE_CORRUPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
total_size += img->get_data().size();
|
total_size += img->get_data().size();
|
||||||
|
|
||||||
mipmap_images.push_back(img);
|
mipmap_images.push_back(img);
|
||||||
|
@ -170,7 +170,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Error _load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> image, int p_size_limit = 0);
|
Error _load_data(const String &p_path, int &tw, int &th, int &flags, Ref<Image> &image, int p_size_limit = 0);
|
||||||
String path_to_file;
|
String path_to_file;
|
||||||
RID texture;
|
RID texture;
|
||||||
Image::Format format;
|
Image::Format format;
|
||||||
|
Loading…
Reference in New Issue
Block a user