aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-10 17:08:25 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-10 17:08:25 -0700
commit9de35128d84aacb450d7bf188e65b9304633ab09 (patch)
treeac38fe8d785cdcb20c2bb8315f9c91b229992d27
parent33db680552a2811e92552d9c225aedb68f4b13d0 (diff)
fix sdl pitch bug
-rw-r--r--src/library_sdl.js2
-rw-r--r--tests/sdl_image.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index c5190aa8..b607bdb3 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -260,7 +260,7 @@ mergeInto(LibraryManager.library, {
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*1', '0', 'pixelFormat', 'void*') }}} // SDL_Surface.format TODO
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*2', '0', 'width', 'i32') }}} // SDL_Surface.w
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*3', '0', 'height', 'i32') }}} // SDL_Surface.h
- {{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*4', '0', 'width*4', 'i16') }}} // SDL_Surface.pitch, assuming RGBA for now,
+ {{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*4', '0', 'width*4', 'i32') }}} // SDL_Surface.pitch, assuming RGBA for now,
// since that is what ImageData gives us in browsers
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*5', '0', 'buffer', 'void*') }}} // SDL_Surface.pixels
{{{ makeSetValue('surf+Runtime.QUANTUM_SIZE*6', '0', '0', 'i32*') }}} // SDL_Surface.offset
diff --git a/tests/sdl_image.c b/tests/sdl_image.c
index 1efed88c..d934f863 100644
--- a/tests/sdl_image.c
+++ b/tests/sdl_image.c
@@ -16,6 +16,7 @@ int main() {
}
assert(image->format->BitsPerPixel == 32);
assert(image->format->BytesPerPixel == 4);
+ assert(image->pitch == 4*image->w);
SDL_BlitSurface (image, NULL, screen, NULL);
SDL_FreeSurface (image);