summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 7ef4967e..4778dae7 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -23,6 +23,8 @@
#include "game.h"
+#include <sstream>
+
#include <guichan/sdl/sdlinput.hpp>
#include "being.h"
@@ -67,6 +69,7 @@
#include "net/network.h"
#include "net/protocol.h"
+#include "resources/imagewriter.h"
extern Graphics *graphics;
@@ -577,10 +580,12 @@ void do_input()
*/
// screenshot (picture, hence the p)
case SDLK_p:
- static int picCount = 1;
- if (!graphics->saveScreenshot("Screenshot%d.png", picCount))
{
- logger->log("Error: could not save Screenshot%d.png", picCount);
+ // TODO Fix the counting to start at a sane value.
+ static int picCount = 1;
+ std::stringstream name;
+ name << "Screenshot-" << picCount << ".png";
+ ImageWriter::writePNG(graphics->getScreenshot(), name.str());
picCount++;
}
break;