MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / fade_volume_if_need

Function fade_volume_if_need

src/Engine/Adlib/adlplayer.cpp:527–541  ·  view source on GitHub ↗

decrease volume until 0 with each call, and then stops music

Source from the content-addressed store, hash-verified

525
526//decrease volume until 0 with each call, and then stops music
527void fade_volume_if_need()
528{
529 if (!adl_gv_want_fade) return;
530 if (--adl_gv_tmp_music_volume == 0)
531 {
532 func_mute();
533 adl_gv_want_fade = false;
534 adl_gv_tmp_music_volume = adl_gv_master_music_volume;
535 return;
536 }
537 for (int i=0; i<12; ++i)
538 {
539 adlib_set_amplitude(i, (adlib_channels[i].cur_volume*adl_gv_tmp_music_volume)>>7);
540 }
541}
542
543// checks if there are unused adlib channels
544bool free_channel_available()

Callers 1

func_play_tickFunction · 0.85

Calls 2

func_muteFunction · 0.85
adlib_set_amplitudeFunction · 0.85

Tested by

no test coverage detected