Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clamp max of movie->tick to item->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, feeding 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 into animEffect(). Some of the AnimEffects already clamp x to a maximum of 1 (e.g. AnimEaseInElastic) but most don't. nesbox#1913 could also be fixed by clamping the fadePalette() value between 0 and 256, though the lerp animation will eventually overflow.
- Loading branch information