From ae04a9be2747509c33f0f3e2770a5493e0af47f3 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 16 Jan 2024 06:34:48 -0800 Subject: [PATCH] srb2::Dialogue::NewText: use string parsing --- src/k_dialogue.cpp | 4 ++-- src/k_dialogue.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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);