From 6f2e16306a6552d704fb2346c9abdd26e0e523b7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 6 Feb 2017 00:38:39 -0300 Subject: Several bugfixes, improving the import workflow --- modules/squish/image_compress_squish.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modules/squish') 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 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::Read rb = p_image->get_data().read(); -- cgit v1.2.3