Gleb Mazovetskiy
197e1180b2
Add StrCat and StrAppend
...
Adds simple string / integer concatenation functions.
Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.
`StrCat` is an easier-to-read alternative to such uses of `fmt`.
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
staphen
83168f7954
Add option for selecting audio device
4 years ago
Anders Jenbo
9d082389d8
Clean up music track selection
4 years ago
Anders Jenbo
0645d9b2a1
Correct missing hellfire level mapping in leveltype
...
Hellfire never added the 2 new dungion types, instead it makes
additional checks on currlevel. This is confusing and mess, so cleaned
it up.
4 years ago
Gleb Mazovetskiy
7f695c2835
Use SoundSample for music
...
Unifies audio handling between sound effects and music.
4 years ago
Gleb Mazovetskiy
5645456537
Support MP3 playback
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
obligaron
79b926c375
Move more options to OptionEntryBase
4 years ago
staphen
6418d7a2f0
Detect window focus state to mute automatically when starting audio
4 years ago
staphen
f085aa1aad
Use mute()/unmute() instead of setVolume()
4 years ago
obligaron
8a4d4b6375
Add OptionEntries for Audio
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
Gleb Mazovetskiy
fa90679416
game_assets.* -> assets.*
4 years ago
Gleb Mazovetskiy
b4aa0a2093
Open music assets with threadsafe=true
...
Missed during #3354
4 years ago
Gleb Mazovetskiy
3d308983a8
Migrate to libmpq
...
libmpq is a much simpler alternative to StormLib for reading MPQ archives.
We use our own fork of libmpq: https://github.com/diasurgical/libmpq
Impact:
* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
4 years ago
qndel
c26501f59e
fix sound crashes ( #3403 )
4 years ago
qndel
47561716b3
fix sound crashes ( #3403 )
4 years ago
Anders Jenbo
8df5912dc6
Always use SDL wrapper for file access
4 years ago
Anders Jenbo
7cb73a6717
Minimize impact of NOSOUND
5 years ago
Vladimir Olteanu
8fcd21e0b5
music.cpp: make musicBuffer a unique_ptr
5 years ago
Anders Jenbo
de0b3a38b8
Apply code style
5 years ago
Anders Jenbo
e5fc7fd17c
Move remaning symbols in to anonymous namespaces
5 years ago
Anders Jenbo
0889780923
Remove more usage of miniwin types
5 years ago
JoBergeron
be3f1ba928
Pause game and mute music when game window loses focus ( #2337 )
5 years ago
Anders Jenbo
9ebdb6db69
General clean up
5 years ago
Anders Jenbo
a7c7fa0030
Fully apply clang-tidy/format to all files
5 years ago
Anders Jenbo
129342d07a
Clang-tidy: GlobalConstantCase
5 years ago
Anders Jenbo
f167bd4dfb
Clang-tidy: llvm-include-order
5 years ago
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract `Point`, `Direction`, `clamp`
...
`engine.h` is getting quite bloated. Moves this code to their own files.
5 years ago
Gleb Mazovetskiy
e72def02e6
🔨 Add `STREAM_ALL_AUDIO` build setting
...
For extremely memory-constrained devices. Gets into town on RG99 (18 FPS -> 14 FPS).
5 years ago
Gleb Mazovetskiy
c79ec673f4
♻️ Implement std's Lockable for SDL mutex wrapper
...
Rather than rolling our own lock guard, implement the requirements for
using `std::lock_guard` et al and use that.
5 years ago
Anders Jenbo
a095bc0bf7
♻️ Migrate more code away from miniwin
5 years ago
staphen
3e5e5b2696
Synchronize SFileCloseFile() access
5 years ago
Anders Jenbo
4a7ba94702
🎨 Run clang-format
5 years ago
Gleb Mazovetskiy
0f95c3cbac
🧹 Fix a TSAN warning in DuplicateSound
...
This is likely a false positive from TSAN but good to fix nevertheless
Fixes #1849
5 years ago
Gleb Mazovetskiy
987ab2533b
🐞 Synchronize SFileReadFile access
...
StormLib read function is not thread-safe: https://github.com/ladislav-zezula/StormLib/issues/175
5 years ago
thebigMuh
24f32a1d53
Fix sound volume/panning attenuation ( #1789 )
...
* Fixing volume adjustment and scaling
5 years ago
Gleb Mazovetskiy
9980b77d23
🐞 ClearDuplicateSounds: Also lock the mutex
5 years ago
Gleb Mazovetskiy
559229dea1
🐞 Duplicate sounds: Fix data race
...
This fixes a data race by deleting the sound exactly when it finishes
playing.
Previously, a data race could happen in
`CleanupFinishedDuplicateSounds`, where the sound would be destroyed
while Aulib was reading from its buffer.
5 years ago
Gleb Mazovetskiy
0bfc147b78
🧹 Remove `DiabloAllocPtr` and friends ( #1824 )
5 years ago
Gleb Mazovetskiy
5820948761
♻️ Make `SFileRw` own the Storm file handle
...
All of our use-cases for `SDL_RWops` Storm file require closing the file
when closing the `SDL_RWops` -- doing this automatically simplifies the
code.
5 years ago
Gleb Mazovetskiy
7bdfb0655c
🐞 Support multiple playback of the same sound
5 years ago
Vladimir Olteanu
7aad72f96d
Use automatic memory management for sound stuff ( #1771 )
5 years ago
Gleb Mazovetskiy
0dd9aeea69
♻️ Cleanup DISABLE_STREAMING_MUSIC handling
...
Extracts `LoadMusic` and `CleanupMusic` functions.
5 years ago
Gleb Mazovetskiy
4b7409a8bf
🎶 Loop the music
...
Follow-up to #1651
5 years ago
Gleb Mazovetskiy
acee2ef14c
🎉 Switch from SDL_mixer to SDL_audiolib
...
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.
5 years ago
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Anders Jenbo
a32ac83090
🎨 cleanup trivial trype comparisons
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago