mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-12-11 05:11:25 +00:00
MP Core Mixer fade: Use fixed instead of double calc (fixes buildbots)
This commit is contained in:
parent
1da3b921dd
commit
de47ab63f2
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