Closed pedro-w closed 2 years ago
Heh. I was working on something peripherally related: dev/onlinecop/encapsulate_sounds.
It was intended to move some of the sound/music initialization out of global variables into a common class, to help with future refactoring (mainly, to clean up the Configuration window and its logic).
@pedro-w Will music_mix.cpp
completely replace music.cpp
as we're no longer using DUMB?
I'd vote to src/music_mix.cpp => src/music.cpp.
I've made changes to use std::clamp
- I think if you merge this PR before #87 it will go smoother
I also renamed the file, now if you merge #87 it will still show conflicts but much easier to resolve.
Don't forget to change CMakeLists.txt from src/music_mix.cpp
to src/music.cpp
.
This crashes for me. num_channels is 0 and line mixer.c:1072 is divide by 0
I'm getting the same thing. I'm writing up a bug for this now.
Created #89; it appears that starting a new game works fine but loading a saved game causes num_channels to be 0.
Seems like the music isn't getting initialized properly and we aren't checking it? It worked for me so may be only on Windows?
Also straightened up the interface to KMusic so both
set_volume
andset_music_volume
take a single int param which is a volume 0 (silent) to 250 (loudest)