When the main loop should pause after running a tick, don't update the SDL audio queue.
This commit is contained in:
Родитель
a9664e598b
Коммит
cdaaa74df7
|
@ -1018,18 +1018,19 @@ mergeInto(LibraryManager.library, {
|
|||
}
|
||||
});
|
||||
|
||||
// Queue new audio data. This is important to be right after the main loop invocation, so that we will immediately be able
|
||||
// to queue the newest produced audio samples.
|
||||
// TODO: Consider adding pre- and post- rAF callbacks so that GL.newRenderingFrameStarted() and SDL.audio.queueNewAudioData()
|
||||
// do not need to be hardcoded into this function, but can be more generic.
|
||||
if (typeof SDL === 'object' && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
|
||||
|
||||
if (Browser.mainLoop.shouldPause) {
|
||||
// catch pauses from the main loop itself
|
||||
Browser.mainLoop.paused = true;
|
||||
Browser.mainLoop.shouldPause = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Queue new audio data. This is important to be right after the main loop invocation, so that we will immediately be able
|
||||
// to queue the newest produced audio samples.
|
||||
// TODO: Consider adding pre- and post- rAF callbacks so that GL.newRenderingFrameStarted() and SDL.audio.queueNewAudioData()
|
||||
// do not need to be hardcoded into this function, but can be more generic.
|
||||
if (typeof SDL === 'object' && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
|
||||
|
||||
Browser.mainLoop.scheduler();
|
||||
}
|
||||
if (fps && fps > 0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче