Gleb Mazovetskiy
9a1587060d
Use real `CalculateSoundPosition` with NOSOUND
...
Fixes big-endian tests, which currently build with `-DNOSOUND`
to reduce build time.
3 years ago
Gleb Mazovetskiy
6327e713e0
Lowercase all file paths
...
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).
This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
4 years ago
Gleb Mazovetskiy
04c3d85179
Remove `MAX_PATH`
...
Rather than using the Windows-like `MAX_PATH`, what we really want is 2
things:
1. Maximum path of a file in an MPQ. This is now `MaxMpqPathSize`.
2. Max size for the known monster paths. This is now 64 for sounds and
TRNs, which is more than enough (picked arbitrarily).
4 years ago
Gleb Mazovetskiy
f9f6949af2
Clean up `effects_play_sound`, `gfnSoundFunction`
4 years ago
Gleb Mazovetskiy
643c707c55
Remove strncmp
4 years ago
Anders Jenbo
16b65120ea
Clean up LevelMonsterTypes related code
4 years ago
Mikołaj Piróg
262fa9ac2d
Rename MonsterData members ( #5000 )
4 years ago
Gleb Mazovetskiy
33ac2cca8e
♻️ Make Monster counters `size_t`
4 years ago
Anders Jenbo
2d21fc372e
Remove more miniwin code
4 years ago
Gleb Mazovetskiy
53975d9264
monstdat: Simplify paths
...
1. Remove `Monsters\` from `sndfile` and `TransFile`.
2. Where `sndfile` is the same as `GraphicType`, set `sndfile` to
`nullptr`.
4 years ago
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
Mikołaj Piróg
7cab074aa5
Correct members' names in monster.h ( #4850 )
...
* Fix case in AnimStruct
* Rename CMonster members
4 years ago
Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
4 years ago
Mikołaj Piróg
2e7ff45fbf
Monster global constants cleanup ( #4827 )
...
* Change #defines to constexpr const, add constexpr where applicable, fix typos
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
Gleb Mazovetskiy
7f695c2835
Use SoundSample for music
...
Unifies audio handling between sound effects and music.
4 years ago
Gleb Mazovetskiy
b312edee49
Fix snd_deinit called even if snd_init failed
...
We were previously setting `was_sound_init` to true unconditionally
after calling `snd_init`.
However, `snd_init` can fail. Use `gbSndInited` instead.
4 years ago
qndel
d3995736b9
fix spawning unique monsters
4 years ago
qndel
b6e7c3818b
fix hellfire shareware monk
4 years ago
qndel
e087b109ea
fix hellfire shareware monk
4 years ago
Juliano Leal Goncalves
6146b828e9
🚚 Rename 'MonsterData' global to 'MonstersData'
...
This avoids conflicts with the struct name as we'll be renaming that next.
5 years ago
qndel
e82dc72d12
put commented out enums next to sounds
5 years ago
Anders Jenbo
77b72da276
♻️ Use monster by reference when possible
5 years ago
Anders Jenbo
74b57558c9
🚚 Move local code to anonymous namespace
5 years ago
Anders Jenbo
352a0ca510
Place local symbols in an anonymous namespace
5 years ago
Anders Jenbo
903d4bd2e1
Scope all for loops
...
This caused 7 of the loops to be rewriteen using range by clang-tidy
5 years ago
Anders Jenbo
96bf75b502
Rename player globals
5 years ago
Anders Jenbo
07ad083fda
Rename monster globals
5 years ago
Anders Jenbo
bc0d1f7ac0
clang-tidy/Android Stuidio cleanups 3
5 years ago
Anders Jenbo
bc59218d0d
More clang-tidy/Android Studio cleanups
5 years ago
Anders Jenbo
ecea12fc15
Clang-tidy: ParameterCase
5 years ago
Anders Jenbo
a350fb0b15
Clang-tidy: FunctionCase part 1
5 years ago
Anders Jenbo
b1d237c823
More init clean up ( #2262 )
5 years ago
Juliano Leal Goncalves
cbb84199c2
♻️ Replace Point addition with 'Point + Displacement'
5 years ago
Anders Jenbo
8e07ef8fe5
Clang-tidy: misc-unused-parameters
5 years ago
ephphatha
357f6f1dc3
Move RNG functions to their own header/source files
5 years ago
Anders Jenbo
8a4d38dd74
Stabalize clang-tidy runs
5 years ago
ephphatha
f4f6a8a51e
Refactor PlaySfxLoc to take a Point instead of x/y params
...
Because of the heavy usage of this function in objects.cpp and the mixed use of aliases and direct references to the active object in Operate*Door functions I've done some refactoring of those areas beyond what is strictly necessary. Hopefully this makes sense and is reasonable to include in this change.
5 years ago
ephphatha
bccf88dd8e
Refactor PlaySFX_priv to take a Point instead of x/y params
5 years ago
ephphatha
15c285c879
Refactor calc_snd_position to take a Point instead of x/y params
...
Appears this function is only called internally despite being in the effects header.
5 years ago
Anders Jenbo
22b632f04a
♻️ Clean up implicit bool conversions
5 years ago
Anders Jenbo
1cc0eb25ca
♻️ Use ranges for loops (clang-tidy)
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
Anders Jenbo
8a7ec56d3a
Player by reference part 2
...
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
5 years ago
Anders Jenbo
4a7ba94702
🎨 Run clang-format
5 years ago
thebigMuh
24f32a1d53
Fix sound volume/panning attenuation ( #1789 )
...
* Fixing volume adjustment and scaling
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
Anders Jenbo
93f9b852a2
🐛 Do not stop music when calling sound_stop()
...
Fixes #1782
5 years ago
Gleb Mazovetskiy
7bdfb0655c
🐞 Support multiple playback of the same sound
5 years ago