diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-02-06 00:38:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-02-06 00:38:39 -0300 |
commit | 6f2e16306a6552d704fb2346c9abdd26e0e523b7 (patch) | |
tree | e1fadf2a05d6f04675045b9e34128ed96628e07c /modules/squish | |
parent | af3fabeb7745e6f7f4e7fe7a299bdd234fff26a6 (diff) |
Several bugfixes, improving the import workflow
Diffstat (limited to 'modules/squish')
-rw-r--r-- | modules/squish/image_compress_squish.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index a48c1f3485..28c200596b 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -64,10 +64,9 @@ void image_compress_squish(Image *p_image) { p_image->convert(Image::FORMAT_RGBA8); //always expects rgba - int mm_count = p_image->get_mipmap_count(); - PoolVector<uint8_t> data; - int target_size = Image::get_image_data_size(w,h,target_format,mm_count); + int target_size = Image::get_image_data_size(w,h,target_format,p_image->has_mipmaps()?-1:0); + int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w,h,target_format) : 0; data.resize(target_size); PoolVector<uint8_t>::Read rb = p_image->get_data().read(); |