diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-09-18 01:31:33 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-09-18 01:31:33 +0000 |
commit | 06221a4cb3f44e7532e185bc775c73741d32cbf2 (patch) | |
tree | 4258a21d641e6810173f6c936db8d34d9e109313 /src/game.cpp | |
parent | 8a8086d758d7618f3900df057ac840667e867d0c (diff) | |
download | mana-06221a4cb3f44e7532e185bc775c73741d32cbf2.tar.gz mana-06221a4cb3f44e7532e185bc775c73741d32cbf2.tar.bz2 mana-06221a4cb3f44e7532e185bc775c73741d32cbf2.tar.xz mana-06221a4cb3f44e7532e185bc775c73741d32cbf2.zip |
Made the saveScreenShot makes its screenshots under user home dir in *nices, made it more C++ way to avoid a leak, and made it check for existence of a file with same name before writing; In that case the screenshot's number is incremented until it finds an adequate name.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp index 4778dae7..5aaf1e8e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -69,8 +69,6 @@ #include "net/network.h" #include "net/protocol.h" -#include "resources/imagewriter.h" - extern Graphics *graphics; std::string map_path; @@ -580,13 +578,10 @@ void do_input() */ // screenshot (picture, hence the p) case SDLK_p: + //ImageWriter::writePNG(graphics->getScreenshot(), name.str()); + if (!graphics->saveScreenshot()) { - // 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++; + logger->log("Error: could not save Screenshot."); } break; // Skill window |