mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 20:03:44 +02:00
emscripten: Unify creation of Module['SDL3'] in at SDL_Init time.
(cherry picked from commit 7d093940a7)
This commit is contained in:
@@ -116,9 +116,6 @@ static bool DUMMYAUDIO_Init(SDL_AudioDriverImpl *impl)
|
||||
// on Emscripten without threads, we just fire a repeating timer to consume audio.
|
||||
#if defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
|
||||
MAIN_THREAD_EM_ASM({
|
||||
if (typeof(Module['SDL3']) === 'undefined') {
|
||||
Module['SDL3'] = {};
|
||||
}
|
||||
Module['SDL3'].dummy_audio = {};
|
||||
Module['SDL3'].dummy_audio.timers = [];
|
||||
Module['SDL3'].dummy_audio.timers[0] = undefined;
|
||||
|
||||
@@ -151,9 +151,6 @@ static bool EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||
|
||||
// create context
|
||||
const bool result = MAIN_THREAD_EM_ASM_INT({
|
||||
if (typeof(Module['SDL3']) === 'undefined') {
|
||||
Module['SDL3'] = {};
|
||||
}
|
||||
var SDL3 = Module['SDL3'];
|
||||
if (typeof(SDL3.audio_playback) === 'undefined') {
|
||||
SDL3.audio_playback = {};
|
||||
|
||||
Reference in New Issue
Block a user