This newer version supports marking all of its declarations as
static, avoiding the conflict between the miniaudio audio backend,
and the copy of miniaudio embedded in clownaudio in the enhanced
branch.
- used __builtin_expect to get a 8.5% performance improvement
- used #pragma omp for to get a 30% performance improvement
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
...As opposed to once per draw call.
This change was made because multiple draw calls can be made per
frame, or a only a handful of draw calls may be made per minute.
Since draw calls are an inconsistent metric, I just switched to
frames instead.
This would occur in CSE2E's options menu.
It was caused by cute_spritebatch destroying a texture atlas that
was being used by the current unflushed vertex buffer. To solve
this, we now track what textures are being used by current buffer,
and flush the buffer when the texture are about to be
modified/deleted.
As you can guess, this issue doesn't affect the SDLTexture backend,
since its batching system is half-decent.
It was likely a race condition between the game thread writing to
'organya_timer', and the audio thread reading it.
...I really need to rethink the API for this Organya-synchronisation
thing.
I'm not sure why there was linear filtering when I was rendering at
1:1 pixel ratio, but it did happen. This fixes it by forcing
nearest-neighbour. The artefacting was caused by the linear filtering
blending with pixels outside the specified texture coordinates,
creating lines around everything.
Fun fact: the framebuffer technique CSE2 uses is demanding on the Pi
(1278x720 runs at 60 FPS when the framebuffer is forced to 852x480,
even though all the internal rendering is still 1278x720). I guess
rendering those extra 920160 pixels really takes its toll.
Apparently 2 VBOs wasn't enough. This bumped the framerate from 13FPS
to 20FPS in a stress-test (CSE2E at 1704x960 on a Raspberry Pi 3B
in X11 with the KMS OpenGL driver).