Ejemplo n.º 1
0
void Music::yield() {
    if( !init_flag )
	return;

    int oldSongId = song_id;

    if( config.cd_music_volume ) {
	if( !is_playing() ) {
	    vga_front.temp_unlock();
	    //DEBUG_LOG("Music::yield(): play random");	//##
	    vga_front.temp_restore_lock();

	    int songId;

	    while(1) {
		songId = random_bgm_track(oldSongId);

		//--- only play Christmas music in December ---//

		if( songId==9 && info.game_month != 12 )
		    continue;

		//--- only play Graduation March music in May or June ---//

		if( songId==10 && info.game_month != 5 && info.game_month != 6 )
		    continue;

		play( songId, sys.cdrom_drive ? MUSIC_CD_THEN_WAV : 0 );
		return;
	    }
	}
    }
}
Ejemplo n.º 2
0
void Music::yield()
{
	if( !init_flag )
		return;

	int oldSongId = song_id;

	if( config.music_flag )
	{
		if( !is_playing() )
			play(random_bgm_track(oldSongId), sys.cdrom_drive ? MUSIC_CD_THEN_WAV : 0 );
	}
	else
	{
		stop();			// stop any music playing
	}
}