diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-05 12:32:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-05 12:32:15 -0700 |
commit | a887d4e7c6250a03e8415a1fbf24cc58a6158124 (patch) | |
tree | 143a82b6e20a776acf7f643e531ec437ddbc9f05 /src | |
parent | dbfb693b60d826a4833c42a96b94ad477198166f (diff) |
sdl fixes; fixes #1251
Diffstat (limited to 'src')
-rw-r--r-- | src/library_sdl.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index aa7ab532..e8419536 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -936,7 +936,10 @@ var LibrarySDL = { }, SDL_GetError: function() { - return allocate(intArrayFromString("unknown SDL-emscripten error"), 'i8'); + if (!SDL.errorMessage) { + SDL.errorMessage = allocate(intArrayFromString("unknown SDL-emscripten error"), 'i8', ALLOC_NORMAL); + } + return SDL.errorMessage; }, SDL_CreateRGBSurface: function(flags, width, height, depth, rmask, gmask, bmask, amask) { @@ -1173,7 +1176,7 @@ var LibrarySDL = { if (obtained) { {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.freq', 'SDL.audio.freq', 'i32') }}}; // no good way for us to know if the browser can really handle this - {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.format', 33151, 'i16') }}}; // float, signed, 32-bit + {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.format', 33040, 'i16') }}}; // float, signed, 16-bit {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.channels', 'SDL.audio.channels', 'i8') }}}; {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.silence', makeGetValue('desired', 'SDL.structs.AudioSpec.silence', 'i8', 0, 1), 'i8') }}}; // unclear if browsers can provide this {{{ makeSetValue('obtained', 'SDL.structs.AudioSpec.samples', 'SDL.audio.samples', 'i16') }}}; |