workaround to make SDL behave with latest emscripten
This commit is contained in:
parent
cc68cca430
commit
52742d8d99
2 changed files with 14 additions and 3 deletions
|
@ -7,6 +7,14 @@ Module['preRun'].push(function() {
|
|||
|
||||
FS.mkdir('/persistent');
|
||||
FS.mount(IDBFS, {}, '/persistent');
|
||||
|
||||
// This function has been removed from Emscripten, but SDL still uses it...
|
||||
Module['Pointer_stringify'] = function(ptr) {
|
||||
return UTF8ToString(ptr);
|
||||
}
|
||||
|
||||
Pointer_stringify = Module['Pointer_stringify']
|
||||
window.Pointer_stringify = Module['Pointer_stringify']
|
||||
});
|
||||
|
||||
function SyncFS(is_load, ccptr) {
|
||||
|
|
|
@ -76,9 +76,12 @@ static bool em_audio_workaround(SDL_Event *event, void *arg) {
|
|||
// Will start playing audio as soon as the first input occurs.
|
||||
|
||||
(__extension__ EM_ASM({
|
||||
var audioctx = Module['SDL2'].audioContext;
|
||||
if(audioctx !== undefined) {
|
||||
audioctx.resume();
|
||||
var sdl2 = Module['SDL2'];
|
||||
if(sdl2 !== undefined) {
|
||||
var audioctx = sdl2.audioContext;
|
||||
if(audioctx !== undefined) {
|
||||
audioctx.resume();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue