// SuperTux
-// Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+// Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
SDL_Surface* m_surface;
public:
+ SDLSurfacePtr() :
+ m_surface(0)
+ {}
+
SDLSurfacePtr(SDL_Surface* surface) :
m_surface(surface)
{}
- ~SDLSurfacePtr()
+ ~SDLSurfacePtr()
{
SDL_FreeSurface(m_surface);
}
return m_surface;
}
+ void reset(SDL_Surface* surface)
+ {
+ SDL_FreeSurface(m_surface);
+ m_surface = surface;
+ }
+
SDL_Surface* get()
{
return m_surface;