DarkRadiant: master c52cfae1

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 29.06.2021 18:47 master 5e43e7b8
Changeset Fix mipmap size calculation for NPoT textures

Information online and in the TDM codebase indicates that mipmap dimensions
follow a simple integer division sequence, with an extra check to ensure that
each dimension is at least 1. The previous code added 1 before dividing by 2,
which gave wrong results for odd numbers (15 should divide to 7, not 8).

The unit test for NPoT DXT5 now confirms that mipmap sizes are correct and
match the observed mipmap sizes generated by the GIMP DDS exporter. However
this in itself does not fix the uploading to OpenGL of such textures in the
main application, which continues to give GL_INVALID_VALUE after uploading the
second mipmap.
mod - radiantcore/imagefile/dds.cpp Diff File
mod - test/ImageLoading.cpp Diff File