From 76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 8 Jan 2022 14:53:25 +0100 Subject: Fully remove bitmap font support (#11863) Freetype is now a build requirement. --- src/irrlicht_changes/CMakeLists.txt | 7 +------ src/irrlicht_changes/static_text.cpp | 13 ++----------- src/irrlicht_changes/static_text.h | 36 ------------------------------------ 3 files changed, 3 insertions(+), 53 deletions(-) (limited to 'src/irrlicht_changes') 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 #include -#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(font); + CGUITTFont *tmp = static_cast(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 -#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())); -- cgit v1.2.3