Mercurial > fife-parpg
diff engine/core/util/resource/pool.h @ 644:b84dbc4665b0
loaders extension can now handle multiple loaders for different filetypes. A difference between map and object files is now being made!
Fixed a small redundancy in the guimanager.
Added clearResourceLoaders() to the Pool class. This can be used if different resourceloaders have to be added at a later point in time (running editor for example, a plugin might want to have it's own loader added)
author | nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 11 Oct 2010 22:20:00 +0000 |
parents | 54bfd1015b35 |
children | 5d6b1820b953 |
line wrap: on
line diff
--- a/engine/core/util/resource/pool.h Sat Oct 09 17:00:33 2010 +0000 +++ b/engine/core/util/resource/pool.h Mon Oct 11 22:20:00 2010 +0000 @@ -54,7 +54,7 @@ /** Pool is used to optimize memory usage for resources * * Pool guarantees that there is minimal amount of resources - * used in cases when it is would possible that multiple + * used in cases when it is would possible that multiple * instances of the same data would be loaded into the memory. * Pool is the owner for resources taking care of their deletion. */ @@ -77,11 +77,15 @@ */ virtual void addResourceLoader(ResourceLoader* loader); + /** Clear the resource loaders + */ + virtual void clearResourceLoaders(); + /** Adds new resource into the pool using the given location. * @return The index of the resource in the pool. */ virtual int addResourceFromLocation(ResourceLocation* loc); - + /** This is a convenience version of addResourceFromLocation(). * It converts the filename into a ResourceLocation and then * calls addResourceFromLocation. @@ -92,13 +96,13 @@ virtual int addResourceFromFile(const std::string& filename); /** Gets resource from pool with given index - * + * * @param inc Specifies weither this call will increase the ref counter */ virtual IResource& get(unsigned int index, bool inc = false); - + /** Removes the resource from pool if reference counter is null - * + * * @param dec Specifies weither the ref counter will be decreased * before checking */