]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/terminal_chat_console.cpp
refacto: hide mesh_cache inside the rendering engine
[dragonfireclient.git] / src / terminal_chat_console.cpp
index a8c4ebaef1a8926e559f06ae534567b46fe8c3f1..9e3d33736190bc6ca2275d43b2ca84f37423c66a 100644 (file)
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "util/numeric.h"
 #include "util/string.h"
+#include "chat_interface.h"
 
 TerminalChatConsole g_term_console;
 
@@ -347,7 +348,8 @@ void TerminalChatConsole::step(int ch)
 
                std::wstring error_message = utf8_to_wide(Logger::getLevelLabel(p.first));
                if (!g_settings->getBool("disable_escape_sequences")) {
-                       error_message = L"\x1b(c@red)" + error_message + L"\x1b(c@white)";
+                       error_message = std::wstring(L"\x1b(c@red)").append(error_message)
+                               .append(L"\x1b(c@white)");
                }
                m_chat_backend.addMessage(error_message, utf8_to_wide(p.second));
        }
@@ -438,8 +440,7 @@ void TerminalChatConsole::draw_text()
                const ChatFormattedLine& line = buf.getFormattedLine(row);
                if (line.fragments.empty())
                        continue;
-               for (u32 i = 0; i < line.fragments.size(); ++i) {
-                       const ChatFormattedFragment& fragment = line.fragments[i];
+               for (const ChatFormattedFragment &fragment : line.fragments) {
                        addstr(wide_to_utf8(fragment.text.getString()).c_str());
                }
        }