summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-07 01:06:40 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-07 01:06:40 +0300
commit7bbd2004db69dcf456a606a350d315e2fefa7d4f (patch)
treeb256c460bc3a6baa081ccab5596bc7d8aff0fab6 /src/game.cpp
parent6b291b6515825f4ce0e09df5dec7ea1b619b63a7 (diff)
downloadManaVerse-7bbd2004db69dcf456a606a350d315e2fefa7d4f.tar.gz
ManaVerse-7bbd2004db69dcf456a606a350d315e2fefa7d4f.tar.bz2
ManaVerse-7bbd2004db69dcf456a606a350d315e2fefa7d4f.tar.xz
ManaVerse-7bbd2004db69dcf456a606a350d315e2fefa7d4f.zip
Add option to print server name in screenshots.
Enabled by default.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b00dfc81f..df165d3d8 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -48,6 +48,7 @@
#include "input/joystick.h"
#include "input/keyboardconfig.h"
+#include "gui/font.h"
#include "gui/gui.h"
#include "gui/viewport.h"
#include "gui/windowmenu.h"
@@ -479,6 +480,15 @@ Game::~Game()
PlayerInfo::gameDestroyed();
}
+void Game::addWatermark()
+{
+ if (!boldFont || !config.getBoolValue("addwatermark"))
+ return;
+ mainGraphics->setColorAll(Theme::getThemeColor(Theme::TEXT),
+ Theme::getThemeColor(Theme::TEXT_OUTLINE));
+ boldFont->drawString(mainGraphics, client->getServerName(), 100, 50);
+}
+
bool Game::createScreenshot()
{
if (!mainGraphics)
@@ -491,11 +501,13 @@ bool Game::createScreenshot()
mainGraphics->setSecure(true);
mainGraphics->prepareScreenshot();
gui->draw();
+ addWatermark();
screenshot = mainGraphics->getScreenshot();
mainGraphics->setSecure(false);
}
else
{
+ addWatermark();
screenshot = mainGraphics->getScreenshot();
}