[Gllug] XOR

Pete Ryland pdr at createservices.com
Thu Apr 15 17:04:23 UTC 2004


On Thu, Apr 15, 2004 at 05:33:17PM +0100, Andrew Halliwell wrote:
> And verily, didst Ashley Evans announce to the hordes:
> > So, what else can this bit of binary operator magic be used for?
> 
> Oh, quite a bit due to its very nature.
> Sprites for example, have a "mask" and the actual sprite graphic.
> (The mask is the reverse of the sprite, XOR can be used to overlay the
> sprite on a background by using the sprite mask)
> 
> Loads of other uses in all areas of computeryness. It's hardly "new" though,
> surprised you'd not come across it before. 
> 
> Even the sinclair zx spectrum has "OVER 1" mode, which turned on XOR for
> screen writing. (Used in that case for games written in BASIC, and of
> course, for things like underline, creating umlauts from 2 normal
> characters, u and " iirc, etc)

That reminds me of another use: "rubber-band" selections, where you draw a
box (possibly filled in) using XOR, then you don't have to save what's under
the box, simply XOR it again when you need it back.  Much quicker too.

Pete
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list