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
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
6e1a106a38
🚚 Move header we implement into the project
5 years ago
Anders Jenbo
67a7ff98c5
🚨 Clean up compiler warnings
5 years ago
Anders Jenbo
52401c9677
💚 Correct include headers
5 years ago
Anders Jenbo
dc84643fe6
🚚 Move dx.cpp and sound.cpp back in to Source now that the name space is clean
5 years ago
Anders Jenbo
61244c4d93
♻️ Rearange and apply more enums
5 years ago
Anders Jenbo
93d42b62b8
♻️ Change BOOL to bool
5 years ago
Anders Jenbo
4ee84aea1a
♻️ Change BOOLEAN to bool
...
fixup BOOLEAN
5 years ago
Anders Jenbo
433edc63ea
♻️ Consistently use pragma once to guard the headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Juliano Leal Goncalves
800dbce066
♻️ Move options-related structs to new 'options.h' file
5 years ago