aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiHyperText.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
commit21df26984da91143c15587f5a03c98d68c3adc4e (patch)
treeaaa707a628ad331f67890023dffe1b4f60dd01d3 /src/gui/guiHyperText.cpp
parentb09fc5de5cdb021f43ad32b7e3f50dc75c0bc622 (diff)
parenteabf05758e3ba5f6f4bb1b8d1d1f02179b84e410 (diff)
downloaddragonfireclient-21df26984da91143c15587f5a03c98d68c3adc4e.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/gui/guiHyperText.cpp')
-rw-r--r--src/gui/guiHyperText.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/gui/guiHyperText.cpp b/src/gui/guiHyperText.cpp
index ccfdcb81d..40450ce5f 100644
--- a/src/gui/guiHyperText.cpp
+++ b/src/gui/guiHyperText.cpp
@@ -17,31 +17,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "IGUIEnvironment.h"
-#include "IGUIElement.h"
+#include "guiHyperText.h"
#include "guiScrollBar.h"
-#include "IGUIFont.h"
-#include <vector>
-#include <list>
-#include <unordered_map>
-using namespace irr::gui;
#include "client/fontengine.h"
-#include <SColor.h>
#include "client/tile.h"
#include "IVideoDriver.h"
#include "client/client.h"
#include "client/renderingengine.h"
#include "hud.h"
-#include "guiHyperText.h"
#include "util/string.h"
+#include "irrlicht_changes/CGUITTFont.h"
-bool check_color(const std::string &str)
+using namespace irr::gui;
+
+static bool check_color(const std::string &str)
{
irr::video::SColor color;
return parseColorString(str, color, false);
}
-bool check_integer(const std::string &str)
+static bool check_integer(const std::string &str)
{
if (str.empty())
return false;
@@ -616,12 +611,10 @@ TextDrawer::TextDrawer(const wchar_t *text, Client *client,
if (e.font) {
e.dim.Width = e.font->getDimension(e.text.c_str()).Width;
e.dim.Height = e.font->getDimension(L"Yy").Height;
-#if USE_FREETYPE
if (e.font->getType() == irr::gui::EGFT_CUSTOM) {
- e.baseline = e.dim.Height - 1 -
- ((irr::gui::CGUITTFont *)e.font)->getAscender() / 64;
+ CGUITTFont *tmp = static_cast<CGUITTFont*>(e.font);
+ e.baseline = e.dim.Height - 1 - tmp->getAscender() / 64;
}
-#endif
} else {
e.dim = {0, 0};
}