diff --git a/src/k_dialogue.cpp b/src/k_dialogue.cpp index 538e6d7d8..f489088cc 100644 --- a/src/k_dialogue.cpp +++ b/src/k_dialogue.cpp @@ -218,7 +218,7 @@ void Dialogue::SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfx typewriter.voiceSfx = voice; } -void Dialogue::NewText(std::string rawText) +void Dialogue::NewText(std::string_view rawText) { Init(); @@ -226,7 +226,7 @@ void Dialogue::NewText(std::string rawText) 290 << FRACBITS, FRACUNIT, FRACUNIT, FRACUNIT, 0, HU_FONT, - rawText.c_str() + srb2::Draw::TextElement().parse(rawText).string().c_str() // parse special characters ); typewriter.NewText(newText); diff --git a/src/k_dialogue.hpp b/src/k_dialogue.hpp index bdea25626..eda14d67d 100644 --- a/src/k_dialogue.hpp +++ b/src/k_dialogue.hpp @@ -15,6 +15,7 @@ #define __K_DIALOGUE_HPP__ #include +#include #include "doomdef.h" #include "doomtype.h" @@ -34,7 +35,7 @@ public: void SetSpeaker(std::string skinName, int portraitID); void SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfxenum_t voice); - void NewText(std::string newText); + void NewText(std::string_view newText); bool Active(void); bool TextDone(void);