Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Prozak

Resource Loading & Linking

This topic is 5266 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im trying to design a system that seperates resource loading from resource linking. When I say resource, i mean the "atomic" pieces an engine uses, like meshes, sounds, textures, etc. A Resource Load function is responsible for loading those pieces, like a mesh, while a resource linking function would be responsible for piecing together the apropriate pieces, to generate a working "object". If I use mesh A plus texture B plus sound C, then I have successfuly organized into a hierarchical structure the atomic resources, and created an object. The problem arises from the fact that when I load up file A, some of its resources may be used by file B, so the linking must not be done cleverly... Im not looking for a solution to my specific problem, more, looking for how others have dealt with this... [Edited by - Prozak on June 15, 2004 8:05:52 AM]

Share this post


Link to post
Share on other sites
Advertisement
You could use a set of managers for the different resource types, like for example a sound manager and a texture manager. Whenever you load a resource, you add it to a list in the manager, and set a counter for that resource to one. Then, when you try to load the same resource again, just increase the counter instead, and reuse the original one.
When releasing the resources, decrease the reference count and only unload the resource if the counter hits zero.

Share this post


Link to post
Share on other sites
No, im not talking about not reloading already in memory resources...

...im talking about linking resources loaded from diferent files.

Wild example:

You have your model's head from a Quake 3 model file, and the rest of the body from an Unreal model file, and textures in yyy format.

Now, you need an importer for:
- Quake 3 Models
- Unreal Models
- YYY Image File Format

And then, to construct your model, you need a "linker" function, that links the apropriate body parts into an hierarchical structure, and assigns the texture IDs....

So, my question is, how to achive independence between resource loading and resource linking...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!