Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 01 Oct 2009 18:13:27 +0200
Hi,
I need to free the resources by my own. Is there a way to know if a resource (i.e. a brush) is actually loaded at the specified id?
Regards, Paolo.
[01 Oct 2009] Resource loaded?
-
- Posts: 14
- Joined: Tue Feb 16, 2010 7:11 pm
- Location: Rome
- Contact:
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[02 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 02 Oct 2009 12:04:04 +0200
What IDs are you using? Are you using number or new Hollywood 4.0 style IDs? (i.e. passing NIL as number and getting the return value), i.e.Hi, I need to free the resources by my own. Is there a way to know if a resource (i.e. a brush) is actually loaded at the specified id?
Code: Select all
my_brush = LoadBrush(Nil, "test.iff")
DisplayBrush(my_brush, 0, 0)
-
- Posts: 14
- Joined: Tue Feb 16, 2010 7:11 pm
- Location: Rome
- Contact:
[02 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 02 Oct 2009 16:52:49 +0200
I'm using the old style, providing explicit IDs.
I'm using the old style, providing explicit IDs.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[02 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 02 Oct 2009 21:54:06 +0200
This should do the job. It's a little bit awkward because it disables/enables the automatic error handler but it should do what you want
So you want to check if a certain explicit ID contains a brush? There's no convenient way for this, I'm afraid, but you can use a little work around, i.e.Hi Andreas, I'm using the old style, providing explicit IDs.
Code: Select all
/* returns True if specified id is a brush */
Function p_CheckBrush(id)
Local brush_there = True
ExitOnError(False)
GetAttribute(#BRUSH, id, #ATTRWIDTH)
If GetLastError() <> 0 Then brush_there = False
ExitOnError(True)
Return(brush_there)
EndFunction
- NubeCheCorre
- Posts: 77
- Joined: Mon Mar 19, 2012 1:24 am
- Contact:
[04 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 4 Oct 2009 12:34:40 +0200
Hi Andreas
i was reading this topic about the ID, so it is better use the new ID way ? why ?
Thanks Davide
Hi Andreas
i was reading this topic about the ID, so it is better use the new ID way ? why ?
Thanks Davide
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[05 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 05 Oct 2009 10:47:51 +0200
It's only useful if you've a larger project. Using hard-coded IDs can get quite bothersome in this case so you might want to use the new IDs. For smaller projects I find it easier to use hard-coded IDs like 1,2,3,4Hi Andreas
i was reading this topic about the ID, so it is better use the new ID way ? why ?
- NubeCheCorre
- Posts: 77
- Joined: Mon Mar 19, 2012 1:24 am
- Contact:
[05 Oct 2009] Re: Resource loaded?
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 5 Oct 2009 11:51:36 +0200
OK thanks for the reply
OK thanks for the reply