[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3588 - trunk/pingus/src
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3588 - trunk/pingus/src |
Date: |
Mon, 30 Jun 2008 01:25:10 +0200 |
Author: grumbel
Date: 2008-06-30 01:25:09 +0200 (Mon, 30 Jun 2008)
New Revision: 3588
Modified:
trunk/pingus/src/surface.cpp
trunk/pingus/src/surface.hpp
Log:
Removed delete_surface flag
Modified: trunk/pingus/src/surface.cpp
===================================================================
--- trunk/pingus/src/surface.cpp 2008-06-29 23:10:11 UTC (rev 3587)
+++ trunk/pingus/src/surface.cpp 2008-06-29 23:25:09 UTC (rev 3588)
@@ -30,24 +30,21 @@
{
public:
SDL_Surface* surface;
- bool delete_surface;
bool optimized;
SurfaceImpl()
: surface(0),
- delete_surface(false),
optimized(false)
{}
- SurfaceImpl(SDL_Surface* surface, bool delete_surface_ = true)
+ SurfaceImpl(SDL_Surface* surface)
: surface(surface),
- delete_surface(delete_surface_),
optimized(false)
{}
~SurfaceImpl()
{
- if (delete_surface)
+ if (surface)
SDL_FreeSurface(surface);
}
};
@@ -66,7 +63,7 @@
SDL_Surface* surface = IMG_Load(pathname.get_sys_path().c_str());
if (surface)
{
- impl = boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(surface, true));
+ impl = boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(surface));
}
}
@@ -99,8 +96,8 @@
//SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0));
}
-Surface::Surface(SDL_Surface* surface, bool delete_surface)
- : impl(new SurfaceImpl(surface, delete_surface))
+Surface::Surface(SDL_Surface* surface)
+ : impl(new SurfaceImpl(surface))
{
}
@@ -281,7 +278,7 @@
Surface::scale(int w, int h)
{
return Surface(boost::shared_ptr<SurfaceImpl>
- (new SurfaceImpl(Blitter::scale_surface(impl->surface, w, h),
true)));
+ (new SurfaceImpl(Blitter::scale_surface(impl->surface, w,
h))));
}
Surface
@@ -301,7 +298,7 @@
SDL_BlitSurface(impl->surface, NULL, new_surface, NULL);
}
- return Surface(boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(new_surface,
true)));
+ return Surface(boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(new_surface)));
}
Surface
@@ -323,8 +320,7 @@
SDL_BlitSurface(impl->surface, NULL, new_surface, &dst_rect);
-
- return Surface(boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(new_surface,
true)));
+ return Surface(boost::shared_ptr<SurfaceImpl>(new SurfaceImpl(new_surface)));
}
void
Modified: trunk/pingus/src/surface.hpp
===================================================================
--- trunk/pingus/src/surface.hpp 2008-06-29 23:10:11 UTC (rev 3587)
+++ trunk/pingus/src/surface.hpp 2008-06-29 23:25:09 UTC (rev 3588)
@@ -49,7 +49,7 @@
Surface(int width, int height, SDL_Palette* palette, int colorkey = -1);
/** Create a Surface from a SDL_Surface */
- Surface(SDL_Surface* surface, bool delete_surface = true);
+ Surface(SDL_Surface* surface);
~Surface();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3588 - trunk/pingus/src,
grumbel at BerliOS <=