Sign in to follow this  
  • entries
    155
  • comments
    100
  • views
    93796


2 Comments


Recommended Comments

I like the resource management system -- simple and clean. It's much like how I usually handle it. Does the 'compress' flag on the image loading indicate that it will be compressed in (video) memory, or that you're indicating the file is in a compressed format? How does the resource manager handle freeing resources? Is it automatic (via Python's GC), or is there a manual method for doing so?

It might seem obvious, but I've never really considered having a listing of 'file systems' to be settable on a resouce manager; being able to add zip file paths is especially neat.

Nice progress as usual, Selk. [smile]

Share this comment


Link to comment
Quote:
Original post by HopeDagger
I like the resource management system -- simple and clean. It's much like how I usually handle it. Does the 'compress' flag on the image loading indicate that it will be compressed in (video) memory, or that you're indicating the file is in a compressed format? How does the resource manager handle freeing resources? Is it automatic (via Python's GC), or is there a manual method for doing so?


Any additional parameters passed to the resource manager are actually passed on to the load() method of the resource class. Also, resources with different parameters are considered separate resources by the resource manager. The compress parameter tells the Texture class to store it compressed in video memory; there's no ability to load pre-compressed textures (yet), but that of course won't require the parameter.

At the moment, resources are freed when the resource instance is deleted by the GC, ie. when no one is using it anymore. This is accomplished by the resource manager storing weak references to resources, meaning they aren't counted by the GC. Later, I'll add the ability to unload resources at will, reloading them automatically when they are again needed. This will be necessary for larger games with a huge amount of resources.

I should probably add at least some of this to the resource management article. :)

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now