mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Add original music to login rotation and zone playlists
11 original tracks in assets/Original Music/ now play on the login screen and in thematically matched zones across Eastern Kingdoms and Kalimdor. Added crossfadeToFile to MusicManager for local file playback during zone transitions. New zones: Tirisfal, Undercity, Barrens, STV, Duskwood, Burning Steppes, Searing Gorge, Ironforge, Loch Modan, Orgrimmar, Durotar, Mulgore, Thunder Bluff, Darkshore, Teldrassil, Darnassus.
This commit is contained in:
parent
9fc41d6f30
commit
d2b46d410a
16 changed files with 392 additions and 17 deletions
|
|
@ -153,6 +153,7 @@ void MusicManager::crossfadeTo(const std::string& mpqPath, float fadeMs) {
|
|||
if (fadeMs > 0 && playing) {
|
||||
crossfading = true;
|
||||
pendingTrack = mpqPath;
|
||||
pendingIsFile = false;
|
||||
fadeTimer = 0.0f;
|
||||
fadeDuration = fadeMs / 1000.0f;
|
||||
AudioEngine::instance().stopMusic();
|
||||
|
|
@ -161,6 +162,21 @@ void MusicManager::crossfadeTo(const std::string& mpqPath, float fadeMs) {
|
|||
}
|
||||
}
|
||||
|
||||
void MusicManager::crossfadeToFile(const std::string& filePath, float fadeMs) {
|
||||
if (filePath == currentTrack && playing) return;
|
||||
|
||||
if (fadeMs > 0 && playing) {
|
||||
crossfading = true;
|
||||
pendingTrack = filePath;
|
||||
pendingIsFile = true;
|
||||
fadeTimer = 0.0f;
|
||||
fadeDuration = fadeMs / 1000.0f;
|
||||
AudioEngine::instance().stopMusic();
|
||||
} else {
|
||||
playFilePath(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
void MusicManager::update(float deltaTime) {
|
||||
// Check if music is still playing
|
||||
if (playing && !AudioEngine::instance().isMusicPlaying()) {
|
||||
|
|
@ -173,8 +189,13 @@ void MusicManager::update(float deltaTime) {
|
|||
if (fadeTimer >= fadeDuration * 0.3f) {
|
||||
// Start new track after brief pause
|
||||
crossfading = false;
|
||||
playMusic(pendingTrack);
|
||||
if (pendingIsFile) {
|
||||
playFilePath(pendingTrack);
|
||||
} else {
|
||||
playMusic(pendingTrack);
|
||||
}
|
||||
pendingTrack.clear();
|
||||
pendingIsFile = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue