SDL_mixer can only stream a single music track
SDL_audiolib has unlimited streams.
With this change, we finally have streaming sounds (respecting
sfx_STREAM).
Audio options can now also be set via diablo.ini, which should help us
better diagnose the static noise issues.
1. StormLib now uses `bool` instead of `BOOL`
2. `WINAPI` was missing on `SFileSetFilePointer` (also the return type was incorrect)
3. There was a `WINAPI` on `SFileOpenFile` but that's not a StormLib function
Refs #1399
1. Removes a lock around allocation. `malloc` is required to be thread-safe in C11.
2. Defines it as a macro so that:
1. We provide the correct location for the OOM error.
2. We get better attribution from memory profilers.
SBmpLoadImage tried to get the size of the rest of the file incorrectly
by subtracting the current file position from the total size.
This was incorrect because file positions do not always begin at 0.
The only semi-portable way to get a size from file positions is to
subtract two file positions.
This commit serves 2 purposes:
1. Fixes CMake 3.13 compatibility when using
` -DDEVILUTIONX_SYSTEM_LIBSODIUM=OFF` (fixes#1222).
2. Ensures we do not build targets that are not depended on by us,
by passing `EXCLUDE_FROM_ALL` to `add_subdirectory`.
Adds an option to build libsodium from source instead of using the
system-provided one.
This is useful on systems that do not provide libsodium, or for testing
changes to libsodium along with devilutionx (by specifying
`-DFETCHCONTENT_SOURCE_DIR_LIBSODIUM`).
This also allows us to configure sodium to our liking when building it from source,
such as `SODIUM_MINIMAL`, which reduces the x64 release binary size from 4.3 MiB to 4.1 MiB.