mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Only calculate string when we need it
This commit is contained in:
parent
0e55de6dcc
commit
817e6f568a
1 changed files with 6 additions and 10 deletions
|
|
@ -913,13 +913,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
|
|||
//
|
||||
static void HU_TickSongCredits(void)
|
||||
{
|
||||
char *str;
|
||||
INT32 len;
|
||||
fixed_t destx;
|
||||
|
||||
cursongcredit.old_x = cursongcredit.x;
|
||||
|
||||
if (!cursongcredit.def) // No def
|
||||
if (cursongcredit.def == NULL) // No def
|
||||
{
|
||||
cursongcredit.x = cursongcredit.old_x = 0;
|
||||
cursongcredit.anim = 0;
|
||||
|
|
@ -927,12 +921,14 @@ static void HU_TickSongCredits(void)
|
|||
return;
|
||||
}
|
||||
|
||||
str = va("\x1F"" %s", cursongcredit.def->source);
|
||||
len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE);
|
||||
destx = (len+7) * FRACUNIT;
|
||||
cursongcredit.old_x = cursongcredit.x;
|
||||
|
||||
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)
|
||||
{
|
||||
cursongcredit.trans--;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue