From: Ingo Ruhnke Date: Mon, 7 Dec 2009 18:01:55 +0000 (+0000) Subject: Added reset() and empty constructor to SDLSurfacePtr X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=53b4b4d17d7377a0aa38a1212ab1a56e207fce1c;p=supertux.git Added reset() and empty constructor to SDLSurfacePtr SVN-Revision: 6195 --- diff --git a/src/video/sdl_surface_ptr.hpp b/src/video/sdl_surface_ptr.hpp index 4311e7019..c58d87380 100644 --- a/src/video/sdl_surface_ptr.hpp +++ b/src/video/sdl_surface_ptr.hpp @@ -27,6 +27,10 @@ private: SDL_Surface* m_surface; public: + SDLSurfacePtr() : + m_surface(0) + {} + SDLSurfacePtr(SDL_Surface* surface) : m_surface(surface) {} @@ -41,6 +45,12 @@ public: return m_surface; } + void reset(SDL_Surface* surface) + { + SDL_FreeSurface(m_surface); + m_surface = surface; + } + SDL_Surface* get() { return m_surface;