Blitting 16 bit surface to 8 bit surface Problems

For an application I am writing I have to blit a 16bpp surface to a 8bpp
surface(Very limited hardware so screen is in 8bpp but editing is in 16
for less confusion in conversion)
When I render it the image is split along the diagonal
It turns this
http://imgbin.org/index.php?page=image&id=8641
into this
http://imgbin.org/index.php?page=image&id=8640

I’m not sure why it does this but I can tell you that all I am doing is
copies an array of Uint16 values to the pixels I know the array is
correct because I wrote direct to hardware and it works
Any help would be appreciated I will look through the code a little and
see if i can find what might cause this problem

For an application I am writing I have to blit a 16bpp surface to a
8bpp surface(Very limited hardware so screen is in 8bpp but editing is
in 16 for less confusion in conversion)
When I render it the image is split along the diagonal
It turns this
http://imgbin.org/index.php?page=image&id=8641
into this
http://imgbin.org/index.php?page=image&id=8640

I’m not sure why it does this but I can tell you that all I am doing
is copies an array of Uint16 values to the pixels I know the array is
correct because I wrote direct to hardware and it works
Any help would be appreciated I will look through the code a little
and see if i can find what might cause this problem


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Can you paste the lines where the surfaces are created and the lines
where you blit the one to the other?

The resulting image looks to me like you just copy one pixel of the
first surface (2 bytes per pixel) to the second one (1 byte per pixel).
What you might think about too is that the second image might have a
palette, but not the first one.

Cheers, Tobias