GitBrincie212 / Apel-Mod

Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
Other
2 stars 1 forks source link

Render all frames when `processSpeed > 1` #48

Closed DarthSharkie closed 1 month ago

DarthSharkie commented 1 month ago

When processSpeed > 1, one out of N frames is dropped. This changes it to render all frames, thus letting the animator interceptor truly determine whether a frame should be rendered or not.

I do think this will change again if the proposal to have animators tick is selected, but in the interim, this is a good fix to apply.

GitBrincie212 commented 1 month ago

I need a bit more context on this one, also there is a conflict so yeh cannot add it

DarthSharkie commented 1 month ago

Conflict is fixed.

The existing code does not render all frames when processingSpeed > 1. It renders N-1 frames when processingSpeed is N because it schedules everything on the Nth frame instead of adding the Nth Runnable to the storedFuncsBuffer. This changes the code to make sure all frames are rendered. When processingSpeed is 1, directly schedule the step. Otherwise, add the Runnable, then if there are enough Runnables, schedule the step.