Possible bug with SELMODE_COMBO & Brushes

Report any Hollywood bugs here
Post Reply
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Possible bug with SELMODE_COMBO & Brushes

Post by Allanon »

Hello,
AlphaChannel's curse is here again :D

from the Hollywood manual for the SelectBrush command:
...If you pass 2 in combomode, Hollywood will blend color channels and alpha channel of the source image into the destination image's color and alpha channels. When you draw the destination image later, it will look as if the two images had been drawn on top of each other consecutively.
I can get the stated result, seems that only the alpha channel is blended, color instead is replaced by the last drawing function, here is my test snippet:

Code: Select all

 
SetFillStyle(#FILLCOLOR)
Local tmpBrush = CreateBrush(Nil, 200, 200, #WHITE, { Alphachannel = True, Clear = True })
  SelectBrush(tmpBrush, #SELMODE_COMBO, 2)
  box(0, 0, 150, 150, $88ff0000)
  box(50, 50, 150, 150, $880000ff)
EndSelect
      
cls()
box(0, 0, 250, 400, #GREEN)
DisplayBrush(tmpBrush, 150, 150)

WaitLeftMouse()
With this snippet I get a background green box, but the two boxes draw on the brush are not mixed, instead the blue box is drawn over the red one.
If you create a brush without alpha channel the colors are mixed correctly.

I'm on Windows 10
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Possible bug with SELMODE_COMBO & Brushes

Post by airsoftsoftwair »

Thanks, fixed:

Code: Select all

- Fix: Box() with a partly transparent foreground colour wasn't mixed correctly when drawn to an
  offscreen brush with #SELMODE_COMBO and combo mode 2
As a workaround, do not use Box() but create a brush that contains the box and then draw this brush instead. Then it should work correctly.
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Possible bug with SELMODE_COMBO & Brushes

Post by Allanon »

Thank you for the fix and the tip!
Post Reply