summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-18 00:45:38 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-18 00:45:38 +0000
commit8a8086d758d7618f3900df057ac840667e867d0c (patch)
treef1953a29a2b17e32fd18ab9be581c9ee2a8dbd8d /src/game.cpp
parent76892afa102fd814b3821c246547f28feb3d7394 (diff)
downloadmana-client-8a8086d758d7618f3900df057ac840667e867d0c.tar.gz
mana-client-8a8086d758d7618f3900df057ac840667e867d0c.tar.bz2
mana-client-8a8086d758d7618f3900df057ac840667e867d0c.tar.xz
mana-client-8a8086d758d7618f3900df057ac840667e867d0c.zip
Changed Graphics::saveScreenshot to Graphics::getScreenshot. Now using the ImageWriter to save that screenshot.
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;