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

Function func_play_tick

src/Engine/Adlib/adlplayer.cpp:785–813  ·  view source on GitHub ↗

MAIN FUNCTION - runs 1 tick of music according tempo

Source from the content-addressed store, hash-verified

783
784//MAIN FUNCTION - runs 1 tick of music according tempo
785void func_play_tick()
786{
787 bool another_loop;
788
789 if (!adl_gv_music_playing) return;
790 fade_volume_if_need();
791 adl_gv_tempo_run -= adl_gv_tempo;
792 if (adl_gv_tempo_run>0) return;
793 adl_gv_tempo_run += adl_gv_tempo_inc;
794
795 do {
796 another_loop = false;
797 for (int i=0; i<16; ++i)
798 {
799 int instr = adl_gv_instr_order[i];
800// if (instr!=10) continue;
801 if (instruments[instr].cur_address == 0) continue;
802 if (instruments[instr].cur_delay == 0)
803 {
804 instruments[instr].cur_delay = decode_op(instr,&another_loop);
805 if (!adl_gv_music_playing) break;
806 }
807 --instruments[instr].cur_delay;
808 }
809 if (!another_loop && adl_gv_music_playing) break;
810 init_music();
811 clear_channels();
812 } while (another_loop);
813}
814
815//MAIN FUNCTION - setup music for playing
816void func_setup_music(unsigned char* music_ptr, int length)

Callers 1

playerMethod · 0.85

Calls 4

fade_volume_if_needFunction · 0.85
decode_opFunction · 0.85
init_musicFunction · 0.85
clear_channelsFunction · 0.85

Tested by

no test coverage detected