mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-29 05:41:02 +00:00
MP Core Mixer fade: Use fixed instead of double calc (fixes buildbots)
This commit is contained in:
parent
ade637798b
commit
96fa8996db
1 changed files with 3 additions and 3 deletions
|
@ -565,11 +565,11 @@ static UINT32 music_fade(UINT32 interval, void *param)
|
|||
else
|
||||
{
|
||||
UINT8 delta = abs(fading_target - fading_source);
|
||||
double factor = (double)(fading_duration - fading_timer) / (double)fading_duration;
|
||||
fixed_t factor = FixedDiv(fading_duration - fading_timer, fading_duration);
|
||||
if (fading_target < fading_source)
|
||||
internal_volume = max(min(internal_volume, fading_source - (UINT8)round(delta * factor)), fading_target);
|
||||
internal_volume = max(min(internal_volume, fading_source - FixedMul(delta, factor)), fading_target);
|
||||
else if (fading_target > fading_source)
|
||||
internal_volume = min(max(internal_volume, fading_source + (UINT8)round(delta * factor)), fading_target);
|
||||
internal_volume = min(max(internal_volume, fading_source + FixedMul(delta, factor)), fading_target);
|
||||
Mix_VolumeMusic(get_real_volume(music_volume));
|
||||
return interval;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue