srb2::Dialogue::NewText: free word-wrapped string

This commit is contained in:
James R 2024-01-16 06:31:56 -08:00
parent bfa6e4f401
commit cef3b6d841

View file

@ -218,18 +218,20 @@ void Dialogue::SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfx
typewriter.voiceSfx = voice; typewriter.voiceSfx = voice;
} }
void Dialogue::NewText(std::string newText) void Dialogue::NewText(std::string rawText)
{ {
Init(); Init();
newText = V_ScaledWordWrap( char* newText = V_ScaledWordWrap(
290 << FRACBITS, 290 << FRACBITS,
FRACUNIT, FRACUNIT, FRACUNIT, FRACUNIT, FRACUNIT, FRACUNIT,
0, HU_FONT, 0, HU_FONT,
newText.c_str() rawText.c_str()
); );
typewriter.NewText(newText); typewriter.NewText(newText);
Z_Free(newText);
} }
bool Dialogue::Active(void) bool Dialogue::Active(void)