summaryrefslogtreecommitdiff
path: root/src/resources/image.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/image.h')
-rw-r--r--src/resources/image.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/resources/image.h b/src/resources/image.h
index 3e8ad551..815b7764 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -39,6 +39,8 @@
#include <SDL_opengl.h>
#endif
+#include <map>
+
class Dye;
class Position;
@@ -169,6 +171,15 @@ class Image : public Resource
Uint8 *SDLgetAlphaChannel() const
{ return mAlphaChannel; }
+ SDL_Surface* duplicateSurface(SDL_Surface* tmpImage);
+
+ void cleanCache();
+
+ void terminateAlphaCache();
+
+ static void setEnableAlphaCache(bool n)
+ { mEnableAlphaCache = n; }
+
#ifdef USE_OPENGL
// OpenGL only public functions
@@ -208,14 +219,22 @@ class Image : public Resource
/** SDL_Surface to SDL_Surface Image loader */
static Image *_SDLload(SDL_Surface *tmpImage);
+ SDL_Surface *getByAlpha(float alpha);
+
SDL_Surface *mSDLSurface;
/** Alpha Channel pointer used for 32bit based SDL surfaces */
Uint8 *mAlphaChannel;
- // -----------------------
- // OpenGL protected members
- // -----------------------
+ std::map<float, SDL_Surface*> mAlphaCache;
+
+ bool mUseAlphaCache;
+
+ static bool mEnableAlphaCache;
+
+ // -----------------------
+ // OpenGL protected members
+ // -----------------------
#ifdef USE_OPENGL
/**
* OpenGL Constructor.