Drawing an alphachannel brush on a palette brush

Report any Hollywood bugs here
Post Reply
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Drawing an alphachannel brush on a palette brush

Post by jPV »

I found that if I draw a brush with alphachannel or mask on a palette brush, it doesn't remap colors correctly. It never uses the last pen of the palette, but usually the previous or something like that.

If I remove the alphachannel/mask, then it uses all colors of the palette.

I think this is a bug or if I haven't figured out the reason, please let me know. Or if there's any simple workaround... tested on MorphOS.

Code: Select all

@PALETTE 1, {Type = #PALETTE_GRAY4}

SetFillStyle(#FILLCOLOR)

; Palette based brush as the destination
CreateBrush(1, 400, 300, {Palette=1})

pal = GetAttribute(#BRUSH, 1, #ATTRPALETTE)

; Create an alphachannel brush to be pasted on the palette brush
CreateBrush(2, 400, 100, {AlphaChannel=True})
SelectBrush(2)
For Local i = 0 To ListItems(pal) - 1
	Box(i*100, 0, 100, 100, pal[i])
Next
EndSelect()


SelectBrush(1)

; Original colors drawn directly, to be compared with other results.
For Local i = 0 To ListItems(pal) - 1
	Box(i*100, 0, 100, 100, pal[i])
Next

; Let Hollywood remap the alpha channel brush. Last color is mapped wrong.
DisplayBrush(2, 0, 100)

; All colors are remapped correctly if there isn't an alpha channel.
DeleteAlphaChannel(2)
DisplayBrush(2, 0, 200)

EndSelect()


DisplayBrush(1, 0, 0)
WaitLeftMouse()
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Drawing an alphachannel brush on a palette brush

Post by airsoftsoftwair »

Yes, this looks like a bug. Will be fixed.
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Drawing an alphachannel brush on a palette brush

Post by airsoftsoftwair »

Code: Select all

- Fix: Drawing a brush with an alpha channel or a mask to a palette brush never took the last pen of the
  brush into account when remapping the colors of the source brush to the target palette brush
Post Reply