From 71ce173a0debd22834859ce3ad5f1948564d40f0 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Thu, 15 Feb 2024 22:03:28 +0100 Subject: [PATCH 1/2] Fix credit sequence not compensating for non-green resolutions --- src/f_finale.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index cb6461853..974196228 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1303,6 +1303,9 @@ void F_CreditDrawer(void) // Dim the background V_DrawFadeScreen(0xFF00, 16); + // compensation for y on non-green resolutions, used to prevent text from disappearing before reaching the top + int compy = vid.height - BASEVIDHEIGHT; + // Draw credits text on top for (i = 0; credits[i]; i++) { @@ -1312,17 +1315,17 @@ void F_CreditDrawer(void) y += 80<>FRACBITS > -20) + if (y>>FRACBITS > -20-compy) V_DrawCreditString((160 - (V_CreditStringWidth(&credits[i][1])>>1))<>FRACBITS > -10) + if (y>>FRACBITS > -10-compy) V_DrawStringAtFixed((BASEVIDWIDTH-V_StringWidth(&credits[i][1], V_ALLOWLOWERCASE|V_YELLOWMAP))<>1, y, V_ALLOWLOWERCASE|V_YELLOWMAP, &credits[i][1]); y += 12<>FRACBITS > -10) + if (y>>FRACBITS > -10-compy) V_DrawStringAtFixed(32< Date: Thu, 15 Feb 2024 23:01:16 +0100 Subject: [PATCH 2/2] Fix overshoot on credit text rendering --- src/f_finale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 974196228..21a159082 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1281,6 +1281,9 @@ void F_CreditDrawer(void) UINT8 colornum; 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) colornum = players[consoleplayer].skincolor; else @@ -1303,9 +1306,6 @@ void F_CreditDrawer(void) // Dim the background V_DrawFadeScreen(0xFF00, 16); - // compensation for y on non-green resolutions, used to prevent text from disappearing before reaching the top - int compy = vid.height - BASEVIDHEIGHT; - // Draw credits text on top for (i = 0; credits[i]; i++) {