mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Merge branch 'goner-free' into 'master'
V_ScaledWordWrap allocates Zone memory, so be sure to free Goner's usage See merge request KartKrew/Kart!2198
This commit is contained in:
commit
607611daaf
1 changed files with 7 additions and 2 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
#include "../m_easing.h"
|
#include "../m_easing.h"
|
||||||
#include "../g_input.h"
|
#include "../g_input.h"
|
||||||
#include "../m_pw.h"
|
#include "../m_pw.h"
|
||||||
|
#include "../z_zone.h"
|
||||||
|
|
||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
|
|
||||||
|
|
@ -145,16 +146,20 @@ public:
|
||||||
|
|
||||||
GonerChatLine(gonerspeakers_t speaker, int delay, std::string dialogue)
|
GonerChatLine(gonerspeakers_t speaker, int delay, std::string dialogue)
|
||||||
{
|
{
|
||||||
this->speaker = speaker;
|
char *newText = V_ScaledWordWrap(
|
||||||
this->dialogue = V_ScaledWordWrap(
|
|
||||||
(BASEVIDWIDTH/2 + 6) << FRACBITS,
|
(BASEVIDWIDTH/2 + 6) << FRACBITS,
|
||||||
FRACUNIT, FRACUNIT, FRACUNIT,
|
FRACUNIT, FRACUNIT, FRACUNIT,
|
||||||
0, TINY_FONT,
|
0, TINY_FONT,
|
||||||
dialogue.c_str()
|
dialogue.c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this->speaker = speaker;
|
||||||
|
this->dialogue = std::string(newText);
|
||||||
this->value = delay;
|
this->value = delay;
|
||||||
|
|
||||||
this->routine = nullptr;
|
this->routine = nullptr;
|
||||||
|
|
||||||
|
Z_Free(newText);
|
||||||
};
|
};
|
||||||
|
|
||||||
GonerChatLine(int delay, void (*routine)(void))
|
GonerChatLine(int delay, void (*routine)(void))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue