From 982233834722bbd719c5afb5e9ea79a7d7981a15 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sun, 18 Sep 2005 01:41:46 +0000 Subject: Some minor optimizations. --- src/graphics.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/graphics.cpp') diff --git a/src/graphics.cpp b/src/graphics.cpp index d5036699..f179eff2 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -251,8 +251,7 @@ bool Graphics::saveScreenshot() std::stringstream pictureFilename; // Write it under user home dir on *nices. #ifdef __USE_UNIX98 - pictureFilename << PHYSFS_getUserDir(); - pictureFilename << "/"; + pictureFilename << PHYSFS_getUserDir() << "/"; #endif pictureFilename << "TMW_Screenshot_" << screenshotsCount << ".png"; @@ -266,8 +265,7 @@ bool Graphics::saveScreenshot() screenshotsCount++; pictureFilename.str(""); #ifdef __USE_UNIX98 - pictureFilename << PHYSFS_getUserDir(); - pictureFilename << "/"; + pictureFilename << PHYSFS_getUserDir() << "/"; #endif pictureFilename << "TMW_Screenshot_" << screenshotsCount << ".png"; testExists.open(std::string(pictureFilename.str()).c_str(), std::ios::in); @@ -276,12 +274,12 @@ bool Graphics::saveScreenshot() if ( ImageWriter::writePNG(getScreenshot(), pictureFilename.str()) ) { - screenshotsCount++; - return true; + screenshotsCount++; + return true; } else { - return false; + return false; } } -- cgit v1.2.3-70-g09d2