diff options
Diffstat (limited to 'src/util/enriched_string.cpp')
-rw-r--r-- | src/util/enriched_string.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/util/enriched_string.cpp b/src/util/enriched_string.cpp index 762d094eb..b1f95215e 100644 --- a/src/util/enriched_string.cpp +++ b/src/util/enriched_string.cpp @@ -65,12 +65,14 @@ void EnrichedString::operator=(const wchar_t *str) addAtEnd(translate_string(std::wstring(str)), m_default_color); } -void EnrichedString::addAtEnd(const std::wstring &s, const SColor &initial_color) +void EnrichedString::addAtEnd(const std::wstring &s, SColor initial_color) { SColor color(initial_color); bool use_default = (m_default_length == m_string.size() && color == m_default_color); + m_colors.reserve(m_colors.size() + s.size()); + size_t i = 0; while (i < s.length()) { if (s[i] != L'\x1b') { @@ -200,12 +202,6 @@ const std::wstring &EnrichedString::getString() const return m_string; } -void EnrichedString::setDefaultColor(const irr::video::SColor &color) -{ - m_default_color = color; - updateDefaultColor(); -} - void EnrichedString::updateDefaultColor() { sanity_check(m_default_length <= m_colors.size()); |