fb:porticula NoPaste
Alpha Test
Uploader: | Eternal_Pain |
Datum/Zeit: | 25.08.2007 20:58:41 |
Screen 18,32,,&h40
Dim Scr as any ptr=ScreenPTR
Dim INTScr as uinteger ptr=cast(uinteger ptr,Scr)
Dim BYTEScr as ubyte ptr=cast(Ubyte ptr,Scr)
Dim Farbe as UInteger
Dim INTFarbe as uinteger ptr=cast(uinteger ptr,@Farbe)
Dim BYTEFarbe as ubyte ptr=cast(Ubyte ptr,@Farbe)
Dim Alpha as integer=&h80
Dim ColRef(1 to 3) as integer={&hFF0000,&h00FF00,&h0000FF}
Dim ColBuffer as UInteger
Dim INTColBuffer as uinteger ptr=cast(uinteger ptr,@ColBuffer)
Dim BYTEColBuffer as ubyte ptr=cast(Ubyte ptr,@ColBuffer)
Dim SetFarbe as UInteger
Dim INTSetFarbe as uinteger ptr=cast(uinteger ptr,@SetFarbe)
Dim BYTESetFarbe as ubyte ptr=cast(Ubyte ptr,@SetFarbe)
Dim as ubyte nA,nR,nG,nB
Dim as ubyte sR,sG,sB
Dim AlphaMode as Integer
for l as integer=1 to 3
Farbe=ColRef(l)
for y as integer=0 to 99
for x as integer=0 to 99
ColBuffer=INTScr[(x+(l*10))+((y+(l*10))*640)]
Screencontrol 14,AlphaMode
If Alphamode Then
BYTESetFarbe[0]=BYTEFarbe[0]
BYTESetFarbe[1]=BYTEFarbe[1]
BYTESetFarbe[2]=BYTEFarbe[2]
If Alpha>-1 Then BYTESetFarbe[0]=cast(ubyte,Alpha)
Else
If Alpha>-1 Then
BYTESetFarbe[0]=(((BYTEFarbe[0]/256)*Alpha)+((BYTEColBuffer[0]/256)*(255-Alpha)))
BYTESetFarbe[1]=(((BYTEFarbe[1]/256)*Alpha)+((BYTEColBuffer[1]/256)*(255-Alpha)))
BYTESetFarbe[2]=(((BYTEFarbe[2]/256)*Alpha)+((BYTEColBuffer[2]/256)*(255-Alpha)))
Else
SetFarbe=Farbe
End If
End If
INTScr[(x+(l*10))+((y+(l*10))*640)]=SetFarbe
next x
next y
next l
sleep