Skip to content

Commit

Permalink
sdl fixes; fixes emscripten-core#1251
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Jun 5, 2013
1 parent dbfb693 commit a887d4e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/library_sdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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') }}};
Expand Down

0 comments on commit a887d4e

Please sign in to comment.