c=ReadPixelFast(x,y)
If (c And $fcfcfc)<>keycolor
c=c Or $ff000000
Else
c=0
EndIf
WritePixelFast x,y,c
seems like he did alter the alpha byte. But I agree with halo, the almost-cellshaded effect can be real ugly, especially when the mesh is far away. So I would use the average color for the mask, then simply replace this color on the non-masked pixels with something very similar. THe only problem is with 16 Bit textures, probably this won't work correctly when there is only a single bit diffrence from mask color and other stuff. not sure of that.
If (c And $fcfcfc)<>keycolor
c=c Or $ff000000
Else
c=0
EndIf
WritePixelFast x,y,c
seems like he did alter the alpha byte. But I agree with halo, the almost-cellshaded effect can be real ugly, especially when the mesh is far away. So I would use the average color for the mask, then simply replace this color on the non-masked pixels with something very similar. THe only problem is with 16 Bit textures, probably this won't work correctly when there is only a single bit diffrence from mask color and other stuff. not sure of that.