aboutsummaryrefslogtreecommitdiff
path: root/src/client/guiChatConsole.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client/guiChatConsole.cpp (renamed from src/guiChatConsole.cpp)31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/guiChatConsole.cpp b/src/client/guiChatConsole.cpp
index 17a1689c7..d8837556a 100644
--- a/src/guiChatConsole.cpp
+++ b/src/client/guiChatConsole.cpp
@@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string>
#if USE_FREETYPE
-#include "xCGUITTFont.h"
+ #include "xCGUITTFont.h"
#endif
inline u32 clamp_u8(s32 value)
@@ -340,13 +340,28 @@ void GUIChatConsole::drawText()
s32 x = (fragment.column + 1) * m_fontsize.X;
core::rect<s32> destrect(
x, y, x + m_fontsize.X * fragment.text.size(), y + m_fontsize.Y);
- m_font->draw(
- fragment.text.c_str(),
- destrect,
- video::SColor(255, 255, 255, 255),
- false,
- false,
- &AbsoluteClippingRect);
+
+
+ #if USE_FREETYPE
+ // Draw colored text if FreeType is enabled
+ irr::gui::CGUITTFont *tmp = static_cast<irr::gui::CGUITTFont*>(m_font);
+ tmp->draw(
+ fragment.text.c_str(),
+ destrect,
+ fragment.text.getColors(),
+ false,
+ false,
+ &AbsoluteClippingRect);
+ #else
+ // Otherwise use standard text
+ m_font->draw(
+ fragment.text.c_str(),
+ destrect,
+ video::SColor(255, 255, 255, 255),
+ false,
+ false,
+ &AbsoluteClippingRect);
+ #endif
}
}
}