コード例 #1
0
ファイル: openttd.cpp プロジェクト: dolly22/openttd-sai
static void LoadIntroGame()
{
	_game_mode = GM_MENU;

	ResetGRFConfig(false);

	/* Setup main window */
	ResetWindowSystem();
	SetupColoursAndInitialWindow();

	/* Load the default opening screen savegame */
	if (SaveOrLoad("opntitle.dat", SL_LOAD, DATA_DIR) != SL_OK) {
		GenerateWorld(GWM_EMPTY, 64, 64); // if failed loading, make empty world.
		WaitTillGeneratedWorld();
		SetLocalCompany(COMPANY_SPECTATOR);
	} else {
		SetLocalCompany(COMPANY_FIRST);
	}

	_pause_mode = PM_UNPAUSED;
	_cursor.fix_at = false;

	CheckForMissingSprites();
	CheckForMissingGlyphsInLoadedLanguagePack();

	/* Play main theme */
	if (_music_driver->IsSongPlaying()) ResetMusic();
}
コード例 #2
0
Audio::~Audio() {
	
	for (int sound_id = 0; sound_id < MAX_SOUND; sound_id++) {
		if (IsSound(sound_id)) {
			ResetSound(sound_id);
		}
	}
	
	for (int music_id = 0; music_id < MAX_MUSIC; music_id++) {
		if (IsMusic(music_id)) {
			ResetMusic(music_id);
		}
	}
}
コード例 #3
0
void AOrionMusicManager::PlaySong()
{
	if (!NextSong)
	{
		ResetMusic();
		return;
	}

	MusicComponent->SetSound(NextSong);
	MusicComponent->FadeIn(2.0f, VolumeMax);

	CurrentSong = NextSong;

	GetWorldTimerManager().SetTimer(MusicTimer, this, &AOrionMusicManager::ResetMusic, FMath::Max(1.0f, NextSong->Duration - 2.0f), false);
}
コード例 #4
0
void MusicLoop()
{
	if (!_settings_client.music.playing && _song_is_active) {
		StopMusic();
	} else if (_settings_client.music.playing && !_song_is_active) {
		PlayPlaylistSong();
	}

	if (!_song_is_active) return;

	if (!MusicDriver::GetInstance()->IsSongPlaying()) {
		if (_game_mode != GM_MENU) {
			StopMusic();
			SkipToNextSong();
			PlayPlaylistSong();
		} else {
			ResetMusic();
		}
	}
}
コード例 #5
0
ファイル: music_gui.cpp プロジェクト: dolly22/openttd-sai
void MusicLoop()
{
	if (!_msf.playing && _song_is_active) {
		StopMusic();
	} else if (_msf.playing && !_song_is_active) {
		PlayPlaylistSong();
	}

	if (!_song_is_active) return;

	if (!_music_driver->IsSongPlaying()) {
		if (_game_mode != GM_MENU) {
			StopMusic();
			SkipToNextSong();
			PlayPlaylistSong();
		} else {
			ResetMusic();
		}
	}
}
コード例 #6
0
ファイル: SoundManager.cpp プロジェクト: LanJian/Surreal
int SoundManager::StopMusic(int snd){
    if(snd<0 && snd>=nMusics) return -1;
    ResetMusic(snd);
    return 0;
}
コード例 #7
0
void Audio::StopMusic(const int& music_id) {
	
	assert(IsMusic(music_id));
	
	ResetMusic(music_id);
}