diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-01 20:04:43 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-01 20:04:43 +0100 |
commit | 38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad (patch) | |
tree | 81d0e898790264114683cca9cfd3355bea114415 /src/game.cpp | |
parent | c5e341f7b5f5e4efcabd09e00e177bb873db8097 (diff) | |
parent | 1f69108501c4bf51f3adac9ffbf7a7631fb12b9a (diff) | |
download | mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.gz mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.bz2 mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.xz mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.zip |
Merge branch '0.5' of gitorious.org:mana/mana
Conflicts:
src/being.cpp
src/client.cpp
src/commandhandler.cpp
src/gui/setup_video.cpp
src/gui/socialwindow.cpp
src/gui/viewport.cpp
src/gui/widgets/browserbox.cpp
src/gui/widgets/itemcontainer.cpp
src/imageparticle.cpp
src/localplayer.cpp
src/localplayer.h
src/map.cpp
src/net/tmwa/beinghandler.cpp
src/particle.cpp
src/particle.h
src/player.cpp
src/player.h
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/game.cpp b/src/game.cpp index 5557f650..2322d61e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -287,8 +287,23 @@ static bool saveScreenshot() { static unsigned int screenshotCount = 0; + // We don't want to show IP addresses in screenshots + const bool showip = player_node->getShowIp(); + if (showip) + { + player_node->setShowIp(false); + actorSpriteManager->updatePlayerNames(); + gui->draw(); + } + SDL_Surface *screenshot = graphics->getScreenshot(); + if (showip) + { + player_node->setShowIp(true); + actorSpriteManager->updatePlayerNames(); + } + // Search for an unused screenshot name std::stringstream filenameSuffix; std::stringstream filename; @@ -304,7 +319,8 @@ static bool saveScreenshot() screenshotDirectory = std::string(PHYSFS_getUserDir()); } - do { + do + { screenshotCount++; filenameSuffix.str(""); filename.str(""); @@ -315,7 +331,8 @@ static bool saveScreenshot() testExists.open(filename.str().c_str(), std::ios::in); found = !testExists.is_open(); testExists.close(); - } while (!found); + } + while (!found); const bool success = ImageWriter::writePNG(screenshot, filename.str()); @@ -602,13 +619,8 @@ void Game::handleInput() { case KeyboardConfig::KEY_PICKUP: { - const Vector &pos = player_node->getPosition(); - Map *map = viewport->getCurrentMap(); - Uint16 x = (int) pos.x / map->getTileWidth(); - Uint16 y = (int) (pos.y - 1) - / map->getTileHeight(); - // y - 1 needed to fix position, otherwise, it's - // off under eAthena. + int x = player_node->getTileX(); + int y = player_node->getTileY(); FloorItem *item = actorSpriteManager->findItem(x, y); |