comparison engine/core/util/resource/resource.i @ 148:72c25cc27d8b

For your convenience pools now have a function called purgeLoadedResources exposed to python which will delete all loaded resources that have a ref count of zero. You can use this after closing a map or something alike. It may however impact performance, as the next map may very well reload the same resources. Just be aware of that. :-)
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 11 Oct 2008 06:05:11 +0000
parents 2cc01d9433ab
children 6e7d228def30
comparison
equal deleted inserted replaced
147:fb6ccb367dd1 148:72c25cc27d8b
84 static const int INVALID_ID = -1; 84 static const int INVALID_ID = -1;
85 virtual ~Pool(); 85 virtual ~Pool();
86 virtual int addResourceFromFile(const std::string& filename); 86 virtual int addResourceFromFile(const std::string& filename);
87 virtual int addResourceFromLocation(const ResourceLocation& loc); 87 virtual int addResourceFromLocation(const ResourceLocation& loc);
88 virtual int getResourceCount(int status); 88 virtual int getResourceCount(int status);
89 virtual int purgeLoadedResources();
89 virtual void addResourceLoader(ResourceLoader* loader); 90 virtual void addResourceLoader(ResourceLoader* loader);
90 virtual void release(unsigned int index, bool dec = false); 91 virtual void release(unsigned int index, bool dec = false);
91 virtual unsigned int getIndex(const std::string& filename); 92 virtual unsigned int getIndex(const std::string& filename);
92 virtual IResource& get(unsigned int index, bool inc = false); 93 virtual IResource& get(unsigned int index, bool inc = false);
93 virtual void printStatistics(); 94 virtual void printStatistics();