Is anyone using drawing functions with kColorXOR?

Dustin (of Playmaker fame) noticed that when you call, say, drawLine with the XOR color set, it turns transparent pixels opaque. I agree that it’s not the expected behavior so I’m going to fix that. Easy, one line of code. But! That breaks our API contract–technically we should be preserving backwards compatibility, checking the SDK version the game was compiled against and giving the previous behavior if it’s from before the change. Now that fix is a lot more than one line of code, and possibly has an impact on performance. :frowning:

Since it’s still early days for Playdate does anyone mind if I go ahead and make this change? Should we provide a separate color like kColorXOROpaque that provides the old behavior? We can hook that up in a way that preserves the old behavior for games compiled pre-1.1, it occurs to me now… But maybe it’s better to leave that out if it’s something no one would use.

I don’t believe I use this myself, so it wouldn’t affect me, but I was wondering: how could I find out if my projects use it? Would searching them for XOR be sufficient?

yes, that’d be the only way you’d be using XOR drawing, if you’ve manually set the draw color to kColorXOR

I experimented with XOR at one point, but didn’t use it because of the described issue with opaque pixels. Sounds to me like this is fixing a bug rather than breaking the API, though of course possible breakage should be accounted for!

Have you done a survey of submitted games? I’m not following the forum regularly at the moment. Can you search the submitted PDX files to see what the impact might be?

1 Like