mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 10:22:48 +01:00
- FMV sound fadeout when button pressed
This commit is contained in:
parent
c785dc7f33
commit
c64f283d1b
@ -240,6 +240,8 @@ void DoPlayFMV(RENDER_ARG* arg, int subtitles)
|
||||
int frame_size;
|
||||
int queue_counter = 0;
|
||||
|
||||
int fade_out = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (SDL_GetTicks() <= nextTime) // wait for frame
|
||||
@ -255,6 +257,15 @@ void DoPlayFMV(RENDER_ARG* arg, int subtitles)
|
||||
if (frame_size < 0)
|
||||
break;
|
||||
|
||||
if (fade_out > 0)
|
||||
{
|
||||
fade_out -= 18;
|
||||
if (fade_out < 0)
|
||||
break;
|
||||
|
||||
alSourcef(audioStreamSource, AL_GAIN, float(fade_out) / 255.0);
|
||||
}
|
||||
|
||||
if (frame_size > 0)
|
||||
{
|
||||
if (frame_entry.type == ReadAVI::ctype_compressed_video_frame)
|
||||
@ -311,8 +322,8 @@ void DoPlayFMV(RENDER_ARG* arg, int subtitles)
|
||||
|
||||
ReadControllers();
|
||||
|
||||
if (Pads[0].mapnew > 0)
|
||||
break;
|
||||
if (fade_out == 0 && Pads[0].mapnew > 0)
|
||||
fade_out = 255;
|
||||
}
|
||||
|
||||
alDeleteSources(1, &audioStreamSource);
|
||||
|
Loading…
Reference in New Issue
Block a user