projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 365 forks source link

Use renderContext for preset state time, frame, fps, progress #772

Closed dpw13 closed 4 months ago

dpw13 commented 4 months ago

The robotopia preset uses the current time in per-waveform calculations. For custom waveforms, this is pulled directly from the preset state's time field. However, this field is never set and is permanently zero. For custom shapes, the time is pulled from the preset state's render context. Looking through the code, it appears that these values migrated to the render context at some point but weren't updated everywhere. I've removed these fields from the preset state entirely to prevent confusion and updated references to the preset state's time, frame, fps, and progress counters to use the preset state's render context. This fixes (I think) the shifter - robotopia presets.

kblaschke commented 4 months ago

shifter - robotopia

This PR definitely fixes the preset - and probably many others, too! Thanks for looking into it, good to see it was just another part that got lost (or never was fixed) in my refactoring of the renderer. Really helps to have another pair of eyes on the code - so important.