projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a7a371
)
SDL: remove pointless refcount acrobatics on video surface when taking screenshot
author
Tim Goya
<tuxdev103@gmail.com>
Fri, 17 Aug 2007 00:21:35 +0000
(
00:21
+0000)
committer
Tim Goya
<tuxdev103@gmail.com>
Fri, 17 Aug 2007 00:21:35 +0000
(
00:21
+0000)
SVN-Revision: 5142
src/video/sdl_renderer.cpp
patch
|
blob
|
history
diff --git
a/src/video/sdl_renderer.cpp
b/src/video/sdl_renderer.cpp
index
f4bae63
..
25fa832
100644
(file)
--- a/
src/video/sdl_renderer.cpp
+++ b/
src/video/sdl_renderer.cpp
@@
-271,9
+271,7
@@
namespace SDL
{
// [Christoph] TODO: Yes, this method also takes care of the actual disk I/O. Split it?
{
// [Christoph] TODO: Yes, this method also takes care of the actual disk I/O. Split it?
- SDL_Surface *shot_surf;
- shot_surf = SDL_GetVideoSurface();
- shot_surf->refcount++;
+ SDL_Surface *screen = SDL_GetVideoSurface();
// save screenshot
static const std::string writeDir = PHYSFS_getWriteDir();
// save screenshot
static const std::string writeDir = PHYSFS_getWriteDir();
@@
-289,14
+287,12
@@
namespace SDL
std::string fileName = oss.str();
fullFilename = writeDir + dirSep + fileName;
if (!PHYSFS_exists(fileName.c_str())) {
std::string fileName = oss.str();
fullFilename = writeDir + dirSep + fileName;
if (!PHYSFS_exists(fileName.c_str())) {
- SDL_SaveBMP(s
hot_surf
, fullFilename.c_str());
+ SDL_SaveBMP(s
creen
, fullFilename.c_str());
log_debug << "Wrote screenshot to \"" << fullFilename << "\"" << std::endl;
log_debug << "Wrote screenshot to \"" << fullFilename << "\"" << std::endl;
- SDL_FreeSurface(shot_surf);
return;
}
}
log_warning << "Did not save screenshot, because all files up to \"" << fullFilename << "\" already existed" << std::endl;
return;
}
}
log_warning << "Did not save screenshot, because all files up to \"" << fullFilename << "\" already existed" << std::endl;
- SDL_FreeSurface(shot_surf);
}
void
}
void