mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Only calculate string when we need it
This commit is contained in:
parent
fcc5c8e0c4
commit
ac2ab1bdcc
1 changed files with 6 additions and 10 deletions
|
|
@ -897,13 +897,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
|
||||||
//
|
//
|
||||||
static void HU_TickSongCredits(void)
|
static void HU_TickSongCredits(void)
|
||||||
{
|
{
|
||||||
char *str;
|
if (cursongcredit.def == NULL) // No def
|
||||||
INT32 len;
|
|
||||||
fixed_t destx;
|
|
||||||
|
|
||||||
cursongcredit.old_x = cursongcredit.x;
|
|
||||||
|
|
||||||
if (!cursongcredit.def) // No def
|
|
||||||
{
|
{
|
||||||
cursongcredit.x = cursongcredit.old_x = 0;
|
cursongcredit.x = cursongcredit.old_x = 0;
|
||||||
cursongcredit.anim = 0;
|
cursongcredit.anim = 0;
|
||||||
|
|
@ -911,12 +905,14 @@ static void HU_TickSongCredits(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
str = va("\x1F"" %s", cursongcredit.def->source);
|
cursongcredit.old_x = cursongcredit.x;
|
||||||
len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE);
|
|
||||||
destx = (len+7) * FRACUNIT;
|
|
||||||
|
|
||||||
if (cursongcredit.anim > 0)
|
if (cursongcredit.anim > 0)
|
||||||
{
|
{
|
||||||
|
char *str = va("\x1F"" %s", cursongcredit.def->source);
|
||||||
|
INT32 len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE);
|
||||||
|
fixed_t destx = (len+7) * FRACUNIT;
|
||||||
|
|
||||||
if (cursongcredit.trans > 0)
|
if (cursongcredit.trans > 0)
|
||||||
{
|
{
|
||||||
cursongcredit.trans--;
|
cursongcredit.trans--;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue