Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Loading an image from a resource #245167
01/08/09 18:39
01/08/09 18:39
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
In project A, I BIND a number of images to the project in the wdl: BIND "myimage.png"; etc. When I publish (and check the the resource box in the publish properties) I see my images listed. I copy the resulting wrs to project B. In project B, I try to load the image into a BMAP* with bmap_load:
bmap_load( myBMapPointer, "myimage.png",1);
But I get a d3dx error when I run my script.

How can I retrieve my image? (i.e. do I need to unpack it somehow?)

Thanks for any help!

Re: Loading an image from a resource [Re: BES] #245309
01/09/09 11:07
01/09/09 11:07
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
have you added the resource to project B in code, or just placed it in the folder

Code:
RESOURCE "mybmaps.wrs";


Re: Loading an image from a resource [Re: MrGuest] #245391
01/09/09 18:34
01/09/09 18:34
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
Currently, I just place the wrs in the folder, and it gets listed in the startup window, and I successfully load levels (wmbs) from within the wrs. I just can't figure out how to get a BMAP* to an image BINDed to the wrs. From the docs:
Quote:
A resource file does not consume memory. Only when a file is read out of a resource, memory is allocated.


I've tried numerous variations of file_load, file_cpy, bmap_load, etc.

As an aside, I'd like to use add_resource() since I'd like to place the wrs in a sub-folder, but when I do that my app can't even retrieve the level's models from the wrs. I can't use the RESOURCE statement in the wdl for project B, cause I need to be able to load additional wdls dynamically. If project B has to know about the wdls at publish time, then the utility of resource files is mostly lost, at least in terms of our project's needs.

Re: Loading an image from a resource [Re: BES] #245487
01/10/09 10:18
01/10/09 10:18
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Hey Mark!

This is an untested guess.

BMAP* bmap_name = "bmap_name.png";

You'll have to define it that way and it should work, it means you have to write that for every image that exists and that all images will be preloaded on startup.

Regards,

David

Re: Loading an image from a resource [Re: DavidLancaster] #245656
01/11/09 01:12
01/11/09 01:12
Joined: May 2008
Posts: 123
B
BES Offline OP
Member
BES  Offline OP
Member
B

Joined: May 2008
Posts: 123
lol, I was just going to try that =). My only concern is that you have to know all the bmap names in the loading project, which kind of defeats the purpose. I can try to name elements the same in each loaded wdl, but then I'll have to differentiate between them somehow to access the right one. I think the docs say that the most recent wdl takes precedence. Is there some way to close a resource maybe?

Re: Loading an image from a resource [Re: BES] #283006
08/05/09 08:33
08/05/09 08:33
Joined: May 2006
Posts: 133
ME
Mysterious Offline
Member
Mysterious  Offline
Member

Joined: May 2006
Posts: 133
ME
Manual says:
"All added folders, resources, and buffers are removed through the add_new function. "

hope this help


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1