aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-08 13:41:07 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-08 13:41:07 -0700
commit4c414368070c66e0f9d5e4feb03c9e62ddb62bef (patch)
tree8c3b56ea5b6b8f6676db4e2f58148fd8d41e0031 /src
parent2f258b91cef5e96150828ff58d1df05182389691 (diff)
fix sdl pixelformat
Diffstat (limited to 'src')
-rw-r--r--src/library_sdl.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 3ea8fe50..18076458 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -161,10 +161,12 @@ mergeInto(LibraryManager.library, {
['i32', 'x'], ['i32', 'y'], ['i32', 'w'], ['i32', 'h'],
]),
PixelFormat: Runtime.generateStructInfo([
+ ['i32', 'format'],
['void*', 'palette'], ['i8', 'BitsPerPixel'], ['i8', 'BytesPerPixel'],
+ ['i8', 'padding1'], ['i8', 'padding2'],
+ ['i32', 'Rmask'], ['i32', 'Gmask'], ['i32', 'Bmask'], ['i32', 'Amask'],
['i8', 'Rloss'], ['i8', 'Gloss'], ['i8', 'Bloss'], ['i8', 'Aloss'],
- ['i8', 'Rshift'], ['i8', 'Gshift'], ['i8', 'Bshift'], ['i8', 'Ashift'],
- ['i32', 'Rmask'], ['i32', 'Gmask'], ['i32', 'Bmask'], ['i32', 'Amask'] // Docs say i8, ./include/SDL_video.h says i32...
+ ['i8', 'Rshift'], ['i8', 'Gshift'], ['i8', 'Bshift'], ['i8', 'Ashift']
]),
KeyboardEvent: Runtime.generateStructInfo([
['i32', 'type'],
@@ -263,6 +265,7 @@ mergeInto(LibraryManager.library, {
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*5', '0', 'buffer', 'void*') }}} // SDL_Surface.pixels
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*6', '0', '0', 'i32*') }}} // SDL_Surface.offset
+ {{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.format', '0', '-2042224636', 'i32') }}} // SDL_PIXELFORMAT_RGBA8888
{{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.palette', '0', '0', 'i32') }}} // TODO
{{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.BitsPerPixel', '0', '32', 'i8') }}} // TODO
{{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.BytesPerPixel', '0', '4', 'i8') }}} // TODO