the underlying c function SDL_MapRGB returns unsigned:
http://www.libsdl.org/docs/html/sdlmaprgb.html
so unsigned seems like the right choice based on that alone... no idea
why it would be signed
On Thu, Jan 22, 2009 at 10:39 PM, Lenard Lindstrom <len-l@xxxxxxxxx
<mailto:len-l@xxxxxxxxx>> wrote:
Hi,
I am writing more unit tests for surfarray after completing the
blit_array tests. Right now I am working on array2d. It would seem
natural to compare the elements of an array returned by array2d
with values returned by map_rgb for the surface used to create the
array. But it is not that easy. map_rgb returns a signed integer.
The array is unsigned. So, though the two numbers may represent
the same pixel value, they cannot be directly compared for
assertion tests. It also brings up another issue, shouldn't
map_rgb be compatible with array2d and blit_array. How else would
one format surface specific pixel values from Color values. So the
question is, do I change map_rgb to return an unsigned value as a
Python long? Would this break anything?