diff options
-rw-r--r-- | src/library_sdl.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index f9c1c0e2..3ca74765 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -642,6 +642,12 @@ var LibrarySDL = { dr = { x: 0, y: 0, w: -1, h: -1 }; } dstData.ctx.drawImage(srcData.canvas, sr.x, sr.y, sr.w, sr.h, dr.x, dr.y, sr.w, sr.h); + if (dst != SDL.screen) { + // XXX As in IMG_Load, for compatibility we write out |pixels| + console.log('WARNING: copying canvas data to memory for compatibility'); + _SDL_LockSurface(dst); + dstData.locked--; // The surface is not actually locked in this hack + } return 0; }, @@ -714,7 +720,7 @@ var LibrarySDL = { // accelerated version. However, code everywhere seems to assume that the pixels // are in fact available, so we retrieve it here. This does add overhead though. _SDL_LockSurface(surf); - surfData.locked = 0; // The surface is not actually locked in this hack + surfData.locked--; // The surface is not actually locked in this hack return surf; }, SDL_LoadBMP: 'IMG_Load', |