Commit Graph

5 Commits

Author SHA1 Message Date
Jonas Kulla 55f1542c76 Merge separate RGSS version build configs into one
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.
2014-08-28 23:22:05 +02:00
Jonas Kulla 751fdc599e Audio: Add MIDI format playback support
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.
2014-08-02 06:42:55 +02:00
Jonas Kulla 818ca18ebb ALStream: Actually fix issue referenced in prev commit
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.
2014-07-31 05:12:35 +02:00
Jonas Kulla 80937d0d06 ALStream: Fix sometimes not unqueuing all buffers before play
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.
2014-07-31 03:39:36 +02:00
Jonas Kulla f73b0ba4b5 audio.cpp: Split up into smaller parts 2014-07-23 17:28:20 +02:00