ConvertToBrush and auto id selection

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

ConvertToBrush and auto id selection

Post by jPV »

It seems that auto id selection with ConvertToBrush() has got broken in Hollywood 10 (works with earlier versions).

At least in this kind of case:

Code: Select all

@REQUIRE "iconic"
LoadIcon(1, "SYS:Utilities.info")

For Local k = 1 To GetAttribute(#ICON, 1, #ATTRNUMENTRIES)
    For Local j = 1 To GetAttribute(#ICON, 1, #ATTRNUMFRAMES, k)
        ; This works:
        ConvertToBrush(#ICON, 1, 1, k, j - 1)
        DisplayBrush(1, #CENTER, #CENTER)
        WaitLeftMouse
        Cls
        ; This fails on HW10 (works on HW9.1), id becomes 0:
        Local id = ConvertToBrush(#ICON, 1, Nil, k, j - 1)
        DisplayBrush(id, #CENTER, #CENTER)
        WaitLeftMouse
        Cls
    Next
Next
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

Re: ConvertToBrush and auto id selection

Post by lazi »

You should live with a workaround while a fix/patch/new release will come:

Code: Select all

   tmp2 = ConvertToBrush(#BRUSH, tmp1, Nil)
   t, c = GetObjects(#BRUSH)   ; workaround
   tmp2 = t[c-1]               ; workaround
   DisplayBrush(tmp2,10,10)
This one is working with #BRUSH, but you could apapt it for #ICON.
Let us know if it works!
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ConvertToBrush and auto id selection

Post by airsoftsoftwair »

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

Re: ConvertToBrush and auto id selection

Post by airsoftsoftwair »

Code: Select all

- Fix: ConvertToBrush() didn't return a new brush ID when Nil was passed to it
Post Reply