mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 09:42:57 +00:00
Improve captions code clarity, and also make music captions flash before they disappear.
This commit is contained in:
parent
9affcd98cb
commit
1e051a8893
1 changed files with 27 additions and 16 deletions
29
src/screen.c
29
src/screen.c
|
@ -444,21 +444,32 @@ void SCR_ClosedCaptions(void)
|
||||||
|
|
||||||
for (i = 0; i < NUMCAPTIONS; i++)
|
for (i = 0; i < NUMCAPTIONS; i++)
|
||||||
{
|
{
|
||||||
if (closedcaptions[i].s)
|
INT32 flags, y;
|
||||||
{
|
char dot;
|
||||||
INT32 flags = V_NOSCALESTART|V_ALLOWLOWERCASE;
|
boolean music;
|
||||||
INT32 y = vid.height-((i + 2)*10*vid.dupy);
|
|
||||||
char dot = ' ';
|
if (!closedcaptions[i].s)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((music = (closedcaptions[i].s-S_sfx == sfx_None)) && (closedcaptions[i].t < flashingtics) && (closedcaptions[i].t & 1))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
flags = V_NOSCALESTART|V_ALLOWLOWERCASE;
|
||||||
|
y = vid.height-((i + 2)*10*vid.dupy);
|
||||||
|
dot = ' ';
|
||||||
|
|
||||||
if (closedcaptions[i].b)
|
if (closedcaptions[i].b)
|
||||||
y -= (closedcaptions[i].b--)*vid.dupy;
|
y -= (closedcaptions[i].b--)*vid.dupy;
|
||||||
|
|
||||||
if (closedcaptions[i].t < CAPTIONFADETICS)
|
if (closedcaptions[i].t < CAPTIONFADETICS)
|
||||||
flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS);
|
flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS);
|
||||||
if (closedcaptions[i].c && closedcaptions[i].c->origin)
|
|
||||||
dot = '\x1E';
|
if (music)
|
||||||
else if (closedcaptions[i].s-S_sfx == sfx_None)
|
|
||||||
dot = '\x19';
|
dot = '\x19';
|
||||||
|
else if (closedcaptions[i].c && closedcaptions[i].c->origin)
|
||||||
|
dot = '\x1E';
|
||||||
|
|
||||||
V_DrawRightAlignedString(vid.width-(20*vid.dupx), y,
|
V_DrawRightAlignedString(vid.width-(20*vid.dupx), y,
|
||||||
flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name)));
|
flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue