yep, a strange weekend...
Here's a longer version of the code, hopefully it will show the error message now...
Code:
; Define
;DisableDebugger
#IconTemp=0
#ColorOpaque=$FF000000
Global ColorIconShadow
Global CustomRed
Global CustomGreen
Global CustomBlue
Global CustomColor
#X=400
#Y=400
; EndDefine
Procedure CustomShadowHeavyDarken(x,y,Source,Destination)
EnableASM
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
!mov eax,[p.v_Source]
!And eax,$FF
!shl eax,24
!CMP eax,[p.v_Destination]
!ja done.l_customshadowheavydarken
!mov eax,[p.v_Destination]
!and eax,$FF000000
!done.l_customshadowheavydarken:
!or eax,[v_ColorIconShadow]
CompilerElse
!mov rax,[p.v_Source]
!And rax,$FF
!shl rax,24
!CMP rax,[p.v_Destination]
!ja done.l_customshadowheavydarken
!mov rax,[p.v_Destination]
!and rax,$FF000000
!done.l_customshadowheavydarken:
!or rax,[v_ColorIconShadow]
CompilerEndIf
DisableASM
ProcedureReturn
;ProcedureReturn ColorIconShadow | uMax((Source&$FF)<<24,Destination&$FF000000)
EndProcedure
Procedure Main()
Protected x,y,t,z
OpenWindow(0,0,0,#X,#Y, "-", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(1,0,0,#X,#Y,0)
CreateImage(1,400,400,32,#PB_Image_Transparent)
CreateImage(2,400,400,32,#PB_Image_Transparent)
CreateImage(0,100,100,32)
ColorIconShadow=$808080
StartDrawing(ImageOutput(2))
x=20
y=320
DrawingMode(#PB_2DDrawing_CustomFilter)
CustomFilterCallback(@CustomShadowHeavyDarken())
DrawImage(ImageID(#IconTemp),x,y)
StopDrawing()
StartDrawing(ImageOutput(1))
DrawAlphaImage(ImageID(2),0,0)
StopDrawing()
SetGadgetState(1,ImageID(1))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow,#WM_CHAR
End
EndSelect
ForEver
EndProcedure
Main()