summaryrefslogtreecommitdiff
path: root/modules/basis_universal
diff options
context:
space:
mode:
authorLyuma <xn.lyuma@gmail.com>2023-02-26 15:55:01 -0800
committerLyuma <xn.lyuma@gmail.com>2023-02-26 16:01:54 -0800
commit0addf380475e7002f5dc4cc6157b6074d3046fdd (patch)
treeb9d5cc0870b81e5de3666d20bea45fec98707b49 /modules/basis_universal
parent0cd148313213e2923004be65bafd6a3781c917ec (diff)
basisu: Loop over the last mipmap lod
Diffstat (limited to 'modules/basis_universal')
-rw-r--r--modules/basis_universal/register_types.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp
index c5db9b9933..f7bdaf389e 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -74,7 +74,7 @@ static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::
params.m_source_images.push_back(buimg_image);
}
basisu::vector<basisu::image> images;
- for (int32_t mip_map_i = 1; mip_map_i < image->get_mipmap_count(); mip_map_i++) {
+ for (int32_t mip_map_i = 1; mip_map_i <= image->get_mipmap_count(); mip_map_i++) {
Ref<Image> mip_map = image->get_image_from_mipmap(mip_map_i);
Vector<uint8_t> mip_map_vec = mip_map->get_data();
basisu::image buimg_mipmap(mip_map->get_width(), mip_map->get_height());
@@ -247,7 +247,7 @@ static Ref<Image> basis_universal_unpacker_ptr(const uint8_t *p_data, int p_size
dst[i] = 0x00;
}
uint32_t mip_count = Image::get_image_required_mipmaps(info.m_orig_width, info.m_orig_height, imgfmt);
- for (uint32_t level_i = 0; level_i < mip_count; level_i++) {
+ for (uint32_t level_i = 0; level_i <= mip_count; level_i++) {
basist::basisu_image_level_info level;
tr.get_image_level_info(ptr, size, level, 0, level_i);
int ofs = Image::get_image_mipmap_offset(info.m_width, info.m_height, imgfmt, level_i);