From 98bf8a414d87422dcdeb8d2f561f1b21568e69ed Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 5 Mar 2022 23:26:58 +0000 Subject: [PATCH] Adjust the bannerx system (used both by titlecard and boss titlecard) to actively scale with the resolution, instead of blindly drawing three times. --- src/st_stuff.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 74f485d01..6c53d310d 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -819,7 +819,7 @@ void ST_runTitleCard(void) } } // No matter the circumstances, scroll the WARN... - bannerx = -(lt_ticker%((encoremode ? twarn2 : twarn)->width)); + bannerx = -((lt_ticker*2)%((encoremode ? twarn2 : twarn)->width)); } else { @@ -944,7 +944,7 @@ void ST_runTitleCard(void) } // No matter the circumstances, scroll the banner... - bannerx = -(lt_ticker%(tcbanner->width)); + bannerx = -((lt_ticker*2)%(tcbanner->width)); } @@ -969,10 +969,9 @@ void ST_drawTitleCard(void) fixed_t actscale; angle_t fakeangle; + INT32 pad = ((vid.width/vid.dupx) - BASEVIDWIDTH)/2; INT32 bx = bannerx; // We need to make a copy of that otherwise pausing will cause problems. - UINT8 i; - if (!G_IsTitleCardAvailable()) return; @@ -1001,7 +1000,7 @@ void ST_drawTitleCard(void) INT32 transp = (lt_ticker+HITIME) % (LOTIME+HITIME); boolean encorehack = (encoremode && lt_ticker <= PRELEVELTIME+4); - if (lt_ticker + (HITIME-transp) <= lt_endtime) + if ((localwarn->width > 0) && (lt_ticker + (HITIME-transp) <= lt_endtime)) { if (transp > HITIME-1) { @@ -1010,9 +1009,11 @@ void ST_drawTitleCard(void) transp = (((10*transp)/HITIME)< -pad) + bx -= localwarn->width; + while (bx < BASEVIDWIDTH+pad) { - V_DrawFixedPatch((bannerx + bx)*FRACUNIT, 55*FRACUNIT, FRACUNIT, V_SNAPTOLEFT|transp, localwarn, NULL); + V_DrawFixedPatch(bx*FRACUNIT, 55*FRACUNIT, FRACUNIT, V_SNAPTOLEFT|transp, localwarn, NULL); bx += localwarn->width; } } @@ -1098,11 +1099,16 @@ void ST_drawTitleCard(void) // round num background V_DrawFixedPatch(roundnumx*FRACUNIT, roundnumy*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tccirclebg, NULL); - // Scrolling banner, we'll draw 3 of those back to back. - for (i=0; i < 3; i++) + // Scrolling banner + if (tcbanner->width > 0) { - V_DrawFixedPatch((bannerx + bx)*FRACUNIT, (bannery)*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tcbanner, NULL); - bx += tcbanner->width; + while (bx > -pad) + bx -= tcbanner->width; + while (bx < BASEVIDWIDTH+pad) + { + V_DrawFixedPatch(bx*FRACUNIT, (bannery)*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tcbanner, NULL); + bx += tcbanner->width; + } } // If possible, draw round number