Merge branch 'fix-module-volume' into 'next'

Make module music volume more accurate

See merge request STJr/SRB2!2215
This commit is contained in:
sphere 2023-11-29 11:21:07 +00:00
commit 553c4b9ce9

View file

@ -759,8 +759,8 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
music_volume = 18;
// apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++)
*p = ((INT32)*p) * (music_volume*internal_volume/100)*2 / 40;
for (i = 0, p = (short *)stream; i < len / 2; i++, p++)
*p = ((INT32)*p) * music_volume * internal_volume / 100 / 20;
}
#endif
@ -783,8 +783,8 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
music_volume = 18;
// apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++)
*p = ((INT32)*p) * (music_volume*internal_volume/100)*2 / 40;
for (i = 0, p = (short *)stream; i < len / 2; i++, p++)
*p = ((INT32)*p) * music_volume * internal_volume / 100 / 20;
}
#endif