Merge branch 'fix-credit-text-disappear' into 'next'

Fix credit sequence not compensating for non-green resolutions

Closes #1184

See merge request STJr/SRB2!2320
This commit is contained in:
sphere 2024-02-24 00:28:28 +00:00
commit f804ae42c1

View file

@ -1281,6 +1281,9 @@ void F_CreditDrawer(void)
UINT8 colornum; UINT8 colornum;
const UINT8 *colormap; const UINT8 *colormap;
// compensation for y on non-green resolutions, used to prevent text from disappearing before reaching the top
UINT16 compy = (vid.height - (BASEVIDHEIGHT * vid.dup)) / 2;
if (players[consoleplayer].skincolor) if (players[consoleplayer].skincolor)
colornum = players[consoleplayer].skincolor; colornum = players[consoleplayer].skincolor;
else else
@ -1312,17 +1315,17 @@ void F_CreditDrawer(void)
y += 80<<FRACBITS; y += 80<<FRACBITS;
break; break;
case 1: case 1:
if (y>>FRACBITS > -20) if (y>>FRACBITS > -20-compy)
V_DrawCreditString((160 - (V_CreditStringWidth(&credits[i][1])>>1))<<FRACBITS, y, 0, &credits[i][1]); V_DrawCreditString((160 - (V_CreditStringWidth(&credits[i][1])>>1))<<FRACBITS, y, 0, &credits[i][1]);
y += 30<<FRACBITS; y += 30<<FRACBITS;
break; break;
case 2: case 2:
if (y>>FRACBITS > -10) if (y>>FRACBITS > -10-compy)
V_DrawStringAtFixed((BASEVIDWIDTH-V_StringWidth(&credits[i][1], V_ALLOWLOWERCASE|V_YELLOWMAP))<<FRACBITS>>1, y, V_ALLOWLOWERCASE|V_YELLOWMAP, &credits[i][1]); V_DrawStringAtFixed((BASEVIDWIDTH-V_StringWidth(&credits[i][1], V_ALLOWLOWERCASE|V_YELLOWMAP))<<FRACBITS>>1, y, V_ALLOWLOWERCASE|V_YELLOWMAP, &credits[i][1]);
y += 12<<FRACBITS; y += 12<<FRACBITS;
break; break;
default: default:
if (y>>FRACBITS > -10) if (y>>FRACBITS > -10-compy)
V_DrawStringAtFixed(32<<FRACBITS, y, V_ALLOWLOWERCASE, credits[i]); V_DrawStringAtFixed(32<<FRACBITS, y, V_ALLOWLOWERCASE, credits[i]);
y += 12<<FRACBITS; y += 12<<FRACBITS;
break; break;