diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-10-12 19:59:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2010-10-16 20:44:37 +0300 |
commit | 0d3d7c908ef6d294b14f55f09c9d83767fbc5f32 (patch) | |
tree | 35a175491e6d08cdbd79ab6c9de7e13560132236 /src/resources/resourcemanager.h | |
parent | bdf409c9c4ce083881133879947cc0a6c2cce0f1 (diff) | |
download | mana-0d3d7c908ef6d294b14f55f09c9d83767fbc5f32.tar.gz mana-0d3d7c908ef6d294b14f55f09c9d83767fbc5f32.tar.bz2 mana-0d3d7c908ef6d294b14f55f09c9d83767fbc5f32.tar.xz mana-0d3d7c908ef6d294b14f55f09c9d83767fbc5f32.zip |
Implement opacity cache for SDL surfaces.
Enabled by default.
Can be disabled in configuration option "alphaCache" if set it to 0.
Reviewed-by: Bertram
Diffstat (limited to 'src/resources/resourcemanager.h')
-rw-r--r-- | src/resources/resourcemanager.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 28ab4725..870182e4 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -26,6 +26,7 @@ #include <map> #include <string> #include <vector> +#include <set> class Image; class ImageSet; @@ -205,6 +206,10 @@ class ResourceManager */ SDL_Surface *loadSDLSurface(const std::string &filename); + void scheduleDelete(SDL_Surface* surface); + + void clearScheduled(); + /** * Returns an instance of the class, creating one if it does not * already exist. @@ -227,6 +232,7 @@ class ResourceManager static ResourceManager *instance; typedef std::map<std::string, Resource*> Resources; typedef Resources::iterator ResourceIterator; + std::set<SDL_Surface*> mDeletedSurfaces; Resources mResources; Resources mOrphanedResources; time_t mOldestOrphan; |