示例#1
0
文件: sound.cpp 项目: peres/scummvm
void Sound::adlibPlayBgMusic() {
	if (!_hasAdLib)
		return;

	if (!_adlPlayer)
		_adlPlayer = new ADLPlayer(*_vm->_mixer);

	static const char *tracksMac[] = {
//		"musmac1.adl", // TODO: This track isn't played correctly at all yet
		"musmac2.adl",
		"musmac3.adl",
		"musmac4.adl",
		"musmac5.adl",
		"musmac6.adl"
	};

	static const char *tracksWin[] = {
		"musmac1.mid",
		"musmac2.mid",
		"musmac3.mid",
		"musmac4.mid",
		"musmac5.mid"
	};

	if (_vm->getPlatform() == Common::kPlatformWindows) {
		int track = _vm->_util->getRandom(ARRAYSIZE(tracksWin));
		adlibPlayTrack(tracksWin[track]);
	} else {
		int track = _vm->_util->getRandom(ARRAYSIZE(tracksMac));
		adlibPlayTrack(tracksMac[track]);
	}
}
示例#2
0
void Sound::adlibPlayBgMusic() {
	if (!_hasAdLib || _hasAdLibBg)
		return;

	createADLPlayer();

	static const char *const tracksMac[] = {
//		"musmac1.adl", // This track seems to be missing instruments...
		"musmac2.adl",
		"musmac3.adl",
		"musmac4.adl",
		"musmac5.adl",
		"musmac6.adl"
	};

	static const char *const tracksWin[] = {
		"musmac1.mid",
		"musmac2.mid",
		"musmac3.mid",
		"musmac4.mid",
		"musmac5.mid"
	};

	const char *track = 0;
	if (_vm->getPlatform() == Common::kPlatformWindows)
		track = tracksWin[_vm->_util->getRandom(ARRAYSIZE(tracksWin))];
	else
		track = tracksMac[_vm->_util->getRandom(ARRAYSIZE(tracksMac))];

	if (!track || !_vm->_dataIO->hasFile(track)) {
		_hasAdLibBg = false;
		return;
	}

	adlibPlayTrack(track);
}