Translucency in 2D

BlitzPlus Forums/BlitzPlus Programming/Translucency in 2D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This code uses jokers approach but allows images to overlap and keep their transparency, but its very inefficient.
(needs images argb values stored in the pic(width,height) array)
        LockBuffer
	For x=xx To picw+xx
		If x=>0 And x<gw
			If x Mod 2 > 0 Then
				For y=yy To pich+yy
					If y=>0 And x<gh And pic(x-xx,y-yy)>-16777216
						If y Mod 2=0 Then WritePixelFast x,y,pic(x-xx,y-yy)
					EndIf
				Next
			Else
				For y=yy To pich+yy
					If y=>0 And x<gh And pic(x-xx,y-yy)>-16777216
						If y Mod 2>0 Then WritePixelFast x,y,pic(x-xx,y-yy)
					EndIf
				Next
			EndIf
		EndIf
	Next
	UnlockBuffer