putXOR method

bool putXOR(
  1. int x,
  2. int y
)

Implementation

bool putXOR( int x, int y ){
	if( (x < 0) || (x >= _width) || (y < 0) || (y >= _height) ){
		return false;
	}
	int color;
	if( _rgbFlag ){
		int rgb = _image![y * _offset + x];
		int r = (rgb & 0xFF0000) >> 16;
		int g = (rgb & 0x00FF00) >> 8;
		int b =  rgb & 0x0000FF;
		color = ((255 - r) << 16) + ((255 - g) << 8) + (255 - b);
	} else {
		color = 255 - _image![y * _offset + x];
	}
	_image![y * _offset + x] = color;
	if( _gWorldPut ){
		gWorldPutColor( this, x, y, color );
	}
	return true;
}