summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e22b79715..11bc81910 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -541,26 +541,24 @@ bool Game::saveScreenshot(SDL_Surface *const screenshot)
do
{
screenshotCount++;
- filenameSuffix.str("");
filename.str("");
filename << screenshotDirectory << "/";
- filenameSuffix << screenShortStr << screenshotCount << ".png";
- filename << filenameSuffix.str();
+ filename << screenShortStr << screenshotCount << ".png";
testExists.open(filename.str().c_str(), std::ios::in);
found = !testExists.is_open();
testExists.close();
}
while (!found);
- const bool success = ImageWriter::writePNG(screenshot, filename.str());
-
+ const std::string fileNameStr = filename.str();
+ const bool success = ImageWriter::writePNG(screenshot, fileNameStr);
if (success)
{
if (localChatTab)
{
// TRANSLATORS: save file message
std::string str = strprintf(_("Screenshot saved as %s"),
- filenameSuffix.str().c_str());
+ fileNameStr.c_str());
localChatTab->chatLog(str, BY_SERVER);
}
}