Merge branch 'dedicated-server-credits-fix' into 'master'

Dedicated server credits fix

See merge request STJr/SRB2!476
This commit is contained in:
Monster Iestyn 2019-03-26 09:44:21 -04:00
commit 8e78369f83

View file

@ -1192,16 +1192,34 @@ void F_CreditDrawer(void)
if (FixedMul(y,vid.dupy) > vid.height) if (FixedMul(y,vid.dupy) > vid.height)
break; break;
} }
}
void F_CreditTicker(void)
{
// "Simulate" the drawing of the credits so that dedicated mode doesn't get stuck
UINT16 i;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8;
// Draw credits text on top
for (i = 0; credits[i]; i++)
{
switch(credits[i][0])
{
case 0: y += 80<<FRACBITS; break;
case 1: y += 30<<FRACBITS; break;
default: y += 12<<FRACBITS; break;
}
if (FixedMul(y,vid.dupy) > vid.height)
break;
}
// Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits)
if (!credits[i] && y <= 120<<FRACBITS && !finalecount) if (!credits[i] && y <= 120<<FRACBITS && !finalecount)
{ {
timetonext = 5*TICRATE+1; timetonext = 5*TICRATE+1;
finalecount = 5*TICRATE; finalecount = 5*TICRATE;
} }
}
void F_CreditTicker(void)
{
if (timetonext) if (timetonext)
timetonext--; timetonext--;
else else