OnlineCop / kq-fork

Fork of KQ r910. Just for fun.
GNU General Public License v2.0
16 stars 9 forks source link

Allow global setting sound/music volume #83

Closed pedro-w closed 2 years ago

pedro-w commented 2 years ago

Also straightened up the interface to KMusic so both set_volume and set_music_volume take a single int param which is a volume 0 (silent) to 250 (loudest)

OnlineCop commented 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).

OnlineCop commented 2 years ago

@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.

pedro-w commented 2 years ago

I've made changes to use std::clamp - I think if you merge this PR before #87 it will go smoother

pedro-w commented 2 years ago

I also renamed the file, now if you merge #87 it will still show conflicts but much easier to resolve.

OnlineCop commented 2 years ago

Don't forget to change CMakeLists.txt from src/music_mix.cpp to src/music.cpp.

z9484 commented 2 years ago

This crashes for me. num_channels is 0 and line mixer.c:1072 is divide by 0

OnlineCop commented 2 years ago

I'm getting the same thing. I'm writing up a bug for this now.

OnlineCop commented 2 years ago

Created #89; it appears that starting a new game works fine but loading a saved game causes num_channels to be 0.

pedro-w commented 2 years ago

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?