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

Clamp input to animEffect() #2149

Merged
merged 1 commit into from
Mar 2, 2023
Merged

Conversation

Madadog
Copy link
Contributor

@Madadog Madadog commented Mar 2, 2023

Fixes #1913.

animEffect() seems to expect a value between 0 and 1, and #1913 is caused by the surf coverFade animation lerping past 1, which feeds values greater than 256 into fadePalette(), causing the flashing colors. This PR clamps movie ticks for each item ensuring animEffect won't receive values > 1.

This could create issues if any animation items rely on playing past their end. I didn't notice any while visually checking the editor and surf menu animations, but I could easily have missed something.

It might be better to move this clamp directly to the start of animEffect().

Alternative fixes for #1913 include clamping the fadePalette() value between 0 and 256, or stopping the animation at the right time.

Fixes nesbox#1913.

animEffect() seems to expect a value between 0 and 1, and nesbox#1913 is caused by the surf coverFade animation lerping past 1, which feeds values greater than 256 into fadePalette(), causing the flashing colors. This PR clamps movie ticks for each item ensuring animEffect won't receive values > 1.

This could create issues if any animation items rely on playing past their end. I didn't notice any while visually checking the editor and surf menu animations, but I could easily have missed something.

It might be better to move this clamp directly to the start of animEffect().

Alternative fixes for nesbox#1913 include clamping the fadePalette() value between 0 and 256, or stopping the animation at the right time.
@nesbox nesbox merged commit 40c5f2d into nesbox:main Mar 2, 2023
@nesbox
Copy link
Owner

nesbox commented Mar 2, 2023

Thank you for pointing me to where this is going, because I've tried to investigate issue #1913 without success.

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.

Flashing colors in surf menu
2 participants