11-10-2005, 12:59 AM
I have two arrays, a smaller getter() array and a buffer() array. Curently this is my code to blend them
Its painfully slow. Does anbody know of any way to improve it. I hope there is a lot that can be done.
Code:
SUB alphaput(x as integer, y as integer, x2 as integer, y2 as integer, getarray() as integer, destinationarray() as integer)
'this sub will place an image on the screen and blend it with the background
'it will not draw or blend anything that is of colour 0
FOR xx = x to x2
y3 = 0
for yy = y to y2
b = POINT (x3, y3, getarray(0))
IF b THEN
a = point (xx, yy, destinationarray(0))
r = (red(b) + red(a)) SHR 1
g = (green(b) + green(a)) SHR 1
b = (blue(b) + blue(a)) SHR 1
pset destinationarray(0), (xx, yy), rgb(r,g,b)
END IF
y3 = y3 + 1
next
x3 = x3 + 1
next
END SUB
FUNCTION red(colour as integer) as integer
red = (colour SHR 16) mod 256
END FUNCTION
FUNCTION green(colour as integer) as integer
green = (colour SHR 8) mod 256
END FUNCTION
FUNCTION blue(colour as integer) as integer
blue = colour mod 256
END FUNCTION
Its painfully slow. Does anbody know of any way to improve it. I hope there is a lot that can be done.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.