projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated addon repository URL and improved debug output on download
[supertux.git]
/
src
/
video
/
sdl_surface_ptr.hpp
diff --git
a/src/video/sdl_surface_ptr.hpp
b/src/video/sdl_surface_ptr.hpp
index
2fffc95
..
ac1c126
100644
(file)
--- a/
src/video/sdl_surface_ptr.hpp
+++ b/
src/video/sdl_surface_ptr.hpp
@@
-1,5
+1,5
@@
// SuperTux
// SuperTux
-// Copyright (C) 2009 Ingo Ruhnke <grumbel@gm
x.de
>
+// Copyright (C) 2009 Ingo Ruhnke <grumbel@gm
ail.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
//
// 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
@@
-27,13
+27,28
@@
private:
SDL_Surface* m_surface;
public:
SDL_Surface* m_surface;
public:
+ SDLSurfacePtr() :
+ m_surface(0)
+ {}
+
SDLSurfacePtr(SDL_Surface* surface) :
m_surface(surface)
{}
SDLSurfacePtr(SDL_Surface* surface) :
m_surface(surface)
{}
- ~SDLSurfacePtr()
+ ~SDLSurfacePtr()
+ {
+ SDL_FreeSurface(m_surface);
+ }
+
+ SDL_Surface* operator->()
+ {
+ return m_surface;
+ }
+
+ void reset(SDL_Surface* surface)
{
SDL_FreeSurface(m_surface);
{
SDL_FreeSurface(m_surface);
+ m_surface = surface;
}
SDL_Surface* get()
}
SDL_Surface* get()