aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-01-08 14:53:25 +0100
committerGitHub <noreply@github.com>2022-01-08 14:53:25 +0100
commit76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d (patch)
tree248b907d2abeda0166d992bfb7b74b61cfe96d8a /src/irrlicht_changes
parentbf22569019749e421e8ffe0a73cff988a9a9c846 (diff)
downloadminetest-76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d.tar.gz
minetest-76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d.tar.bz2
minetest-76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d.zip
Fully remove bitmap font support (#11863)
Freetype is now a build requirement.
Diffstat (limited to 'src/irrlicht_changes')
-rw-r--r--src/irrlicht_changes/CMakeLists.txt7
-rw-r--r--src/irrlicht_changes/static_text.cpp13
-rw-r--r--src/irrlicht_changes/static_text.h36
3 files changed, 3 insertions, 53 deletions
diff --git a/src/irrlicht_changes/CMakeLists.txt b/src/irrlicht_changes/CMakeLists.txt
index 87c88f7e8..19f431af3 100644
--- a/src/irrlicht_changes/CMakeLists.txt
+++ b/src/irrlicht_changes/CMakeLists.txt
@@ -1,14 +1,9 @@
if (BUILD_CLIENT)
set(client_irrlicht_changes_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/static_text.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/CGUITTFont.cpp
)
- if (USE_FREETYPE)
- set(client_irrlicht_changes_SRCS ${client_irrlicht_changes_SRCS}
- ${CMAKE_CURRENT_SOURCE_DIR}/CGUITTFont.cpp
- )
- endif()
-
# CMake require us to set a local scope and then parent scope
# Else the last set win in parent scope
set(client_irrlicht_changes_SRCS ${client_irrlicht_changes_SRCS} PARENT_SCOPE)
diff --git a/src/irrlicht_changes/static_text.cpp b/src/irrlicht_changes/static_text.cpp
index f548c3f71..baf0ea626 100644
--- a/src/irrlicht_changes/static_text.cpp
+++ b/src/irrlicht_changes/static_text.cpp
@@ -12,17 +12,12 @@
#include <rect.h>
#include <SColor.h>
-#if USE_FREETYPE
- #include "CGUITTFont.h"
-#endif
-
+#include "CGUITTFont.h"
#include "util/string.h"
namespace irr
{
-#if USE_FREETYPE
-
namespace gui
{
//! constructor
@@ -108,14 +103,12 @@ void StaticText::draw()
font->getDimension(str.c_str()).Width;
}
-#if USE_FREETYPE
if (font->getType() == irr::gui::EGFT_CUSTOM) {
- irr::gui::CGUITTFont *tmp = static_cast<irr::gui::CGUITTFont*>(font);
+ CGUITTFont *tmp = static_cast<CGUITTFont*>(font);
tmp->draw(str,
r, HAlign == EGUIA_CENTER, VAlign == EGUIA_CENTER,
(RestrainTextInside ? &AbsoluteClippingRect : NULL));
} else
-#endif
{
// Draw non-colored text
font->draw(str.c_str(),
@@ -590,8 +583,6 @@ s32 StaticText::getTextWidth() const
} // end namespace gui
-#endif // USE_FREETYPE
-
} // end namespace irr
diff --git a/src/irrlicht_changes/static_text.h b/src/irrlicht_changes/static_text.h
index 17a3bf753..74ef62008 100644
--- a/src/irrlicht_changes/static_text.h
+++ b/src/irrlicht_changes/static_text.h
@@ -20,7 +20,6 @@
#include "config.h"
#include <IGUIEnvironment.h>
-#if USE_FREETYPE
namespace irr
{
@@ -230,41 +229,6 @@ inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedS
}
}
-#else // USE_FREETYPE
-
-namespace irr
-{
-namespace gui
-{
-
-class StaticText
-{
-public:
- static irr::gui::IGUIStaticText *add(
- irr::gui::IGUIEnvironment *guienv,
- const EnrichedString &text,
- const core::rect< s32 > &rectangle,
- bool border = false,
- bool wordWrap = true,
- irr::gui::IGUIElement *parent = NULL,
- s32 id = -1,
- bool fillBackground = false)
- {
- return guienv->addStaticText(text.c_str(), rectangle, border, wordWrap, parent, id, fillBackground);
- }
-};
-
-} // end namespace gui
-
-} // end namespace irr
-
-inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedString &text)
-{
- static_text->setText(text.c_str());
-}
-
-#endif
-
inline void setStaticText(irr::gui::IGUIStaticText *static_text, const wchar_t *text)
{
setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor()));