Garbage in 'unused bits'

i’m finding some blits in SDL will ‘fiddle’ the unused bits in a 32bit
surface. i suppose this is not too strange, but i’m finding it’s making
things a little trickier to get colorkeys correct. (since the colorkey
compares these unused bits)

i guess i’m not too surprised that these unused bits are “undefined” but i
was sort of hoping they would remain masked out during blits?

the case where i’m seeing this is blitting an image with surface alpha onto
a 32bit RGB (no A) surface. it may happen with other cases too, but this is
where it’s come up for me.

i’m wondering what the status of this is. is this something that
could/should be fixed in a later SDL release? or should i accept that these
bits are undefined.

i’m finding some blits in SDL will ‘fiddle’ the unused bits in a 32bit
surface. i suppose this is not too strange, but i’m finding it’s making
things a little trickier to get colorkeys correct. (since the colorkey
compares these unused bits)

i guess i’m not too surprised that these unused bits are “undefined” but i
was sort of hoping they would remain masked out during blits?

the case where i’m seeing this is blitting an image with surface alpha onto
a 32bit RGB (no A) surface. it may happen with other cases too, but this is
where it’s come up for me.

i’m wondering what the status of this is. is this something that
could/should be fixed in a later SDL release? or should i accept that these
bits are undefined.

Can you put together a specific compilable test case? I’d have to watch
the code to see exactly what’s happening.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment