Setup active RGSS version at runtime. Desired version can be
specified via config, or as default, auto detected from the game
files. This removes the need to build specifically for each
version, which should help packaging a lot.
This also greatly reduces the danger of introducing code that
wouldn't compile on all RGSS version paths (as certain code paths
were completely ifdef'd out).
This can be optimized more, eg. not compiling shaders that aren't
needed in the active version.
This adds a new dependency with libfuildsynth. MIDI support
is built by default, but can be disabled if not desired.
All RTP songs should work well, but there are known problems
with other files (see README). Also, the pitch shift implementation
is somewhat poor and doesn't match RMXP (at least subjectively).
A soundfont is not included and must be provided by
the user themself.
This bug occured when starting playback of a stream, then immediately
stopping it, loading a different source, and starting playback again.
The real issue was that in stopStream(), the streaming thread had
not even queued anything yet, so it first decoded some data, then
started playing the source (which had already been stopped in the main
thread), and then finally saw the term request and stopped.
Instead stopping the source after the thread has definitely
terminated fixed the problem.
Very rarely rogue buffers would remain and play on loop on song
switch because we only ever cleared processed, not queued, buffers
from the source.
The correct way to completely clear a source's queue is to
simply attach a null buffer to it.