fade_volume_reset should always be set for fade ins.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 11 Oct 2009 06:21:55 +0000
changeset 44441b7df493dad
parent 443 d842a759e68a
child 445 a1ab5dc029ad
fade_volume_reset should always be set for fade ins.

...as they are new sounds starting.
mixer.c
     1.1 --- a/mixer.c	Sun Oct 11 05:29:55 2009 +0000
     1.2 +++ b/mixer.c	Sun Oct 11 06:21:55 2009 +0000
     1.3 @@ -825,15 +825,11 @@
     1.4  			mix_channel[which].paused = 0;
     1.5  			mix_channel[which].fading = MIX_FADING_IN;
     1.6  			mix_channel[which].fade_volume = mix_channel[which].volume;
     1.7 +			mix_channel[which].fade_volume_reset = mix_channel[which].volume;
     1.8  			mix_channel[which].volume = 0;
     1.9  			mix_channel[which].fade_length = (Uint32)ms;
    1.10  			mix_channel[which].start_time = mix_channel[which].ticks_fade = sdl_ticks;
    1.11  			mix_channel[which].expire = (ticks > 0) ? (sdl_ticks+ticks) : 0;
    1.12 -
    1.13 -			/* only change fade_volume_reset if we're not fading. */
    1.14 -			if (mix_channel[which].fading == MIX_NO_FADING) {
    1.15 -				mix_channel[which].fade_volume_reset = mix_channel[which].volume;
    1.16 -			}
    1.17  		}
    1.18  	}
    1.19  	SDL_UnlockAudio();