From 0114c2bc22c0acd2f29d74f03d5540f1d86bcb5e Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 29 Dec 2018 10:59:34 +0100 Subject: [PATCH 1/7] Clean up splitscreen huds to allow minimap --- src/k_kart.c | 296 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 262 insertions(+), 34 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2a152162..fa024497 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6166,6 +6166,12 @@ INT32 CHEK_Y; // CHECK graphic INT32 MINI_X, MINI_Y; // Minimap INT32 WANT_X, WANT_Y; // Battle WANTED poster +// This is messy AND looks horrible, but I really couldn't find any other magic trick for 4 player splitscreen garbage. Sorry. +INT32 ITEM2_X, ITEM2_Y, ITEM3_X, ITEM3_Y, ITEM4_X, ITEM4_Y; +INT32 LAPS2_X, LAPS2_Y, LAPS3_X, LAPS3_Y, LAPS4_X, LAPS4_Y; +INT32 POSI2_X, POSI2_Y, POSI3_X, POSI3_Y, POSI4_X, POSI4_Y; + + static void K_initKartHUD(void) { /* @@ -6251,13 +6257,47 @@ static void K_initKartHUD(void) if (splitscreen > 1) // 3P/4P Small Splitscreen { + // 1P (top left) ITEM_X = -9; ITEM_Y = -8; LAPS_X = 3; LAPS_Y = (BASEVIDHEIGHT/2)-13; - POSI_X = (BASEVIDWIDTH/2)-3; + POSI_X = 32; + POSI_Y = (BASEVIDHEIGHT/2)- 16; + + // 2P (top right) + ITEM2_X = BASEVIDWIDTH-40; + ITEM2_Y = -8; + + LAPS2_X = BASEVIDWIDTH-45; + LAPS2_Y = (BASEVIDHEIGHT/2)-13; + + POSI2_X = BASEVIDWIDTH -9; + POSI2_Y = (BASEVIDHEIGHT/2)- 16; + + // 3P (bottom left) + ITEM3_X = -9; + ITEM3_Y = (BASEVIDHEIGHT/2) -9; + + LAPS3_X = 3; + LAPS3_Y = (BASEVIDHEIGHT)-13; + + POSI3_X = 32; + POSI3_Y = (BASEVIDHEIGHT)- 16; + + // 4P (bottom right) + ITEM4_X = BASEVIDWIDTH-40; + ITEM4_Y = (BASEVIDHEIGHT/2) -9; + + LAPS4_X = BASEVIDWIDTH-45; + LAPS4_Y = (BASEVIDHEIGHT)-13; + + POSI4_X = BASEVIDWIDTH-9; + POSI4_Y = (BASEVIDHEIGHT)- 16; + + STCD_X = BASEVIDWIDTH/4; @@ -6331,7 +6371,8 @@ static void K_drawKartItem(void) patch_t *localpatch = kp_nodraw; patch_t *localbg = ((offset) ? kp_itembg[2] : kp_itembg[0]); patch_t *localinv = ((offset) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]); - INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); + INT32 fx = 0, fy = 0, fflags = 0; // final coords for hud and flags... + //INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); const INT32 numberdisplaymin = ((!offset && stplyr->kartstuff[k_itemtype] == KITEM_ORBINAUT) ? 5 : 2); INT32 itembar = 0; UINT8 localcolor = SKINCOLOR_NONE; @@ -6548,26 +6589,61 @@ static void K_drawKartItem(void) } } + // pain and suffering defined below + if (splitscreen < 2) // don't change shit for THIS splitscreen. + { + fx = ITEM_X; + fy = ITEM_Y; + fflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); + } + else // now we're having a fun game. + { + if (stplyr == &players[displayplayer]) + { + fx = ITEM_X; + fy = ITEM_Y; + fflags = V_SNAPTOTOP|V_SNAPTOLEFT; + } + else if (stplyr == &players[secondarydisplayplayer]) + { + fx = ITEM2_X; + fy = ITEM2_Y; + fflags = V_SNAPTOTOP|V_SNAPTORIGHT; + } + else if (stplyr == &players[thirddisplayplayer]) + { + fx = ITEM3_X; + fy = ITEM3_Y; + fflags = V_SNAPTOLEFT; + } + else if (stplyr == &players[fourthdisplayplayer]) + { + fx = ITEM4_X; + fy = ITEM4_Y; + fflags = V_SNAPTORIGHT; + } + } + if (localcolor != SKINCOLOR_NONE) colmap = R_GetTranslationColormap(colormode, localcolor, 0); - V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localbg); + V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, localbg); // Then, the numbers: if (stplyr->kartstuff[k_itemamount] >= numberdisplaymin && !stplyr->kartstuff[k_itemroulette]) { - V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, kp_itemmulsticker[offset]); - V_DrawFixedPatch(ITEM_X<kartstuff[k_itemamount])); + V_DrawString(fx+24, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|fflags, va("x%d", stplyr->kartstuff[k_itemamount])); else { - V_DrawScaledPatch(ITEM_X+28, ITEM_Y+41, V_HUDTRANS|splitflags, kp_itemx); - V_DrawKartString(ITEM_X+38, ITEM_Y+36, V_HUDTRANS|splitflags, va("%d", stplyr->kartstuff[k_itemamount])); + V_DrawScaledPatch(fy+28, fy+41, V_HUDTRANS|fflags, kp_itemx); + V_DrawKartString(fx+38, fy+36, V_HUDTRANS|fflags, va("%d", stplyr->kartstuff[k_itemamount])); } } else - V_DrawFixedPatch(ITEM_X< 2) { - V_DrawFill(ITEM_X+x+length, ITEM_Y+y+1, 1, height, 12|splitflags); // the right one + V_DrawFill(fx+x+length, fy+y+1, 1, height, 12|fflags); // the right one if (height == 2) - V_DrawFill(ITEM_X+x+2, ITEM_Y+y+2, length-2, 1, 8|splitflags); // the dulled underside - V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-2, 1, 120|splitflags); // the shine + V_DrawFill(fx+x+2, fy+y+2, length-2, 1, 8|fflags); // the dulled underside + V_DrawFill(fx+x+2, fy+y+1, length-2, 1, 120|fflags); // the shine } } // Quick Eggman numbers if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) - V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); + V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|fflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); + } void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode) @@ -6754,11 +6831,12 @@ static void K_DrawKartPositionNum(INT32 num) // POSI_Y = BASEVIDHEIGHT- 64; // 136 boolean win = (stplyr->exiting && num == 1); - INT32 X = POSI_X; + //INT32 X = POSI_X; INT32 W = SHORT(kp_positionnum[0][0]->width); fixed_t scale = FRACUNIT; patch_t *localpatch = kp_positionnum[0][0]; - INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); + //INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); + INT32 fx = 0, fy = 0, fflags = 0; if (stplyr->kartstuff[k_positiondelay] || stplyr->exiting) scale *= 2; @@ -6767,10 +6845,53 @@ static void K_DrawKartPositionNum(INT32 num) W = FixedMul(W<>FRACBITS; + // pain and suffering defined below + if (splitscreen < 2) // for this splitscreen, we'll be using more unique coordinates so we don't overlap the minimap :D + { + fx = POSI_X; + if (stplyr == &players[displayplayer]) // for player 1: display this at the top right, above the minimap. + { + fy = 32; + fflags = V_SNAPTOTOP|V_SNAPTOLEFT; + } + else // if we're not p1, that means we're p2. display this at the bottom right, below the minimap. + { + fy = BASEVIDHEIGHT - 8; + fflags = V_SNAPTOBOTTOM|V_SNAPTOLEFT; + } + } + else // now we're having a fun game. + { + if (stplyr == &players[displayplayer]) + { + fx = POSI_X; + fy = POSI_Y; + fflags = V_SNAPTOLEFT; + } + else if (stplyr == &players[secondarydisplayplayer]) + { + fx = POSI2_X; + fy = POSI2_Y; + fflags = V_SNAPTORIGHT; + } + else if (stplyr == &players[thirddisplayplayer]) + { + fx = POSI3_X; + fy = POSI3_Y; + fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; + } + else if (stplyr == &players[fourthdisplayplayer]) + { + fx = POSI4_X; + fy = POSI4_Y; + fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + } + } + // Special case for 0 if (!num) { - V_DrawFixedPatch(X< 1) { - V_DrawScaledPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_splitlapflag); + + // pain and suffering defined below + if (splitscreen < 2) // don't change shit for THIS splitscreen. + { + fx = LAPS_X; + fy = LAPS_Y; + fflags = splitflags; + } + else // now we're having a fun game. + { + if (stplyr == &players[displayplayer]) + { + fx = LAPS_X; + fy = LAPS_Y; + fflags = V_SNAPTOLEFT; + } + else if (stplyr == &players[secondarydisplayplayer]) + { + fx = LAPS2_X; + fy = LAPS2_Y; + fflags = V_SNAPTORIGHT; + } + else if (stplyr == &players[thirddisplayplayer]) + { + fx = LAPS3_X; + fy = LAPS3_Y; + fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; + } + else if (stplyr == &players[fourthdisplayplayer]) + { + fx = LAPS4_X; + fy = LAPS4_Y; + fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + } + } + + V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, kp_splitlapflag); if (stplyr->exiting) - V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, "FIN"); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, "FIN"); else - V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/%d", stplyr->laps+1, cv_numlaps.value)); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->laps+1, cv_numlaps.value)); } else { @@ -7102,18 +7260,46 @@ static void K_drawKartBumpersOrKarma(void) { UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0); INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT); + INT32 fx = 0, fy = 0, fflags = 0; if (splitscreen > 1) { + + // we will reuse lap coords here since it's essentially the same shit. + if (stplyr == &players[displayplayer]) + { + fx = LAPS_X; + fy = LAPS_Y; + fflags = V_SNAPTOLEFT; + } + else if (stplyr == &players[secondarydisplayplayer]) + { + fx = LAPS2_X; + fy = LAPS2_Y; + fflags = V_SNAPTORIGHT; + } + else if (stplyr == &players[thirddisplayplayer]) + { + fx = LAPS3_X; + fy = LAPS3_Y; + fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; + } + else if (stplyr == &players[fourthdisplayplayer]) + { + fx = LAPS4_X; + fy = LAPS4_Y; + fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + } + if (stplyr->kartstuff[k_bumper] <= 0) { - V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_splitkarmabomb, colormap); - V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/2", stplyr->kartstuff[k_comebackpoints])); + V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|fflags, kp_splitkarmabomb, colormap); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/2", stplyr->kartstuff[k_comebackpoints])); } else { - V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_rankbumper, colormap); - V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value)); + V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|fflags, kp_rankbumper, colormap); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value)); } } else @@ -7166,11 +7352,53 @@ static void K_drawKartWanted(void) { UINT8 i, numwanted = 0; UINT8 *colormap = NULL; + INT32 fx = 0, fy = 0, fflags = 0; // splitscreen stuff if (splitscreen) // Can't fit the poster on screen, sadly { + + // wanted is a bit of a mess but don't worry. + if (splitscreen < 2) // don't change shit for THIS splitscreen. + { + fx = WANT_X; + fy = WANT_Y; + fflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); + } + else // now we're having a fun game. + { + if (stplyr == &players[displayplayer]) + { + fx = LAPS_X; + fy = POSI_Y - 8; + fflags = V_SNAPTOLEFT; + } + else if (stplyr == &players[secondarydisplayplayer]) + { + fx = LAPS2_X - 10; + fy = POSI2_Y - 8; + fflags = V_SNAPTORIGHT; + } + else if (stplyr == &players[thirddisplayplayer]) + { + fx = LAPS3_X; + fy = POSI3_Y - 8; + fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; + } + else if (stplyr == &players[fourthdisplayplayer]) + { + fx = LAPS4_X - 10; + fy = POSI4_Y - 8; + fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + } + } + if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 3) - V_DrawRightAlignedString(WANT_X, WANT_Y, K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS|V_ORANGEMAP), "WANTED"); + { + if (splitscreen > 1) + V_DrawString(fx, fy-4, fflags|V_HUDTRANS|V_ORANGEMAP, "WANTED"); + else + V_DrawRightAlignedString(fx, fy, fflags|V_HUDTRANS|V_ORANGEMAP, "WANTED"); + } return; } @@ -7360,7 +7588,7 @@ static void K_drawKartMinimap(void) patch_t *AutomapPic; INT32 i = 0; INT32 x, y; - INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT); + INT32 minimaptrans, splitflags = (splitscreen < 2 ? 0 : V_SNAPTORIGHT); boolean dop1later = false; // Draw the HUD only when playing in a level. @@ -7383,7 +7611,7 @@ static void K_drawKartMinimap(void) if (timeinmap > 105) { - minimaptrans = (splitscreen ? 10 : cv_kartminimap.value); + minimaptrans = (splitscreen == 2 ? 10 : cv_kartminimap.value); if (timeinmap <= 113) minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105); if (!minimaptrans) @@ -7400,7 +7628,7 @@ static void K_drawKartMinimap(void) else V_DrawScaledPatch(x, y, splitflags, AutomapPic); - if (!splitscreen) + if (!(splitscreen == 2)) { splitflags &= ~minimaptrans; splitflags |= V_HUDTRANSHALF; @@ -8092,13 +8320,13 @@ void K_drawKartHUD(void) || ((splitscreen > 2 && stplyr == &players[fourthdisplayplayer]) && !camera4.chase)) K_drawKartFirstPerson(); - if (splitscreen == 2) // Player 4 in 3P is the minimap :p +/* if (splitscreen == 2) // Player 4 in 3P is the minimap :p { #ifdef HAVE_BLUA if (LUA_HudEnabled(hud_minimap)) #endif K_drawKartMinimap(); - } + }*/ // Draw full screen stuff that turns off the rest of the HUD if (mapreset && stplyr == &players[displayplayer]) @@ -8122,7 +8350,7 @@ void K_drawKartHUD(void) if (cv_kartcheck.value && !splitscreen && !players[displayplayer].exiting) K_drawKartPlayerCheck(); - if (splitscreen == 0 && cv_kartminimap.value && !titledemo) + if (cv_kartminimap.value && !titledemo) { #ifdef HAVE_BLUA if (LUA_HudEnabled(hud_minimap)) From 50808cc48c41f178cf391590f96cf68b4beca076 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 29 Dec 2018 11:17:51 +0100 Subject: [PATCH 2/7] Alignment mistakes for nongreen --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index fa024497..896dcc84 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6852,12 +6852,12 @@ static void K_DrawKartPositionNum(INT32 num) if (stplyr == &players[displayplayer]) // for player 1: display this at the top right, above the minimap. { fy = 32; - fflags = V_SNAPTOTOP|V_SNAPTOLEFT; + fflags = V_SNAPTOTOP|V_SNAPTORIGHT; } else // if we're not p1, that means we're p2. display this at the bottom right, below the minimap. { fy = BASEVIDHEIGHT - 8; - fflags = V_SNAPTOBOTTOM|V_SNAPTOLEFT; + fflags = V_SNAPTOBOTTOM|V_SNAPTORIGHT; } } else // now we're having a fun game. @@ -7588,7 +7588,7 @@ static void K_drawKartMinimap(void) patch_t *AutomapPic; INT32 i = 0; INT32 x, y; - INT32 minimaptrans, splitflags = (splitscreen < 2 ? 0 : V_SNAPTORIGHT); + INT32 minimaptrans, splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split) boolean dop1later = false; // Draw the HUD only when playing in a level. From 629067c5eb238e58ccc2755ab08409764d46d036 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 29 Dec 2018 21:46:40 +0100 Subject: [PATCH 3/7] Cleaner code because I was a huge idiot --- src/k_kart.c | 140 ++++++++++++--------------------------------------- 1 file changed, 31 insertions(+), 109 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 896dcc84..2b0ae318 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6166,10 +6166,10 @@ INT32 CHEK_Y; // CHECK graphic INT32 MINI_X, MINI_Y; // Minimap INT32 WANT_X, WANT_Y; // Battle WANTED poster -// This is messy AND looks horrible, but I really couldn't find any other magic trick for 4 player splitscreen garbage. Sorry. -INT32 ITEM2_X, ITEM2_Y, ITEM3_X, ITEM3_Y, ITEM4_X, ITEM4_Y; -INT32 LAPS2_X, LAPS2_Y, LAPS3_X, LAPS3_Y, LAPS4_X, LAPS4_Y; -INT32 POSI2_X, POSI2_Y, POSI3_X, POSI3_Y, POSI4_X, POSI4_Y; +// This is for the P2 and P4 side of splitscreen. Then we'll flip P1's and P2's to the bottom with V_SPLITSCREEN. +INT32 ITEM2_X, ITEM2_Y; +INT32 LAPS2_X, LAPS2_Y; +INT32 POSI2_X, POSI2_Y; static void K_initKartHUD(void) @@ -6277,27 +6277,7 @@ static void K_initKartHUD(void) POSI2_X = BASEVIDWIDTH -9; POSI2_Y = (BASEVIDHEIGHT/2)- 16; - // 3P (bottom left) - ITEM3_X = -9; - ITEM3_Y = (BASEVIDHEIGHT/2) -9; - - LAPS3_X = 3; - LAPS3_Y = (BASEVIDHEIGHT)-13; - - POSI3_X = 32; - POSI3_Y = (BASEVIDHEIGHT)- 16; - - // 4P (bottom right) - ITEM4_X = BASEVIDWIDTH-40; - ITEM4_Y = (BASEVIDHEIGHT/2) -9; - - LAPS4_X = BASEVIDWIDTH-45; - LAPS4_Y = (BASEVIDHEIGHT)-13; - - POSI4_X = BASEVIDWIDTH-9; - POSI4_Y = (BASEVIDHEIGHT)- 16; - - + // Reminder that 3P and 4P are just 1P and 2P splitscreen'd to the bottom. STCD_X = BASEVIDWIDTH/4; @@ -6598,29 +6578,17 @@ static void K_drawKartItem(void) } else // now we're having a fun game. { - if (stplyr == &players[displayplayer]) + if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... { fx = ITEM_X; fy = ITEM_Y; - fflags = V_SNAPTOTOP|V_SNAPTOLEFT; + fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN : V_SNAPTOTOP); // flip P3 to the bottom. } - else if (stplyr == &players[secondarydisplayplayer]) + else // else, that means we're P2 or P4. { fx = ITEM2_X; fy = ITEM2_Y; - fflags = V_SNAPTOTOP|V_SNAPTORIGHT; - } - else if (stplyr == &players[thirddisplayplayer]) - { - fx = ITEM3_X; - fy = ITEM3_Y; - fflags = V_SNAPTOLEFT; - } - else if (stplyr == &players[fourthdisplayplayer]) - { - fx = ITEM4_X; - fy = ITEM4_Y; - fflags = V_SNAPTORIGHT; + fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN : V_SNAPTOTOP); // flip P4 to the bottom } } @@ -6846,7 +6814,7 @@ static void K_DrawKartPositionNum(INT32 num) W = FixedMul(W<>FRACBITS; // pain and suffering defined below - if (splitscreen < 2) // for this splitscreen, we'll be using more unique coordinates so we don't overlap the minimap :D + if (splitscreen < 2) // for this splitscreen, we'll use case by case because it's a bit different. { fx = POSI_X; if (stplyr == &players[displayplayer]) // for player 1: display this at the top right, above the minimap. @@ -6860,31 +6828,19 @@ static void K_DrawKartPositionNum(INT32 num) fflags = V_SNAPTOBOTTOM|V_SNAPTORIGHT; } } - else // now we're having a fun game. + else { - if (stplyr == &players[displayplayer]) + if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... { fx = POSI_X; fy = POSI_Y; - fflags = V_SNAPTOLEFT; + fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. } - else if (stplyr == &players[secondarydisplayplayer]) + else // else, that means we're P2 or P4. { fx = POSI2_X; fy = POSI2_Y; - fflags = V_SNAPTORIGHT; - } - else if (stplyr == &players[thirddisplayplayer]) - { - fx = POSI3_X; - fy = POSI3_Y; - fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; - } - else if (stplyr == &players[fourthdisplayplayer]) - { - fx = POSI4_X; - fy = POSI4_Y; - fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom } } @@ -7188,31 +7144,19 @@ static void K_drawKartLaps(void) fy = LAPS_Y; fflags = splitflags; } - else // now we're having a fun game. + else { - if (stplyr == &players[displayplayer]) + if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... { fx = LAPS_X; fy = LAPS_Y; - fflags = V_SNAPTOLEFT; + fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. } - else if (stplyr == &players[secondarydisplayplayer]) + else // else, that means we're P2 or P4. { fx = LAPS2_X; fy = LAPS2_Y; - fflags = V_SNAPTORIGHT; - } - else if (stplyr == &players[thirddisplayplayer]) - { - fx = LAPS3_X; - fy = LAPS3_Y; - fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; - } - else if (stplyr == &players[fourthdisplayplayer]) - { - fx = LAPS4_X; - fy = LAPS4_Y; - fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom } } @@ -7266,29 +7210,18 @@ static void K_drawKartBumpersOrKarma(void) { // we will reuse lap coords here since it's essentially the same shit. - if (stplyr == &players[displayplayer]) + + if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... { fx = LAPS_X; fy = LAPS_Y; - fflags = V_SNAPTOLEFT; + fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. } - else if (stplyr == &players[secondarydisplayplayer]) + else // else, that means we're P2 or P4. { fx = LAPS2_X; fy = LAPS2_Y; - fflags = V_SNAPTORIGHT; - } - else if (stplyr == &players[thirddisplayplayer]) - { - fx = LAPS3_X; - fy = LAPS3_Y; - fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; - } - else if (stplyr == &players[fourthdisplayplayer]) - { - fx = LAPS4_X; - fy = LAPS4_Y; - fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom } if (stplyr->kartstuff[k_bumper] <= 0) @@ -7364,31 +7297,20 @@ static void K_drawKartWanted(void) fy = WANT_Y; fflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); } - else // now we're having a fun game. + else { - if (stplyr == &players[displayplayer]) + + if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... { fx = LAPS_X; fy = POSI_Y - 8; - fflags = V_SNAPTOLEFT; + fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. } - else if (stplyr == &players[secondarydisplayplayer]) + else // else, that means we're P2 or P4. { fx = LAPS2_X - 10; fy = POSI2_Y - 8; - fflags = V_SNAPTORIGHT; - } - else if (stplyr == &players[thirddisplayplayer]) - { - fx = LAPS3_X; - fy = POSI3_Y - 8; - fflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM; - } - else if (stplyr == &players[fourthdisplayplayer]) - { - fx = LAPS4_X - 10; - fy = POSI4_Y - 8; - fflags = V_SNAPTORIGHT|V_SNAPTOBOTTOM; + fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom } } From 9a030bfd40e74b415b52c156a205737cf072a13b Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Wed, 2 Jan 2019 20:36:13 +0100 Subject: [PATCH 4/7] More cleanups and WANTED stuff --- src/k_kart.c | 180 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 116 insertions(+), 64 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2b0ae318..02c7e835 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5816,6 +5816,8 @@ static patch_t *kp_battlelose; static patch_t *kp_battlewait; static patch_t *kp_battleinfo; static patch_t *kp_wanted; +static patch_t *kp_wantedsplit; +static patch_t *kp_wantedreticle; static patch_t *kp_itembg[4]; static patch_t *kp_itemtimer[2]; @@ -5955,6 +5957,8 @@ void K_LoadKartHUDGraphics(void) kp_battlewait = W_CachePatchName("K_BWAIT", PU_HUDGFX); kp_battleinfo = W_CachePatchName("K_BINFO", PU_HUDGFX); kp_wanted = W_CachePatchName("K_WANTED", PU_HUDGFX); + kp_wantedsplit = W_CachePatchName("4PWANTED", PU_HUDGFX); + kp_wantedreticle = W_CachePatchName("MMAPWANT", PU_HUDGFX); // Kart Item Windows kp_itembg[0] = W_CachePatchName("K_ITBG", PU_HUDGFX); @@ -6252,9 +6256,6 @@ static void K_initKartHUD(void) MINI_Y = (BASEVIDHEIGHT/2); - WANT_X = BASEVIDWIDTH-8; - WANT_Y = (BASEVIDHEIGHT/2)-12; - if (splitscreen > 1) // 3P/4P Small Splitscreen { // 1P (top left) @@ -6264,17 +6265,17 @@ static void K_initKartHUD(void) LAPS_X = 3; LAPS_Y = (BASEVIDHEIGHT/2)-13; - POSI_X = 32; + POSI_X = 24; POSI_Y = (BASEVIDHEIGHT/2)- 16; // 2P (top right) - ITEM2_X = BASEVIDWIDTH-40; + ITEM2_X = BASEVIDWIDTH-39; ITEM2_Y = -8; - LAPS2_X = BASEVIDWIDTH-45; + LAPS2_X = BASEVIDWIDTH-40; LAPS2_Y = (BASEVIDHEIGHT/2)-13; - POSI2_X = BASEVIDWIDTH -9; + POSI2_X = BASEVIDWIDTH -8; POSI2_Y = (BASEVIDHEIGHT/2)- 16; // Reminder that 3P and 4P are just 1P and 2P splitscreen'd to the bottom. @@ -6284,8 +6285,6 @@ static void K_initKartHUD(void) MINI_X = (3*BASEVIDWIDTH/4); MINI_Y = (3*BASEVIDHEIGHT/4); - WANT_X = (BASEVIDWIDTH/2)-8; - if (splitscreen > 2) // 4P-only { MINI_X = (BASEVIDWIDTH/2); @@ -6358,6 +6357,7 @@ static void K_drawKartItem(void) UINT8 localcolor = SKINCOLOR_NONE; SINT8 colormode = TC_RAINBOW; UINT8 *colmap = NULL; + boolean flipamount = false; // Used for 3P/4P splitscreen to flip item amount stuff if (stplyr->kartstuff[k_itemroulette]) { @@ -6589,6 +6589,7 @@ static void K_drawKartItem(void) fx = ITEM2_X; fy = ITEM2_Y; fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN : V_SNAPTOTOP); // flip P4 to the bottom + flipamount = true; } } @@ -6600,10 +6601,13 @@ static void K_drawKartItem(void) // Then, the numbers: if (stplyr->kartstuff[k_itemamount] >= numberdisplaymin && !stplyr->kartstuff[k_itemroulette]) { - V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, kp_itemmulsticker[offset]); + V_DrawScaledPatch(fx + (flipamount ? 48 : 0), fy, V_HUDTRANS|fflags|(flipamount ? V_FLIP : 0), kp_itemmulsticker[offset]); // flip this graphic for p2 and p4 in split and shift it. V_DrawFixedPatch(fx<kartstuff[k_itemamount])); + if (flipamount) // reminder that this is for 3/4p's right end of the screen. + V_DrawString(fx+2, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|fflags, va("x%d", stplyr->kartstuff[k_itemamount])); + else + V_DrawString(fx+24, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|fflags, va("x%d", stplyr->kartstuff[k_itemamount])); else { V_DrawScaledPatch(fy+28, fy+41, V_HUDTRANS|fflags, kp_itemx); @@ -6805,9 +6809,14 @@ static void K_DrawKartPositionNum(INT32 num) patch_t *localpatch = kp_positionnum[0][0]; //INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); INT32 fx = 0, fy = 0, fflags = 0; + boolean flipdraw = false; // flip the order we draw it in for MORE splitscreen bs. fun. + boolean overtake = false; if (stplyr->kartstuff[k_positiondelay] || stplyr->exiting) + { scale *= 2; + overtake = true; // this is used for splitscreen stuff in conjunction with flipdraw. + } if (splitscreen) scale /= 2; @@ -6819,7 +6828,7 @@ static void K_DrawKartPositionNum(INT32 num) fx = POSI_X; if (stplyr == &players[displayplayer]) // for player 1: display this at the top right, above the minimap. { - fy = 32; + fy = 30; fflags = V_SNAPTOTOP|V_SNAPTORIGHT; } else // if we're not p1, that means we're p2. display this at the bottom right, below the minimap. @@ -6835,6 +6844,9 @@ static void K_DrawKartPositionNum(INT32 num) fx = POSI_X; fy = POSI_Y; fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. + flipdraw = true; + if (num && num >= 10) + fx += W; // this seems dumb, but we need to do this in order for positions above 10 going off screen. } else // else, that means we're P2 or P4. { @@ -6889,7 +6901,8 @@ static void K_DrawKartPositionNum(INT32 num) else localpatch = kp_positionnum[num % 10][0]; - V_DrawFixedPatch(fx<width*scale/2) : 0), fy< 1) { @@ -7157,15 +7172,30 @@ static void K_drawKartLaps(void) fx = LAPS2_X; fy = LAPS2_Y; fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom + flipstring = true; // make the string right aligned and other shit } } - V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, kp_splitlapflag); - if (stplyr->exiting) + + if (stplyr->exiting) // draw stuff as god intended. + { + V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, kp_splitlapflag); V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, "FIN"); - else - V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->laps+1, cv_numlaps.value)); + } + else // take flipstring into account here since we may have more laps than just 10 + if (flipstring) + { + stringw = V_StringWidth(va("%d/%d", stplyr->laps+1, cv_numlaps.value), 0); + + V_DrawScaledPatch(BASEVIDWIDTH-stringw-16, fy, V_HUDTRANS|fflags, kp_splitlapflag); + V_DrawRightAlignedString(BASEVIDWIDTH-3, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->laps+1, cv_numlaps.value)); + } + else // draw stuff NORMALLY. + { + V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, kp_splitlapflag); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->laps+1, cv_numlaps.value)); + } } else { @@ -7205,6 +7235,8 @@ static void K_drawKartBumpersOrKarma(void) UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0); INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT); INT32 fx = 0, fy = 0, fflags = 0; + boolean flipstring = false; // same as laps, used for splitscreen + INT32 stringw = 0; // used with the above if (splitscreen > 1) { @@ -7222,6 +7254,7 @@ static void K_drawKartBumpersOrKarma(void) fx = LAPS2_X; fy = LAPS2_Y; fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom + flipstring = true; } if (stplyr->kartstuff[k_bumper] <= 0) @@ -7229,10 +7262,20 @@ static void K_drawKartBumpersOrKarma(void) V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|fflags, kp_splitkarmabomb, colormap); V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/2", stplyr->kartstuff[k_comebackpoints])); } - else + else // the above doesn't need to account for weird stuff since the max amount of karma necessary is always 2 ^^^^ { - V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|fflags, kp_rankbumper, colormap); - V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value)); + if (flipstring) // for p2 and p4, assume we can have more than 10 bumpers. It's retarded but who knows. + { + stringw = V_StringWidth(va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value), 0); + + V_DrawMappedPatch(BASEVIDWIDTH-stringw-16, fy-1, V_HUDTRANS|fflags, kp_rankbumper, colormap); + V_DrawRightAlignedString(BASEVIDWIDTH-3, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value)); + } + else // draw bumpers normally. + { + V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|fflags, kp_rankbumper, colormap); + V_DrawString(fx+13, fy+1, V_HUDTRANS|fflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value)); + } } } else @@ -7285,44 +7328,7 @@ static void K_drawKartWanted(void) { UINT8 i, numwanted = 0; UINT8 *colormap = NULL; - INT32 fx = 0, fy = 0, fflags = 0; // splitscreen stuff - - if (splitscreen) // Can't fit the poster on screen, sadly - { - - // wanted is a bit of a mess but don't worry. - if (splitscreen < 2) // don't change shit for THIS splitscreen. - { - fx = WANT_X; - fy = WANT_Y; - fflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); - } - else - { - - if (stplyr == &players[displayplayer] || stplyr == &players[thirddisplayplayer]) // If we are P1 or P3... - { - fx = LAPS_X; - fy = POSI_Y - 8; - fflags = V_SNAPTOLEFT|((stplyr == &players[thirddisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. - } - else // else, that means we're P2 or P4. - { - fx = LAPS2_X - 10; - fy = POSI2_Y - 8; - fflags = V_SNAPTORIGHT|((stplyr == &players[fourthdisplayplayer]) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom - } - } - - if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 3) - { - if (splitscreen > 1) - V_DrawString(fx, fy-4, fflags|V_HUDTRANS|V_ORANGEMAP, "WANTED"); - else - V_DrawRightAlignedString(fx, fy, fflags|V_HUDTRANS|V_ORANGEMAP, "WANTED"); - } - return; - } + INT32 basex = 0, basey = 0; for (i = 0; i < 4; i++) { @@ -7334,13 +7340,33 @@ static void K_drawKartWanted(void) if (numwanted <= 0) return; + // set X/Y coords depending on splitscreen. + if (splitscreen < 3) // 1P and 2P use the same code. + { + basex = WANT_X; + basey = WANT_Y; + if (splitscreen == 2) + { + basey += 16; // slight adjust for 3P + basex -= 6; + } + } + else if (splitscreen == 3) // 4P splitscreen... + { + basex = BASEVIDWIDTH/2 - (SHORT)(kp_wantedsplit->width/2); // center on screen + basey = BASEVIDHEIGHT - 55; + //basey2 = 4; + } + if (battlewanted[0] != -1) colormap = R_GetTranslationColormap(0, players[battlewanted[0]].skincolor, GTC_CACHE); - V_DrawFixedPatch(WANT_X< 1 ? kp_wantedsplit : kp_wanted), colormap); + /*if (basey2) + V_DrawFixedPatch(basex< 1 ? 13 : 8), y = basey+(splitscreen > 1 ? 16 : 21); fixed_t scale = FRACUNIT/2; player_t *p = &players[battlewanted[i]]; @@ -7360,7 +7386,9 @@ static void K_drawKartWanted(void) if (players[battlewanted[i]].skincolor) { colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE); - V_DrawFixedPatch(x<skin] : facerankprefix[p->skin]), colormap); + V_DrawFixedPatch(x<skin] : facerankprefix[p->skin]), colormap); + /*if (basey2) // again with 4p stuff + V_DrawFixedPatch(x<skin] : facerankprefix[p->skin]), colormap);*/ } } } @@ -7501,6 +7529,8 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat else colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE); V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap); + if (mo->player && K_IsPlayerWanted(mo->player)) + V_DrawFixedPatch(amxpos - (4< 105) { - minimaptrans = (splitscreen == 2 ? 10 : cv_kartminimap.value); + minimaptrans = cv_kartminimap.value; if (timeinmap <= 113) minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105); if (!minimaptrans) @@ -7585,7 +7615,7 @@ static void K_drawKartMinimap(void) if (!players[i].mo || players[i].spectator) continue; - if (!splitscreen && i == displayplayer) + if (i == displayplayer || i == secondarydisplayplayer || i == thirddisplayplayer || i == fourthdisplayplayer) // don't draw our local players. { dop1later = true; // Do displayplayer later continue; @@ -7608,9 +7638,31 @@ static void K_drawKartMinimap(void) if (!dop1later) return; // Don't need this + // draw our local players here, opaque. splitflags &= ~V_HUDTRANSHALF; splitflags |= V_HUDTRANS; - K_drawKartMinimapHead(stplyr->mo, x, y, splitflags, AutomapPic); + for (i = MAXPLAYERS-1; i >= 0; i--) + { + if (!(i == displayplayer || i == secondarydisplayplayer || i == thirddisplayplayer || i == fourthdisplayplayer)) + continue; // this doesn't interrest us + + if (splitscreen > 1) // this only applies to splitscreen. When we play alone, we should always get drawn reguardless of what we're doing. + { + if (G_BattleGametype() && players[i].kartstuff[k_bumper] <= 0) + continue; + if (players[i].kartstuff[k_hyudorotimer] > 0) + { + if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2 + || players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)) + && !(leveltime & 1))) + continue; + } + + K_drawKartMinimapHead(players[i].mo, x, y, splitflags, AutomapPic); + } + else + K_drawKartMinimapHead(players[i].mo, x, y, splitflags, AutomapPic); + } } static void K_drawKartStartCountdown(void) From 23f99bd28d0f295b402edf9df39aaf17513e9a5e Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 12 Jan 2019 12:27:30 +0100 Subject: [PATCH 5/7] Fixed WANTED poster drawing over minimap, WANTED cursor being colormapped, and splitscreen position shifting stuff --- src/k_kart.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 02c7e835..742681f8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6275,7 +6275,7 @@ static void K_initKartHUD(void) LAPS2_X = BASEVIDWIDTH-40; LAPS2_Y = (BASEVIDHEIGHT/2)-13; - POSI2_X = BASEVIDWIDTH -8; + POSI2_X = BASEVIDWIDTH -4; POSI2_Y = (BASEVIDHEIGHT/2)- 16; // Reminder that 3P and 4P are just 1P and 2P splitscreen'd to the bottom. @@ -6810,6 +6810,7 @@ static void K_DrawKartPositionNum(INT32 num) //INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); INT32 fx = 0, fy = 0, fflags = 0; boolean flipdraw = false; // flip the order we draw it in for MORE splitscreen bs. fun. + boolean flipvdraw = false; // used only for 2p splitscreen so overtaking doesn't make 1P's position fly off the screen. boolean overtake = false; if (stplyr->kartstuff[k_positiondelay] || stplyr->exiting) @@ -6830,6 +6831,8 @@ static void K_DrawKartPositionNum(INT32 num) { fy = 30; fflags = V_SNAPTOTOP|V_SNAPTORIGHT; + if (overtake) + flipvdraw = true; // make sure overtaking doesn't explode us } else // if we're not p1, that means we're p2. display this at the bottom right, below the minimap. { @@ -6901,8 +6904,9 @@ static void K_DrawKartPositionNum(INT32 num) else localpatch = kp_positionnum[num % 10][0]; - V_DrawFixedPatch((fx<width*scale/2) : 0), fy<width*scale/2) : 0), (fy<height*scale/2) : 0), scale, V_HUDTRANSHALF|fflags, localpatch, NULL); // ^ if we overtake as p1 or p3 in splitscren, we shift it so that it doesn't go off screen. + // ^ if we overtake as p1 in 2p splits, shift vertically so that this doesn't happen either. fx -= W; num /= 10; @@ -7530,7 +7534,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE); V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap); if (mo->player && K_IsPlayerWanted(mo->player)) - V_DrawFixedPatch(amxpos - (4< Date: Sat, 12 Jan 2019 12:28:15 +0100 Subject: [PATCH 6/7] Forgot to trim whitespace --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 742681f8..e5cff06b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8336,7 +8336,7 @@ void K_drawKartHUD(void) #endif K_drawKartWanted(); } - + if (cv_kartminimap.value && !titledemo) { #ifdef HAVE_BLUA From 5cd8691a719fe4e5a3f00c9cf14d3776a4938cae Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 15 Jan 2019 03:41:33 -0500 Subject: [PATCH 7/7] Don't draw multiple WANTED posters in splitscreen --- src/k_kart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index e5cff06b..0b280b7a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7334,6 +7334,9 @@ static void K_drawKartWanted(void) UINT8 *colormap = NULL; INT32 basex = 0, basey = 0; + if (stplyr != &players[displayplayer]) + return; + for (i = 0; i < 4; i++) { if (battlewanted[i] == -1)