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

Improve src_rect handling in sprites, and especially the wave effect #147

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

WaywardHeart
Copy link

@WaywardHeart WaywardHeart commented Jan 10, 2024

This lets us properly handle src_rects that extend beyond the bounds of the bitmap. I doubt it's used much if it all in the wild, but I'm making use of it for my next PR...

Also, apparently the wave effect wasn't using src_rect's position at all. I'm amazed it took this long to get noticed.

Fixes #189

…too-large dimensions, and fix some behavior in wave effects.

src_rects like these probably aren't used in any game, but I plan on using them for megasurface support.

Additionally, src_rects in sprites with active wave effects were apparently broken before, always treating the position as (0,0).

I'm also fixing a small bug in how the wave position was calculated, and a slightly larger one in how it handles zooming.
Sprites with a negative wave_amp should be horizontally squished toward their center, not cropped.
@WaywardHeart
Copy link
Author

I took another look at this and added proper negative wave amp support, fixed high res bitmap support, and fixed some other issues with the original commit. That first commit should probably be two commits, but I'm too lazy to fix it.

Fixes #189

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.

Waving sprites with a width and height of 0 crash mkxp-z
1 participant