Fixes: "Mipmap not found in texture" exception for textures with a height that isn't a multiple of 4 but is compressed. #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The DDS specification technically does not allow textures that have any dimensions that is not a multiple of 4, though many programs will allow it anyways by filling out the extra blocks with bogus data. The game seems to support this but CodeWalker has been unable to display these after loading them from a YTD for a long time due to not loading the full image data in these circumstances. These images would be displayed fine when initially imported into the YTD off the filesystem as the data was correctly loaded. This PR aims to fix this by taking the height and adjusting to the next multiple of 4 to ensure all image data is loaded since CodeWalker was already correctly storing all of that data in the YTD. The extra loaded blocks will later be discarded anyways.