aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-14 16:54:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-14 16:54:44 -0700
commit294d4d9a29ec414a02d4112a2a782dfdeee57d6d (patch)
treec938adfd543d9a432b49cccfd06783bf907682f9 /src/library_sdl.js
parentbc2e57394e0c90addb8eaf6074159046511d7a69 (diff)
copy to pixels in SDL_Blit as well, and warn
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js8
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',