Optimize updateFastFaceRow processing by removing some TileSpec copy (#5678)
[oweals/minetest.git] / src / chat.h
index 661cafc82e09c777db1d53003d1fea2a416c4f4a..5de676a2e02e9debb0489126885d4fcbd4c652c5 100644 (file)
@@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <list>
 
 #include "irrlichttypes.h"
-#include "util/coloredstring.h"
+#include "util/enriched_string.h"
 
 // Chat console related classes
 
@@ -34,11 +34,18 @@ struct ChatLine
        // age in seconds
        f32 age;
        // name of sending player, or empty if sent by server
-       std::wstring name;
+       EnrichedString name;
        // message text
-       ColoredString text;
+       EnrichedString text;
 
-       ChatLine(std::wstring a_name, std::wstring a_text):
+       ChatLine(const std::wstring &a_name, const std::wstring &a_text):
+               age(0.0),
+               name(a_name),
+               text(a_text)
+       {
+       }
+
+       ChatLine(const EnrichedString &a_name, const EnrichedString &a_text):
                age(0.0),
                name(a_name),
                text(a_text)
@@ -49,7 +56,7 @@ struct ChatLine
 struct ChatFormattedFragment
 {
        // text string
-       std::wstring text;
+       EnrichedString text;
        // starting column
        u32 column;
        // formatting
@@ -141,7 +148,7 @@ private:
 class ChatPrompt
 {
 public:
-       ChatPrompt(std::wstring prompt, u32 history_limit);
+       ChatPrompt(const std::wstring &prompt, u32 history_limit);
        ~ChatPrompt();
 
        // Input character or string
@@ -262,7 +269,7 @@ public:
        // Get the recent messages buffer
        ChatBuffer& getRecentBuffer();
        // Concatenate all recent messages
-       std::wstring getRecentChat();
+       EnrichedString getRecentChat();
        // Get the console prompt
        ChatPrompt& getPrompt();