Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect pointer math in SpriteContentsInterpolationMixin #2185

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

embeddedt
Copy link
Contributor

The pointer math in SpriteContentsInterpolationMixin doesn't correctly handle textures where src.getWidth() > width or curX, nextX > 0. This PR fixes that by calculating the pointer for each line of the image instead of just once outside the main mixing loop. As a side effect, the code is a bit easier to reason about.

A test resource pack is attached that reproduces the issue with the minecraft:paper item.
testpack.zip

@jellysquid3 jellysquid3 merged commit b06a23c into CaffeineMC:dev Nov 29, 2023
1 check passed
@embeddedt embeddedt deleted the fix/interpolated-textures branch November 29, 2023 23:17
IMS212 pushed a commit to IMS212/sodium-fabric that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants