aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library_sdl.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 88649c38..73848502 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -952,7 +952,12 @@ var LibrarySDL = {
SDL_MapRGB: function(fmt, r, g, b) {
// Canvas screens are always RGBA
- return r + (g << 8) + (b << 16);
+ return 0xff+((b&0xff)<<8)+((g&0xff)<<16)+((r&0xff)<<24)
+ },
+
+ SDL_MapRGBA: function(fmt, r, g, b, a) {
+ // Canvas screens are always RGBA
+ return (a&0xff)+((b&0xff)<<8)+((g&0xff)<<16)+((r&0xff)<<24)
},
SDL_WM_GrabInput: function() {},