diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-18 00:45:38 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-18 00:45:38 +0000 |
commit | 8a8086d758d7618f3900df057ac840667e867d0c (patch) | |
tree | f1953a29a2b17e32fd18ab9be581c9ee2a8dbd8d /src/game.cpp | |
parent | 76892afa102fd814b3821c246547f28feb3d7394 (diff) | |
download | mana-8a8086d758d7618f3900df057ac840667e867d0c.tar.gz mana-8a8086d758d7618f3900df057ac840667e867d0c.tar.bz2 mana-8a8086d758d7618f3900df057ac840667e867d0c.tar.xz mana-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.cpp | 11 |
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; |