X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture.hpp;h=76964a9fd88a3875653d2c213044dc8835242f8e;hb=1f813f3b4ca1af669c7183f25af902de7205dd65;hp=e814547f3dcf7d578e50a63539d83ba3a4a94947;hpb=0594f8e8dd1a5e2e3410b408441eeab3baad19f7;p=supertux.git diff --git a/src/video/texture.hpp b/src/video/texture.hpp index e814547f3..76964a9fd 100644 --- a/src/video/texture.hpp +++ b/src/video/texture.hpp @@ -26,16 +26,18 @@ #include "video/texture_manager.hpp" /// bitset for drawing effects -enum DrawingEffect { +enum { /** Don't apply anything */ - NO_EFFECT, + NO_EFFECT = 0, /** Draw the Surface upside down */ - VERTICAL_FLIP, + VERTICAL_FLIP = (1<<1), /** Draw the Surface from left to down */ - HORIZONTAL_FLIP, + HORIZONTAL_FLIP = (1<<2), NUM_EFFECTS }; +typedef unsigned int DrawingEffect; + /** * This class is a wrapper around a texture handle. It stores the texture width * and height and provides convenience functions for uploading SDL_Surfaces @@ -51,12 +53,12 @@ private: public: Texture() : cache_filename() {} - virtual ~Texture() + virtual ~Texture() { - if (texture_manager && cache_filename != "") + if (TextureManager::current() && cache_filename != "") /* The cache entry is now useless: its weak pointer to us has been * cleared. Remove the entry altogether to save memory. */ - texture_manager->reap_cache_entry(cache_filename); + TextureManager::current()->reap_cache_entry(cache_filename); } virtual unsigned int get_texture_width() const = 0;