mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 00:43:46 +00:00
Use dummy driver when JS AudioContext is unavailable.
This commit is contained in:
parent
399e2c1db0
commit
357e99a31e
5 changed files with 45 additions and 10 deletions
|
@ -74,10 +74,17 @@ void main_loop_callback() {
|
|||
}
|
||||
if (os->main_loop_iterate()) {
|
||||
emscripten_cancel_main_loop(); // Cancel current loop and wait for finalize_async.
|
||||
/* clang-format off */
|
||||
EM_ASM({
|
||||
// This will contain the list of operations that need to complete before cleanup.
|
||||
Module.async_finish = [];
|
||||
Module.async_finish = [
|
||||
// Always contains at least one async promise, to avoid firing immediately if nothing is added.
|
||||
new Promise(function(accept, reject) {
|
||||
setTimeout(accept, 0);
|
||||
})
|
||||
];
|
||||
});
|
||||
/* clang-format on */
|
||||
os->get_main_loop()->finish();
|
||||
os->finalize_async(); // Will add all the async finish functions.
|
||||
EM_ASM({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue