mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-08-01 18:29:24 -04:00
Starting the login track read a ~6MB MP3 inside the render frame that asked for it, then AudioEngine::playMusic copied the whole buffer again. That was the 200ms and 160ms 'SLOW render stage uiManager->render' frames at startup. The read now runs on a worker and update() hands the bytes to the AudioEngine, so every miniaudio call still happens on the main thread. playMusic takes ownership and moves instead of copying. A track already loading is not a failure: AuthScreen checked isPlaying() right after the call and would otherwise have dropped a good track and re-picked one every frame. A request for a different track replaces the in-flight one so a zone crossfade is never silently dropped.