1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-19 16:15:19 +01:00

Avoid copies when working with EnrichedString

This commit is contained in:
sfan5
2024-08-27 13:51:02 +02:00
parent fa4529b4f1
commit 19a58745c9
6 changed files with 53 additions and 54 deletions

View File

@@ -61,7 +61,7 @@ namespace gui
static irr::gui::IGUIStaticText *add(
irr::gui::IGUIEnvironment *guienv,
const wchar_t *text,
std::wstring_view text,
const core::rect< s32 > &rectangle,
bool border = false,
bool wordWrap = true,
@@ -204,7 +204,7 @@ inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedS
}
}
inline void setStaticText(irr::gui::IGUIStaticText *static_text, const wchar_t *text)
inline void setStaticText(irr::gui::IGUIStaticText *static_text, std::wstring_view text)
{
setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor()));
}