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)
|
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;
|
||||||
|
|
@ -927,12 +921,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