fb:porticula NoPaste
Alpha-Pointer-Versuch
Uploader: | Eternal_Pain |
Datum/Zeit: | 25.08.2007 21:22:14 |
Screen 18,32
SUB PixSet (byval x as integer, byval y as integer, byval F as Integer, byval A as integer=-1)
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 Pitch as Integer
Pitch=640
Dim Alpha as integer=A
Dim Farbe as UInteger=F
Dim BYTEFarbe as ubyte ptr=cast(Ubyte ptr,@Farbe)
Dim ColBuffer as UInteger
Dim BYTEColBuffer as ubyte ptr=cast(Ubyte ptr,@ColBuffer)
Dim SetFarbe as UInteger
Dim BYTESetFarbe as ubyte ptr=cast(Ubyte ptr,@SetFarbe)
Dim AlphaMode as Integer
ColBuffer=INTScr[(x+(y*Pitch))]
Screencontrol 14,AlphaMode
If Alpha>-1 and Alpha<&hFF Then
Alpha=Cast(Ubyte,Alpha)
BYTESetFarbe[0]=(((BYTEFarbe[0]/255)*Alpha)+((BYTEColBuffer[0]/255)*(255-Alpha)))
BYTESetFarbe[1]=(((BYTEFarbe[1]/255)*Alpha)+((BYTEColBuffer[1]/255)*(255-Alpha)))
BYTESetFarbe[2]=(((BYTEFarbe[2]/255)*Alpha)+((BYTEColBuffer[2]/255)*(255-Alpha)))
Else
BYTESetFarbe[0]=BYTEFarbe[0]
BYTESetFarbe[1]=BYTEFarbe[1]
BYTESetFarbe[2]=BYTEFarbe[2]
BYTESetFarbe[3]=&hFF
End If
INTScr[(x+(y*Pitch))]=SetFarbe
End SUB
for y as integer=0 to 99
for x as integer=0 to 99
pixset (10+x,10+y,&hFF0000,&hFF)
next x
next y
for y as integer=0 to 99
for x as integer=0 to 99
pixset (20+x,20+y,&h00FF00,&h80)
next x
next y
for y as integer=0 to 99
for x as integer=0 to 99
pixset (30+x,30+y,&h0000FF,&h60)
next x
next y
sleep