diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-25 19:23:56 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-25 19:23:56 -0500 |
commit | 230c0e80dfcd44870bec3254c399db430f6e1d98 (patch) | |
tree | 745ec3b082adc222050b4d48a416d7a969dd148d /src/library_sdl.js | |
parent | 5a99d2567e76f257309cfd225876f3a5402e5f46 (diff) | |
parent | 9d4ef477a511ae4136c2d63e0150a4768cbd53ea (diff) |
Merge branch 'incoming'
Conflicts:
AUTHORS
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index cfab6410..e02e1e62 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -607,9 +607,11 @@ var LibrarySDL = { SDL_Init: function(what) { SDL.startTime = Date.now(); // capture all key events. we just keep down and up, but also capture press to prevent default actions - document.onkeydown = SDL.receiveEvent; - document.onkeyup = SDL.receiveEvent; - document.onkeypress = SDL.receiveEvent; + if (!Module['doNotCaptureKeyboard']) { + document.onkeydown = SDL.receiveEvent; + document.onkeyup = SDL.receiveEvent; + document.onkeypress = SDL.receiveEvent; + } window.onunload = SDL.receiveEvent; SDL.keyboardState = _malloc(0x10000); _memset(SDL.keyboardState, 0, 0x10000); @@ -1077,7 +1079,9 @@ var LibrarySDL = { } var surf = SDL.makeSurface(raw.width, raw.height, 0, false, 'load:' + filename); var surfData = SDL.surfaces[surf]; + surfData.ctx.globalCompositeOperation = "copy"; surfData.ctx.drawImage(raw, 0, 0, raw.width, raw.height, 0, 0, raw.width, raw.height); + surfData.ctx.globalCompositeOperation = "source-over"; // XXX SDL does not specify that loaded images must have available pixel data, in fact // there are cases where you just want to blit them, so you just need the hardware // accelerated version. However, code everywhere seems to assume that the pixels @@ -1176,6 +1180,10 @@ var LibrarySDL = { // SDL Mixer + Mix_Init: function(flags) { + return 8; /* MIX_INIT_OGG */ + }, + Mix_OpenAudio: function(frequency, format, channels, chunksize) { SDL.allocateChannels(32); // Just record the values for a later call to Mix_QuickLoad_RAW |