demos: misc cleanups
This MR does a few tangential things:
- Switches to fmod() to fmodf() where it's trivially identical. There's a few not-quite trivial cases left, because it doesn't seem like a clear win to me to switch these over.
- Uses
fmodf()
for wrapping the rotations instead of (sloppily) open-coding it. This has the benefit of working as expected even if more than one round of rotation happened since the last frame, which can happen if the window was minimized for a while, for instance. We also reset every single round, instead of every tenth. This is in line with what the original gears.c is already doing.
The latter is really the goal of this MR, and is inspired by a patch in !178 (closed), but unfortunately the author has stopped responding.
But because some of these source has broken white-space, clean that up first.