From be3d7b7dcda741bd957f7c1510244826b9a3f3c5 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 2 Dec 2019 22:24:05 +0800 Subject: [PATCH] - Remove y coordinate from struct for credits_pics - Update x coordinates for credits_pics entries - Reorder credits_pics entries (what even was the previous order lol) - Add zig zag graphics to credits roll - Attempt to scale the y positions of credits graphics with the length of the credits roll - New escape character for credits entries: \2, which centers the text and makes it yellow - Add support for colored text to V_DrawStringAtFixed --- src/f_finale.c | 73 ++++++++++++++++++++++++++++++++++++++------------ src/v_video.c | 12 ++++++++- 2 files changed, 67 insertions(+), 18 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 318668b59..306dad4e9 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1253,30 +1253,41 @@ static const char *credits[] = { "\1Published By", "A 28K dialup modem", "", - "\1Thank you", - "\1for playing!", + "\1Thank you ", + "\1for playing! ", NULL }; +#define CREDITS_LEFT 8 +#define CREDITS_RIGHT ((BASEVIDWIDTH) - 8) + static struct { - UINT32 x, y; + UINT32 x; const char *patch; } credits_pics[] = { - { 8, 80+200* 1, "CREDIT01"}, - { 4, 80+200* 2, "CREDIT13"}, - {250, 80+200* 3, "CREDIT12"}, - { 8, 80+200* 4, "CREDIT03"}, - {248, 80+200* 5, "CREDIT11"}, - { 8, 80+200* 6, "CREDIT04"}, - {112, 80+200* 7, "CREDIT10"}, - {240, 80+200* 8, "CREDIT05"}, - {120, 80+200* 9, "CREDIT06"}, - { 8, 80+200*10, "CREDIT07"}, - { 8, 80+200*11, "CREDIT08"}, - {112, 80+200*12, "CREDIT09"}, - {0, 0, NULL} + {CREDITS_LEFT, "CREDIT01"}, + {CREDITS_RIGHT - (271 >> 1), "CREDIT02"}, + {CREDITS_LEFT, "CREDIT03"}, + {CREDITS_RIGHT - (316 >> 1), "CREDIT04"}, + {CREDITS_LEFT, "CREDIT05"}, + {CREDITS_RIGHT - (399 >> 1), "CREDIT06"}, + {CREDITS_LEFT, "CREDIT07"}, + {CREDITS_RIGHT - (302 >> 1), "CREDIT08"}, + {CREDITS_LEFT, "CREDIT09"}, + {CREDITS_RIGHT - (250 >> 1), "CREDIT10"}, + {CREDITS_LEFT, "CREDIT11"}, + {CREDITS_RIGHT - (279 >> 1), "CREDIT12"}, + //{(BASEVIDWIDTH - (279 >> 1)) >> 1, "CREDIT12"}, + // CREDIT13 is extra art and is not shown by default + {0, NULL} }; +#undef CREDITS_LEFT +#undef CREDITS_RIGHT + +static UINT32 credits_height = 0; +static const UINT8 credits_numpics = sizeof(credits_pics)/sizeof(credits_pics[0]) - 1; + void F_StartCredits(void) { G_SetGamestate(GS_CREDITS); @@ -1310,13 +1321,20 @@ void F_StartCredits(void) void F_CreditDrawer(void) { UINT16 i; + INT16 zagpos = (timetonext - finalecount - animtimer) % 32; fixed_t y = (80<>1); + V_DrawSciencePatch(credits_pics[i].x<>1); // Dim the background V_DrawFadeScreen(0xFF00, 16); @@ -1334,6 +1352,11 @@ void F_CreditDrawer(void) V_DrawCreditString((160 - (V_CreditStringWidth(&credits[i][1])>>1))<>FRACBITS > -10) + 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) V_DrawStringAtFixed(32<