From 970a8ee89dbc44d107e13c34768f4d9a145dbfed Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 6 Feb 2019 13:28:21 +0000 Subject: [PATCH 01/58] Fix off-by-one errors in item odds, and add a little assert to make an assumption in this function that was being violated more explicit. --- src/k_kart.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 49fd54e6..018519ca 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -616,7 +616,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) UINT8 pingame = 0, pexiting = 0, pinvin = 0; SINT8 first = -1, second = -1; INT32 secondist = 0; - boolean itemenabled[NUMKARTRESULTS] = { + boolean itemenabled[NUMKARTRESULTS-1] = { cv_sneaker.value, cv_rocketsneaker.value, cv_invincibility.value, @@ -640,7 +640,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) cv_dualjawz.value }; - if (!itemenabled[item] && !modeattacking) + I_Assert(item > KITEM_NONE); // too many off by one scenarioes. + + if (!itemenabled[item-1] && !modeattacking) return 0; if (G_BattleGametype()) @@ -761,7 +763,7 @@ static INT32 K_FindUseodds(player_t *player, fixed_t mashed, INT32 pingame, INT3 break; } - for (j = 0; j < NUMKARTRESULTS; j++) + for (j = 1; j < NUMKARTRESULTS; j++) { if (K_KartGetItemOdds(i, j, mashed) > 0) { From 1ba39672d4644acb760dd1682d6fa17ea0a46eb9 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sun, 10 Feb 2019 22:55:27 -0600 Subject: [PATCH 02/58] Fix drift sparks not generating on offroad with Hyudoro, Invincibility, or sneaker boosts --- 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 49fd54e6..3c9b082b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4708,7 +4708,7 @@ static void K_KartDrift(player_t *player, boolean onground) } // Disable drift-sparks until you're going fast enough - if (player->kartstuff[k_getsparks] == 0 || player->kartstuff[k_offroad]) + if (player->kartstuff[k_getsparks] == 0 || (player->kartstuff[k_offroad] && !player->kartstuff[k_invincibilitytimer] && !player->kartstuff[k_hyudorotimer] && !player->kartstuff[k_sneakertimer])) driftadditive = 0; if (player->speed > minspeed*2) player->kartstuff[k_getsparks] = 1; From 3a3dd42b896a7059eb39fc70b64effe2ddd77fca Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 13 Feb 2019 05:37:13 -0600 Subject: [PATCH 03/58] Add pogospring to itemenabled --- src/k_kart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/k_kart.c b/src/k_kart.c index 018519ca..8d2936d3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -631,6 +631,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) cv_shrink.value, cv_thundershield.value, cv_hyudoro.value, + cv_pogospring.value, cv_kitchensink.value, cv_triplesneaker.value, cv_triplebanana.value, From 6054901c62e3e0b472d5b8e80d6708ada15d15f9 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 15 Feb 2019 20:51:44 -0600 Subject: [PATCH 04/58] Ping kick changes + other quality of life improvements [REDO] --- src/d_clisrv.c | 43 +++++++++++++++++++++++++++++++++++++------ src/d_clisrv.h | 1 + src/d_netcmd.c | 10 ++++++++++ src/d_netcmd.h | 2 ++ src/hu_stuff.c | 28 ++++++++++++++++++++++++++-- src/m_menu.c | 20 ++++++++++++-------- 6 files changed, 88 insertions(+), 16 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 961c1e59..04816fd1 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -93,6 +93,7 @@ static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the UINT16 pingmeasurecount = 1; UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone. UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values. +tic_t servermaxping = 800; // server's max ping. Defaults to 800 #endif SINT8 nodetoplayer[MAXNETNODES]; SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen) @@ -4355,6 +4356,9 @@ FILESTAMP for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; + + servermaxping = (tic_t)netbuffer->u.pingtable[i++]; + CONS_Printf("got server maxping: %d\n", servermaxping); } break; @@ -4997,6 +5001,18 @@ void TryRunTics(tic_t realtics) } #ifdef NEWPING + +/* Ping Update except better: + We call this once per second and check for people's pings. If their ping happens to be too high, we increment some timer and kick them out. + If they're not lagging, decrement the timer by 1. Of course, reset all of this if they leave. + + Why do we do that? Well, I'm a person with unfortunately sometimes unstable internet and happen to keep getting kicked very unconveniently for very short high spikes. (700+ ms) + Because my spikes are so high, the average ping is exponentially higher too (700s really add up...!) which leads me to getting kicked for a short burst of spiking. + With this change here, this doesn't happen anymore as it checks if my ping has been CONSISTENTLY bad for long enough before killing me. +*/ + +static INT32 pingtimeout[MAXPLAYERS]; + static inline void PingUpdate(void) { INT32 i; @@ -5017,6 +5033,9 @@ static inline void PingUpdate(void) laggers[i] = true; numlaggers++; } + else + pingtimeout[i] = 0; + } //kick lagging players... unless everyone but the server's ping sucks. @@ -5027,12 +5046,21 @@ static inline void PingUpdate(void) { if (playeringame[i] && laggers[i]) { - XBOXSTATIC char buf[2]; + pingtimeout[i]++; + CONS_Printf("Player %d is lagging, incrementing timeout... %d/%d\n", i, pingtimeout[i], cv_pingtimeout.value); // debug print, don't forget to remove this... - buf[0] = (char)i; - buf[1] = KICK_MSG_PING_HIGH; - SendNetXCmd(XD_KICK, &buf, 2); + if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. + { + pingtimeout[i] = 0; + XBOXSTATIC char buf[2]; + + buf[0] = (char)i; + buf[1] = KICK_MSG_PING_HIGH; + SendNetXCmd(XD_KICK, &buf, 2); + } } + else // you aren't lagging, but you aren't free yet. In case you'll keep spiking, we just make the timer go back down. (Very unstable net must still get kicked). + pingtimeout[i] = (pingtimeout[i] == 0 ? 0 : pingtimeout[i]-1); } } } @@ -5047,10 +5075,13 @@ static inline void PingUpdate(void) realpingtable[i] = 0; //Reset each as we go. } + // send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked. + netbuffer->u.pingtable[i++] = cv_maxping.value; + //send out our ping packets for (i = 0; i < MAXNETNODES; i++) if (nodeingame[i]) - HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS); + HSendPacket(i, true, 0, sizeof(INT32) * (MAXPLAYERS+1)); pingmeasurecount = 1; //Reset count } @@ -5064,7 +5095,7 @@ static void UpdatePingTable(void) INT32 i; if (server) { - if (netgame && !(gametime % 255)) + if (netgame && !(gametime % 35)) // update once per second. PingUpdate(); // update node latency values so we can take an average later. for (i = 0; i < MAXPLAYERS; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 62bd8bc1..04569198 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -519,6 +519,7 @@ extern tic_t jointimeout; extern UINT16 pingmeasurecount; extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; +extern tic_t servermaxping; #endif extern consvar_t diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 438cdcd5..ce54960d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -435,6 +435,14 @@ consvar_t cv_jointimeout = {"jointimeout", "105", CV_CALL|CV_SAVE, nettimeout_co #ifdef NEWPING static CV_PossibleValue_t maxping_cons_t[] = {{0, "MIN"}, {1000, "MAX"}, {0, NULL}}; consvar_t cv_maxping = {"maxping", "800", CV_SAVE, maxping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}}; +consvar_t cv_pingtimeout = {"pingtimeout", "15", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) +static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; +consvar_t cv_showping = {"showping", "Warning", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + #endif // Intermission time Tails 04-19-2002 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; @@ -664,6 +672,8 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_sleep); #ifdef NEWPING CV_RegisterVar(&cv_maxping); + CV_RegisterVar(&cv_pingtimeout); + CV_RegisterVar(&cv_showping); #endif #ifdef SEENAMES diff --git a/src/d_netcmd.h b/src/d_netcmd.h index c590eee6..54c00484 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -145,6 +145,8 @@ extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionb #ifdef NEWPING extern consvar_t cv_maxping; +extern consvar_t cv_pingtimeout; +extern consvar_t cv_showping; #endif extern consvar_t cv_skipmapcheck; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3d8f2383..216d14b0 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2178,6 +2178,22 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans< servermaxping)) // only show 2 (warning) if our ping is at a bad level + { + INT32 dispx = cv_ticrate.value ? 260 : 290; + HU_drawPing(dispx, 190, ping, false); + } +} + // Heads up displays drawer, call each frame // void HU_Drawer(void) @@ -2290,6 +2306,9 @@ void HU_Drawer(void) V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); } + + // draw the ping if the user wishes to + HU_drawLocalPing(); } //====================================================================== @@ -2376,6 +2395,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) SINT8 i = 0; SINT8 yoffset = 6; INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); + boolean highping = (servermaxping && ping > servermaxping) ? true : false; if (ping < 128) { @@ -2387,13 +2407,17 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. barcolor = 103; } + else if (highping) // yikes...! + { + numbars = 0; + } if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. - V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); + V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|((highping && hu_tick < 4) ? V_REDMAP : 0), va("%dms", ping)); for (i=0; (i<3); i++) // Draw the ping bar { - V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31); + V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, (highping && hu_tick < 4) ? 128 : 31); if (i < numbars) V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); diff --git a/src/m_menu.c b/src/m_menu.c index d8b1c2d7..966f4fa7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1390,7 +1390,7 @@ static menuitem_t OP_HUDOptionsMenu[] = {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Visibility", &cv_translucenthud, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Online chat options...",&OP_ChatOptionsDef, 35}, + {IT_STRING | IT_SUBMENU, NULL, "Online HUD options...",&OP_ChatOptionsDef, 35}, {IT_STRING | IT_CVAR, NULL, "Background Glass", &cons_backcolor, 45}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, @@ -1404,6 +1404,7 @@ static menuitem_t OP_HUDOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 120}, }; +// Ok it's still called chatoptions but we'll put ping display in here to be clean static menuitem_t OP_ChatOptionsMenu[] = { // will ANYONE who doesn't know how to use the console want to touch this one? @@ -1417,6 +1418,8 @@ static menuitem_t OP_ChatOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 50}, {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 60}, {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 70}, + + {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 90}, // shows ping next to framerate if we want to. }; static menuitem_t OP_GameOptionsMenu[] = @@ -1469,15 +1472,16 @@ static menuitem_t OP_AdvServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 40}, {IT_STRING | IT_CVAR, NULL, "Ping limit (ms)", &cv_maxping, 50}, - {IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 60}, - {IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 70}, + {IT_STRING | IT_CVAR, NULL, "Ping timeout (s)", &cv_pingtimeout, 60}, + {IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 70}, + {IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 80}, - {IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 90}, - {IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 100}, + {IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 100}, + {IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 110}, - {IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 120}, - {IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 130}, - {IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 140}, + {IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 130}, + {IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 140}, + {IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 150}, }; #endif From 3349b9b196b6612c388ce65d11a1b1c4681bcaf4 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Fri, 15 Feb 2019 03:12:08 +0100 Subject: [PATCH 05/58] forgot to remove this print --- src/d_clisrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 04816fd1..cb02bf83 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4358,7 +4358,6 @@ FILESTAMP playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; servermaxping = (tic_t)netbuffer->u.pingtable[i++]; - CONS_Printf("got server maxping: %d\n", servermaxping); } break; From 07e56e550e9f203998d02d5a59906337de8ec01f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 15 Feb 2019 21:08:08 -0600 Subject: [PATCH 06/58] New visuals for ping and fps display alike [REDO] --- src/d_main.c | 2 +- src/hu_stuff.c | 73 ++++++++++++++++++++++++++---------------------- src/hu_stuff.h | 6 +++- src/k_kart.c | 3 +- src/lua_hudlib.c | 19 +++++++++++++ src/screen.c | 20 +++++++++---- src/v_video.c | 22 +++++++++++++++ src/v_video.h | 4 +++ 8 files changed, 107 insertions(+), 42 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5cf95f4b..b35296aa 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -932,7 +932,7 @@ static void IdentifyVersion(void) D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); #ifdef USE_PATCH_KART - D_AddFile(va(pandf,srb2waddir,"patch.kart")); + D_AddFile(va(pandf,srb2waddir,"patchping.kart")); // also don't forget to change that, this is to avoid conflicting with our regular patch.kart #endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 216d14b0..7e9f703d 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -74,6 +74,14 @@ patch_t *nightsnum[10]; // 0-9 patch_t *lt_font[LT_FONTSIZE]; patch_t *cred_font[CRED_FONTSIZE]; +// ping font +// Note: I'd like to adress that at this point we might *REALLY* want to work towards a common drawString function that can take any font we want because this is really turning into a MESS. :V -Lat' +patch_t *pingnum[10]; +patch_t *pinggfx[5]; // small ping graphic + +patch_t *framecounter; +patch_t *frameslash; // framerate stuff. Used in screen.c + static player_t *plr; boolean chat_on; // entering a chat message? static char w_chat[HU_MAXMSGLEN]; @@ -263,6 +271,8 @@ void HU_LoadGraphics(void) tallnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); sprintf(buffer, "NGTNUM%d", i); nightsnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); + sprintf(buffer, "PINGN%d", i); + pingnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); } // minus for negative tallnums @@ -295,6 +305,17 @@ void HU_LoadGraphics(void) tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX); songcreditbg = W_CachePatchName("K_SONGCR", PU_HUDGFX); + + // cache ping gfx: + for (i = 0; i < 5; i++) + { + sprintf(buffer, "PINGGFX%d", i+1); + pinggfx[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); + } + + // fps stuff + framecounter = W_CachePatchName("FRAMER", PU_HUDGFX); + frameslash = W_CachePatchName("FRAMESL", PU_HUDGFX);; } // Initialise Heads up @@ -2183,14 +2204,14 @@ static void HU_DrawSongCredits(void) void HU_drawLocalPing(void) { - if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server + if (!cv_showping.value || !netgame || consoleplayer != serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level { - INT32 dispx = cv_ticrate.value ? 260 : 290; - HU_drawPing(dispx, 190, ping, false); + INT32 dispy = cv_ticrate.value ? 160 : 181; + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT|V_SNAPTOBOTTOM); } } @@ -2388,41 +2409,25 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) +void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags) { - UINT8 numbars = 1; // how many ping bars do we draw? - UINT8 barcolor = 128; // color we use for the bars (green, yellow or red) - SINT8 i = 0; - SINT8 yoffset = 6; - INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); - boolean highping = (servermaxping && ping > servermaxping) ? true : false; + INT32 gfxnum = 4; // gfx to draw + UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); - if (ping < 128) - { - numbars = 3; - barcolor = 184; - } + if (ping < 76) + gfxnum = 0; + else if (ping < 137) + gfxnum = 1; else if (ping < 256) - { - numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. - barcolor = 103; - } - else if (highping) // yikes...! - { - numbars = 0; - } + gfxnum = 2; + else if (ping < 500) + gfxnum = 3; - if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. - V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|((highping && hu_tick < 4) ? V_REDMAP : 0), va("%dms", ping)); - - for (i=0; (i<3); i++) // Draw the ping bar - { - V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, (highping && hu_tick < 4) ? 128 : 31); - if (i < numbars) - V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); - - yoffset -= 2; - } + V_DrawScaledPatch(x, y, flags, pinggfx[gfxnum]); + if (servermaxping && ping > servermaxping && hu_tick < 4) // flash ping red if too high + V_DrawPingNum(x, y+9, flags, ping, colormap); + else + V_DrawPingNum(x, y+9, flags, ping, NULL); } // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index f1ecb2ff..0c94034d 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -80,7 +80,11 @@ extern boolean chat_on; extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart extern patch_t *tallnum[10]; +extern patch_t *pingnum[10]; +extern patch_t *pinggfx[5]; extern patch_t *nightsnum[10]; +extern patch_t *framecounter; +extern patch_t *frameslash; extern patch_t *lt_font[LT_FONTSIZE]; extern patch_t *cred_font[CRED_FONTSIZE]; extern patch_t *emeraldpics[7]; @@ -109,7 +113,7 @@ void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. //void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); //void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol); diff --git a/src/k_kart.c b/src/k_kart.c index 8d2936d3..ad6da417 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4682,6 +4682,7 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_driftend] = 0; } + // Incease/decrease the drift value to continue drifting in that direction if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0) { @@ -7168,7 +7169,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (netgame // don't draw it offline && tab[i].num != serverplayer) - HU_drawPing(x + ((i < 8) ? -19 : rightoffset + 13), y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[tab[i].num], 0); STRBUFCPY(strtime, tab[i].name); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index cd8e0392..fb6814b2 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -410,6 +410,24 @@ static int libd_drawPaddedNum(lua_State *L) return 0; } + +static int libd_drawPingNum(lua_State *L) +{ + INT32 x, y, flags, num; + const UINT8 *colormap = NULL; + HUDONLY + x = luaL_checkinteger(L, 1); + y = luaL_checkinteger(L, 2); + num = luaL_checkinteger(L, 3); + flags = luaL_optinteger(L, 4, 0); + flags &= ~V_PARAMMASK; // Don't let crashes happen. + if (!lua_isnoneornil(L, 5)) + colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP)); + + V_DrawPingNum(x, y, flags, num, colormap); + return 0; +} + static int libd_drawFill(lua_State *L) { INT32 x = luaL_optinteger(L, 1, 0); @@ -613,6 +631,7 @@ static luaL_Reg lib_draw[] = { {"drawScaled", libd_drawScaled}, {"drawNum", libd_drawNum}, {"drawPaddedNum", libd_drawPaddedNum}, + {"drawPingNum", libd_drawPingNum}, {"drawFill", libd_drawFill}, {"fadeScreen", libd_fadeScreen}, {"drawString", libd_drawString}, diff --git a/src/screen.c b/src/screen.c index af6aed03..937d6caa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -403,7 +403,7 @@ void SCR_DisplayTicRate(void) tic_t i; tic_t ontic = I_GetTime(); tic_t totaltics = 0; - INT32 ticcntcolor = 0; + const UINT8 *ticcntcolor = NULL; for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i) fpsgraph[i % TICRATE] = false; @@ -414,13 +414,23 @@ void SCR_DisplayTicRate(void) if (fpsgraph[i]) ++totaltics; - if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP; - else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; + if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); + else if (totaltics == TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE); - V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy), + /*V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy), V_YELLOWMAP|V_NOSCALESTART, "FPS"); V_DrawString(vid.width-(40*vid.dupx), vid.height-( 8*vid.dupy), - ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE)); + ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));*/ + + // draw "FPS" + V_DrawFixedPatch(306<width); // this SHOULD always be 5 but I guess custom graphics exist. + + if (flags & V_NOSCALESTART) + w *= vid.dupx; + + if (num < 0) + num = -num; + + // draw the number + do + { + x -= (w-1); // Oni wanted their outline to intersect. + V_DrawFixedPatch(x< Date: Fri, 15 Feb 2019 22:30:13 +0100 Subject: [PATCH 07/58] Forgot to change this back from testing --- src/hu_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 7e9f703d..63673740 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2204,7 +2204,7 @@ static void HU_DrawSongCredits(void) void HU_drawLocalPing(void) { - if (!cv_showping.value || !netgame || consoleplayer != serverplayer) // we don't want to see it or aren't in a netgame, or are the server + if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P From 95bbb0d833002dce797779a15fe3998c7ef4dd99 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 02:40:55 +0100 Subject: [PATCH 08/58] Remove debug stuff --- src/d_clisrv.c | 2 -- src/d_main.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index cb02bf83..b5de6896 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5046,8 +5046,6 @@ static inline void PingUpdate(void) if (playeringame[i] && laggers[i]) { pingtimeout[i]++; - CONS_Printf("Player %d is lagging, incrementing timeout... %d/%d\n", i, pingtimeout[i], cv_pingtimeout.value); // debug print, don't forget to remove this... - if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { pingtimeout[i] = 0; diff --git a/src/d_main.c b/src/d_main.c index b35296aa..5cf95f4b 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -932,7 +932,7 @@ static void IdentifyVersion(void) D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); #ifdef USE_PATCH_KART - D_AddFile(va(pandf,srb2waddir,"patchping.kart")); // also don't forget to change that, this is to avoid conflicting with our regular patch.kart + D_AddFile(va(pandf,srb2waddir,"patch.kart")); #endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) From a119d1cddd24215148575773fc06bb5b5bf1af02 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 12:19:03 +0100 Subject: [PATCH 09/58] Lower default ping timeout + Fix chat arrows being missing while we're at it --- src/d_netcmd.c | 2 +- src/hu_stuff.c | 4 ++-- src/v_video.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ce54960d..53d88f2f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -437,7 +437,7 @@ static CV_PossibleValue_t maxping_cons_t[] = {{0, "MIN"}, {1000, "MAX"}, {0, NUL consvar_t cv_maxping = {"maxping", "800", CV_SAVE, maxping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}}; -consvar_t cv_pingtimeout = {"pingtimeout", "15", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_pingtimeout = {"pingtimeout", "10", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 63673740..3bc28c17 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1633,9 +1633,9 @@ static void HU_drawChatLog(INT32 offset) // draw arrows to indicate that we can (or not) scroll. if (chat_scroll > 0) - V_DrawThinString(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1A"); // up arrow + V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1A', false); // up arrow if (chat_scroll < chat_maxscroll) - V_DrawThinString(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1B"); // down arrow + V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1B', false); // down arrow justscrolleddown = false; justscrolledup = false; diff --git a/src/v_video.c b/src/v_video.c index 7cbcd99a..473adeed 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1342,8 +1342,8 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed) V_DrawScaledPatch(x, y, flags, hu_font[c]); } -// Writes a single character for the chat. (draw WHITE if bit 7 set) -// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge.. +// Writes a single character for the chat (half scaled). (draw WHITE if bit 7 set) +// 16/02/19: Scratch the scaling thing, chat doesn't work anymore under 2x res -Lat' // void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap) { @@ -1359,13 +1359,11 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) return; - w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. + w = SHORT(hu_font[c]->width)/2; if (x + w > vid.width) return; - V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap); - - + V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/2, flags, hu_font[c], colormap); } // Precompile a wordwrapped string to any given width. From c370a86f4855b2125b26c67bd96b527f0f5f3b75 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 16 Feb 2019 06:37:09 -0600 Subject: [PATCH 10/58] Set flashing tics to 0 after boosting --- src/k_kart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index a811cce4..684b2039 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3265,6 +3265,8 @@ void K_DoSneaker(player_t *player, INT32 type) player->pflags |= PF_ATTACKDOWN; K_PlayBoostTaunt(player->mo); } + + player->powers[pw_flashing] = 0; // Stop flashing after boosting } static void K_DoShrink(player_t *user) From 24516cbf8440b7534602292073a2093997be7910 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 13:38:50 +0100 Subject: [PATCH 11/58] Move ping display in i_video for consistency with showfps display --- src/djgppdos/i_video.c | 5 +++++ src/hu_stuff.c | 3 ++- src/sdl/i_video.c | 7 ++++++- src/sdl12/i_video.c | 5 +++++ src/win32/win_vid.c | 5 +++++ src/win32ce/win_vid.c | 5 +++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c7221..69addfb0 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -41,6 +41,7 @@ #include "../m_argv.h" #include "vid_vesa.h" #include "../i_video.h" +#include "../hu_stuff.h" //dosstuff -newly added @@ -93,6 +94,10 @@ void I_FinishUpdate (void) // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); //blast it to the screen // this code sucks diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3bc28c17..404b4509 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2329,7 +2329,8 @@ void HU_Drawer(void) } // draw the ping if the user wishes to - HU_drawLocalPing(); + // THIS IS NOW HANDLED IN I_VIDEO + //HU_drawLocalPing(); } //====================================================================== diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2a77604d..9e5e4b60 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -64,9 +64,10 @@ #include "../m_menu.h" #include "../d_main.h" #include "../s_sound.h" -#include "../i_sound.h" // midi pause/unpause +#include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" +#include "../hu_stuff.h" // ping drawer #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1360,6 +1361,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); if (rendermode == render_soft && screens[0]) { diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 69cf5ca9..08e6bd94 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -99,6 +99,7 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1342,6 +1343,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); if (render_soft == rendermode && screens[0]) { diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 9f3d13f8..cba0c209 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -28,6 +28,7 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -365,6 +366,10 @@ void I_FinishUpdate(void) // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); // if (bDIBMode) diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 5e8e7e1f..c6610fa0 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -26,6 +26,7 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -198,6 +199,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); + // if (bDIBMode) { From 76893f4644f84b790064f7e97c667f215ea6298c Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 16 Feb 2019 07:03:56 -0600 Subject: [PATCH 12/58] Don't kill flashing tics for floor boosts --- src/k_kart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 684b2039..2b06e1d3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3264,9 +3264,8 @@ void K_DoSneaker(player_t *player, INT32 type) { player->pflags |= PF_ATTACKDOWN; K_PlayBoostTaunt(player->mo); + player->powers[pw_flashing] = 0; // Stop flashing after boosting } - - player->powers[pw_flashing] = 0; // Stop flashing after boosting } static void K_DoShrink(player_t *user) From 82dbf45fa489881a5a0c6ff506bd7c9581efdbce Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 16 Feb 2019 08:29:48 -0600 Subject: [PATCH 13/58] Fix compiler warnings --- src/hu_stuff.c | 4 ++-- src/hu_stuff.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 404b4509..175c8bf3 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2207,7 +2207,7 @@ void HU_drawLocalPing(void) if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; - INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level { INT32 dispy = cv_ticrate.value ? 160 : 181; @@ -2410,7 +2410,7 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags) +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags) { INT32 gfxnum = 4; // gfx to draw UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 0c94034d..6788c701 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -109,11 +109,12 @@ void HU_Start(void); boolean HU_Responder(event_t *ev); void HU_Ticker(void); +void HU_drawLocalPing(void); void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. //void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); //void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol); From e2b392805aab55942a1069a30bf18bbacfbc8281 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Feb 2019 10:33:18 -0600 Subject: [PATCH 14/58] Simulate fractional precision on item odds This notably prevents some items from disappearing completely above 8 players in netgames. --- src/k_kart.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b006ae3b..a398fa01 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -651,6 +651,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) else newodds = K_KartItemOddsRace[item-1][pos]; + // Base multiplication to ALL item odds to simulate fractional precision + newodds *= 4; + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) @@ -867,8 +870,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) UINT8 pingame = 0; UINT8 roulettestop; INT32 useodds = 0; - INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS]; - INT32 chance = 0, numchoices = 0; + INT32 spawnchance[NUMKARTRESULTS]; + INT32 totalspawnchance = 0; INT32 bestbumper = 0; fixed_t mashed = 0; boolean dontforcespb = false; @@ -965,24 +968,23 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) } // Initializes existing spawnchance values - for (i = 0; i < (NUMKARTRESULTS * NUMKARTODDS); i++) + for (i = 0; i < NUMKARTRESULTS; i++) spawnchance[i] = 0; // Split into another function for a debug function below useodds = K_FindUseodds(player, mashed, pingame, bestbumper, (spbplace != -1 && player->kartstuff[k_position] == spbplace+1), dontforcespb); -#define SETITEMRESULT(itemnum) \ - for (chance = 0; chance < K_KartGetItemOdds(useodds, itemnum, mashed); chance++) \ - spawnchance[numchoices++] = itemnum - for (i = 1; i < NUMKARTRESULTS; i++) - SETITEMRESULT(i); - -#undef SETITEMRESULT + spawnchance[i] = (totalspawnchance += K_KartGetItemOdds(useodds, i, mashed)); // Award the player whatever power is rolled - if (numchoices > 0) - K_KartGetItemResult(player, spawnchance[P_RandomKey(numchoices)]); + if (totalspawnchance > 0) + { + totalspawnchance = P_RandomKey(totalspawnchance); + for (i = 0; i < NUMKARTRESULTS && spawnchance[i] <= totalspawnchance; i++); + + K_KartGetItemResult(player, i); + } else { player->kartstuff[k_itemtype] = KITEM_SAD; From 1785adffc2ea1e755b9cb120c6415e660ccf3eb9 Mon Sep 17 00:00:00 2001 From: james Date: Sat, 16 Feb 2019 23:25:50 -0800 Subject: [PATCH 15/58] Expose splitscreenplayer (from Got_AddPlayer) as splitscreen in player_t --- src/d_clisrv.c | 6 ++++++ src/d_clisrv.h | 2 ++ src/d_player.h | 2 ++ src/g_game.c | 3 +++ src/lua_playerlib.c | 4 ++++ src/p_saveg.c | 4 ++++ 6 files changed, 21 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7516df2e..0aec7fd9 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -648,6 +648,8 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->jointime = (tic_t)LONG(players[i].jointime); + rsp->splitscreen = players[i].splitscreen; + rsp->hasmo = false; //Transfer important mo information if the player has a body. //This lets us resync players even if they are dead. @@ -783,6 +785,8 @@ static void resynch_read_player(resynch_pak *rsp) players[i].jointime = (tic_t)LONG(rsp->jointime); + players[i].splitscreen = rsp->splitscreen; + //We get a packet for each player in game. if (!playeringame[i]) return; @@ -3316,6 +3320,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) addedtogame = true; } + players[newplayernum].splitscreen = splitscreenplayer; + if (netgame) { if (server && cv_showjoinaddress.value) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 62bd8bc1..b628606d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -283,6 +283,8 @@ typedef struct tic_t jointime; + UINT8 splitscreen; + //player->mo stuff UINT8 hasmo; // Boolean diff --git a/src/d_player.h b/src/d_player.h index b430f20a..baed9a72 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -571,6 +571,8 @@ typedef struct player_s UINT8 bot; tic_t jointime; // Timer when player joins game to change skin/color + + UINT8 splitscreen; #ifdef HWRENDER fixed_t fovadd; // adjust FOV for hw rendering #endif diff --git a/src/g_game.c b/src/g_game.c index f0d221ff..eb0396c8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2357,6 +2357,7 @@ void G_PlayerReborn(INT32 player) UINT8 skincolor; INT32 skin; tic_t jointime; + UINT8 psplitscreen; boolean spectator; INT16 bot; SINT8 pity; @@ -2380,6 +2381,7 @@ void G_PlayerReborn(INT32 player) ctfteam = players[player].ctfteam; exiting = players[player].exiting; jointime = players[player].jointime; + psplitscreen = players[player].splitscreen; spectator = players[player].spectator; pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN)); @@ -2476,6 +2478,7 @@ void G_PlayerReborn(INT32 player) p->pflags = pflags; p->ctfteam = ctfteam; p->jointime = jointime; + p->splitscreen = psplitscreen; p->spectator = spectator; // save player config truth reborn diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 5f136fc1..0bea1e7b 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -325,6 +325,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->bot); else if (fastcmp(field,"jointime")) lua_pushinteger(L, plr->jointime); + else if (fastcmp(field,"splitscreen")) + lua_pushinteger(L, plr->splitscreen); #ifdef HWRENDER else if (fastcmp(field,"fovadd")) lua_pushfixed(L, plr->fovadd); @@ -613,6 +615,8 @@ static int player_set(lua_State *L) return NOSET; else if (fastcmp(field,"jointime")) plr->jointime = (tic_t)luaL_checkinteger(L, 3); + else if (fastcmp(field,"splitscreen")) + return NOSET; #ifdef HWRENDER else if (fastcmp(field,"fovadd")) plr->fovadd = luaL_checkfixed(L, 3); diff --git a/src/p_saveg.c b/src/p_saveg.c index 975a4a5d..a2ae8f17 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -249,6 +249,8 @@ static void P_NetArchivePlayers(void) WRITEUINT32(save_p, players[i].jointime); + WRITEUINT8(save_p, players[i].splitscreen); + WRITEUINT16(save_p, flags); if (flags & CAPSULE) @@ -426,6 +428,8 @@ static void P_NetUnArchivePlayers(void) players[i].jointime = READUINT32(save_p); + players[i].splitscreen = READUINT8(save_p); + flags = READUINT16(save_p); if (flags & CAPSULE) From 6f3b10313fae85b0b40914c0a1c85df231866c47 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 17 Feb 2019 22:09:37 -0600 Subject: [PATCH 16/58] Add some P_MobjWasRemoved checks around code that shrink touches It's the only place in the vanilla game where K_DropItems is called that isn't from a direct collision with the player it's being called on. It's also a syncfail that doesn't happen anywhere else, and I saw my sync state appear to get slightly corrupted when it happened. Let's see if this fixes anything... --- src/k_kart.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b006ae3b..2c913e10 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1978,12 +1978,16 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto static void K_RemoveGrowShrink(player_t *player) { player->kartstuff[k_growshrinktimer] = 0; - if (player->kartstuff[k_invincibilitytimer] == 0) - player->mo->color = player->skincolor; - player->mo->scalespeed = mapobjectscale/TICRATE; - player->mo->destscale = mapobjectscale; - if (cv_kartdebugshrink.value && !modeattacking && !player->bot) - player->mo->destscale = (6*player->mo->destscale)/8; + + if (!P_MobjWasRemoved(player->mo)) + { + if (player->kartstuff[k_invincibilitytimer] == 0) + player->mo->color = player->skincolor; + player->mo->scalespeed = mapobjectscale/TICRATE; + player->mo->destscale = mapobjectscale; + if (cv_kartdebugshrink.value && !modeattacking && !player->bot) + player->mo->destscale = (6*player->mo->destscale)/8; + } P_RestoreMusic(player); } @@ -3290,11 +3294,15 @@ static void K_DoShrink(player_t *user) { // Start shrinking! K_DropItems(&players[i]); - players[i].mo->scalespeed = mapobjectscale/TICRATE; - players[i].mo->destscale = (6*mapobjectscale)/8; - if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot) - players[i].mo->destscale = (6*players[i].mo->destscale)/8; - players[i].kartstuff[k_growshrinktimer] = -(200+(40*(MAXPLAYERS-players[i].kartstuff[k_position]))); + + if (!P_MobjWasRemoved(players[i].mo)) + { + players[i].mo->scalespeed = mapobjectscale/TICRATE; + players[i].mo->destscale = (6*mapobjectscale)/8; + if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot) + players[i].mo->destscale = (6*players[i].mo->destscale)/8; + players[i].kartstuff[k_growshrinktimer] = -(200+(40*(MAXPLAYERS-players[i].kartstuff[k_position]))); + } } // Grow should get taken away. @@ -3419,7 +3427,7 @@ void K_DropHnextList(player_t *player) mobjtype_t type; boolean orbit, ponground, dropall = true; - if (!work) + if (!work || P_MobjWasRemoved(work)) return; flip = P_MobjFlip(player->mo); @@ -3556,7 +3564,7 @@ void K_DropItems(player_t *player) K_DropHnextList(player); - if (player->mo && player->kartstuff[k_itemamount]) + if (player->mo && !P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount]) { mobj_t *drop = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FLOATINGITEM); P_SetScale(drop, drop->scale>>4); From f39bd03e10523a0d25bfbfefcfcf31c4377bad95 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 18 Feb 2019 00:58:08 -0500 Subject: [PATCH 17/58] Add command to ban an IP address. --- src/d_clisrv.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7516df2e..7be04682 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2756,6 +2756,32 @@ static void Command_Ban(void) } +static void Command_BanIP(void) +{ + if (COM_Argc() < 2) + { + CONS_Printf(M_GetText("banip : ban an ip address\n")); + return; + } + + if (server) // Only the server can use this, otherwise does nothing. + { + const char *address = (COM_Argv(1)); + const char *reason = (COM_Argv(2)); + + if (I_SetBanAddress && I_SetBanAddress(address, NULL)) + { + CONS_Printf("Banned ip address for:%s\n", reason); + Ban_Add(reason); + D_SaveBan(); + } + else + { + return; + } + } +} + static void Command_Kick(void) { if (COM_Argc() < 2) @@ -3062,6 +3088,7 @@ void D_ClientServerInit(void) COM_AddCommand("getplayernum", Command_GetPlayerNum); COM_AddCommand("kick", Command_Kick); COM_AddCommand("ban", Command_Ban); + COM_AddCommand("banip", Command_BanIP); COM_AddCommand("clearbans", Command_ClearBans); COM_AddCommand("showbanlist", Command_ShowBan); COM_AddCommand("reloadbans", Command_ReloadBan); From 69156054448f628ac1ed19bba4aa74e1f1627d29 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 18 Feb 2019 01:03:39 -0500 Subject: [PATCH 18/58] Save ban list right after banning. --- src/d_clisrv.c | 3 +++ src/djgppdos/i_system.c | 3 --- src/sdl/i_system.c | 3 --- src/sdl12/i_system.c | 3 --- src/win32/win_sys.c | 3 --- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7be04682..5ad2e92a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2725,7 +2725,10 @@ static void Command_Ban(void) else { if (server) // only the server is allowed to do this right now + { Ban_Add(COM_Argv(2)); + D_SaveBan(); // save the ban list + } if (COM_Argc() == 2) { diff --git a/src/djgppdos/i_system.c b/src/djgppdos/i_system.c index bc3c8b2b..5970f5ae 100644 --- a/src/djgppdos/i_system.c +++ b/src/djgppdos/i_system.c @@ -615,9 +615,6 @@ void I_Quit (void) //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. M_SaveConfig (NULL); //save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif G_SaveGameData(); // Tails 12-08-2002 if (demorecording) G_CheckDemoStatus(); diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index f360072a..6d72d9bb 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3054,9 +3054,6 @@ void I_Quit(void) quiting = SDL_FALSE; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif G_SaveGameData(false); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. diff --git a/src/sdl12/i_system.c b/src/sdl12/i_system.c index d055a4ca..a841860f 100644 --- a/src/sdl12/i_system.c +++ b/src/sdl12/i_system.c @@ -2975,9 +2975,6 @@ void I_Quit(void) quiting = SDL_FALSE; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif G_SaveGameData(); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c index fa9d6d64..47250334 100644 --- a/src/win32/win_sys.c +++ b/src/win32/win_sys.c @@ -639,9 +639,6 @@ void I_Error(const char *error, ...) if (!errorcount) { M_SaveConfig(NULL); // save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif G_SaveGameData(); } From a2316389d2a169815181c98132d9b98262cc9c80 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 18 Feb 2019 02:04:58 -0500 Subject: [PATCH 19/58] Save when quitting the game. Also use default reason if not custom reason is given. --- src/d_clisrv.c | 14 ++++++++++++-- src/djgppdos/i_system.c | 3 +++ src/sdl/i_system.c | 3 +++ src/sdl12/i_system.c | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 5ad2e92a..ea8077d6 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2770,11 +2770,21 @@ static void Command_BanIP(void) if (server) // Only the server can use this, otherwise does nothing. { const char *address = (COM_Argv(1)); - const char *reason = (COM_Argv(2)); + const char *reason; + + if (COM_Argc() == 2) + reason = NULL; + else + reason = COM_Argv(2); + if (I_SetBanAddress && I_SetBanAddress(address, NULL)) { - CONS_Printf("Banned ip address for:%s\n", reason); + if (reason) + CONS_Printf("Banned ip address %s for: %s\n", address, reason); + else + CONS_Printf("Banned ip address %s\n", address); + Ban_Add(reason); D_SaveBan(); } diff --git a/src/djgppdos/i_system.c b/src/djgppdos/i_system.c index 5970f5ae..bc3c8b2b 100644 --- a/src/djgppdos/i_system.c +++ b/src/djgppdos/i_system.c @@ -615,6 +615,9 @@ void I_Quit (void) //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. M_SaveConfig (NULL); //save game config, cvars.. +#ifndef NONET + D_SaveBan(); // save the ban list +#endif G_SaveGameData(); // Tails 12-08-2002 if (demorecording) G_CheckDemoStatus(); diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 6d72d9bb..f360072a 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3054,6 +3054,9 @@ void I_Quit(void) quiting = SDL_FALSE; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. +#ifndef NONET + D_SaveBan(); // save the ban list +#endif G_SaveGameData(false); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. diff --git a/src/sdl12/i_system.c b/src/sdl12/i_system.c index a841860f..d055a4ca 100644 --- a/src/sdl12/i_system.c +++ b/src/sdl12/i_system.c @@ -2975,6 +2975,9 @@ void I_Quit(void) quiting = SDL_FALSE; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. +#ifndef NONET + D_SaveBan(); // save the ban list +#endif G_SaveGameData(); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. From 86a9168e86ceeaad711eb57880f9f518f684835c Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Mon, 18 Feb 2019 22:19:28 +0100 Subject: [PATCH 20/58] Fix dedicated server extra lua variables not being synched for joiners --- src/lua_script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 1f87d33e..28f02ca3 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1020,7 +1020,7 @@ void LUA_Archive(void) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i]) + if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs. continue; // all players in game will be archived, even if they just add a 0. ArchiveExtVars(&players[i], "player"); @@ -1056,7 +1056,7 @@ void LUA_UnArchive(void) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i]) + if (!playeringame[i] && i > 0) // same here, this is to synch dediservs properly. continue; UnArchiveExtVars(&players[i]); } From 9eb669a061736e959ed42481a2d7abd1d6cd7862 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 18 Feb 2019 21:08:11 -0600 Subject: [PATCH 21/58] Crash fix I think (CHERRY PICK INTO BASE) --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 135ae6a2..52c92b02 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -651,7 +651,7 @@ void R_DrawMaskedColumn(column_t *column) basetexturemid = dc_texturemid; - for (; column->topdelta != 0xff ;) + for (; column && column->topdelta != 0xff ;) { // calculate unclipped screen coordinates // for post From a4ac2b000fcd8b0094e08317c58adb4197e6f268 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Feb 2019 11:52:35 -0600 Subject: [PATCH 22/58] Improve replay resyncing code Notably, it should no longer cause immediate desync warnings if a track starts on a slope. --- src/g_game.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index f0d221ff..a7b9670c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4763,7 +4763,8 @@ void G_WriteGhostTic(mobj_t *ghost) // GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic. if (abs(ghost->x-oldghost.x) > MAXMOM || abs(ghost->y-oldghost.y) > MAXMOM - || abs(ghost->z-oldghost.z) > MAXMOM) + || abs(ghost->z-oldghost.z) > MAXMOM + || leveltime & 255 == 1) // Hack to enable slightly nicer resyncing { oldghost.x = ghost->x; oldghost.y = ghost->y; @@ -4777,8 +4778,8 @@ void G_WriteGhostTic(mobj_t *ghost) { // For moving normally: // Store one full byte of movement, plus one byte of fractional movement. - INT16 momx = (INT16)((ghost->x-oldghost.x)>>8); - INT16 momy = (INT16)((ghost->y-oldghost.y)>>8); + INT16 momx = (INT16)((ghost->x-oldghost.x + (1<<4))>>8); + INT16 momy = (INT16)((ghost->y-oldghost.y + (1<<4))>>8); if (momx != oldghost.momx || momy != oldghost.momy) { @@ -4788,7 +4789,7 @@ void G_WriteGhostTic(mobj_t *ghost) WRITEINT16(demo_p,momx); WRITEINT16(demo_p,momy); } - momx = (INT16)((ghost->z-oldghost.z)>>8); + momx = (INT16)((ghost->z-oldghost.z + (1<<4))>>8); if (momx != oldghost.momz) { oldghost.momz = momx; @@ -4892,8 +4893,9 @@ void G_WriteGhostTic(mobj_t *ghost) void G_ConsGhostTic(void) { UINT8 ziptic; - UINT16 px,py,pz,gx,gy,gz; + UINT32 px,py,pz,gx,gy,gz; mobj_t *testmo; + UINT32 syncleeway; boolean nightsfail = false; if (!demo_p || !demo_start) @@ -4910,6 +4912,7 @@ void G_ConsGhostTic(void) oldghost.x = READFIXED(demo_p); oldghost.y = READFIXED(demo_p); oldghost.z = READFIXED(demo_p); + syncleeway = 0; } else { @@ -4923,6 +4926,7 @@ void G_ConsGhostTic(void) oldghost.x += oldghost.momx; oldghost.y += oldghost.momy; oldghost.z += oldghost.momz; + syncleeway = FRACUNIT; } if (ziptic & GZT_ANGLE) demo_p++; @@ -4988,14 +4992,14 @@ void G_ConsGhostTic(void) } // Re-synchronise - px = testmo->x>>FRACBITS; - py = testmo->y>>FRACBITS; - pz = testmo->z>>FRACBITS; - gx = oldghost.x>>FRACBITS; - gy = oldghost.y>>FRACBITS; - gz = oldghost.z>>FRACBITS; + px = testmo->x; + py = testmo->y; + pz = testmo->z; + gx = oldghost.x; + gy = oldghost.y; + gz = oldghost.z; - if (nightsfail || px != gx || py != gy || pz != gz) + if (nightsfail || abs(px-gx) > syncleeway || abs(py-gy) > syncleeway || abs(pz-gz) > syncleeway) { if (demosynced) CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); From a4c8388f3b000ec706e4df79fa008e411a1062e2 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 18 Feb 2019 22:36:26 -0600 Subject: [PATCH 23/58] Fix bumps sometimes shooting off stupidly fast --- src/k_kart.c | 69 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b006ae3b..f8efff2b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1056,7 +1056,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) mobj_t *fx; fixed_t momdifx, momdify; fixed_t distx, disty; - fixed_t dot, p; + fixed_t dot, force; fixed_t mass1, mass2; if (!mobj1 || !mobj2) @@ -1114,6 +1114,35 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) momdifx = mobj1->momx - mobj2->momx; momdify = mobj1->momy - mobj2->momy; + // Adds the OTHER player's momentum, so that it reduces the chance of you being "inside" the other object + distx = (mobj1->x + mobj2->momx) - (mobj2->x + mobj1->momx); + disty = (mobj1->y + mobj2->momy) - (mobj2->y + mobj1->momy); + + if (distx == 0 && disty == 0) + // if there's no distance between the 2, they're directly on top of each other, don't run this + return; + + { // Normalize distance to the sum of the two objects' radii, since in a perfect world that would be the distance at the point of collision... + fixed_t dist = P_AproxDistance(distx, disty) ?: 1; + fixed_t nx = FixedDiv(distx, dist); + fixed_t ny = FixedDiv(disty, dist); + + distx = FixedMul(mobj1->radius+mobj2->radius, nx); + disty = FixedMul(mobj1->radius+mobj2->radius, ny); + + CONS_Printf("dist %f %f %d %d %d %d\n", + FIXED_TO_FLOAT(P_AproxDistance(distx, disty)), + FIXED_TO_FLOAT(P_AproxDistance(momdifx, momdify)), + mobj1->momx, mobj1->momy, mobj2->momx, mobj2->momy); + + if (momdifx == 0 && momdify == 0) + { + // If there's no momentum difference, they're moving at exactly the same rate. Pretend they moved into each other. + momdifx = -nx; + momdify = -ny; + } + } + // if the speed difference is less than this let's assume they're going proportionately faster from each other if (P_AproxDistance(momdifx, momdify) < (25*mapobjectscale)) { @@ -1124,34 +1153,6 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) momdify = FixedMul((25*mapobjectscale), normalisedy); } - // Adds the OTHER player's momentum, so that it reduces the chance of you being "inside" the other object - distx = (mobj1->x + mobj2->momx) - (mobj2->x + mobj1->momx); - disty = (mobj1->y + mobj2->momy) - (mobj2->y + mobj1->momy); - - { // Don't allow dist to get WAY too low, that it pushes you stupidly huge amounts, or backwards... - fixed_t dist = P_AproxDistance(distx, disty); - fixed_t nx = FixedDiv(distx, dist); - fixed_t ny = FixedDiv(disty, dist); - - if (P_AproxDistance(distx, disty) < (3*mobj1->radius)/4) - { - distx = FixedMul((3*mobj1->radius)/4, nx); - disty = FixedMul((3*mobj1->radius)/4, ny); - } - - if (P_AproxDistance(distx, disty) < (3*mobj2->radius)/4) - { - distx = FixedMul((3*mobj2->radius)/4, nx); - disty = FixedMul((3*mobj2->radius)/4, ny); - } - } - - if (distx == 0 && disty == 0) - { - // if there's no distance between the 2, they're directly on top of each other, don't run this - return; - } - dot = FixedMul(momdifx, distx) + FixedMul(momdify, disty); if (dot >= 0) @@ -1160,7 +1161,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) return; } - p = FixedDiv(dot, FixedMul(distx, distx)+FixedMul(disty, disty)); + force = FixedDiv(dot, FixedMul(distx, distx)+FixedMul(disty, disty)); if (bounce == true && mass2 > 0) // Perform a Goomba Bounce. mobj1->momz = -mobj1->momz; @@ -1175,14 +1176,14 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) if (mass2 > 0) { - mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), distx); - mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), disty); + mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), force), distx); + mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), force), disty); } if (mass1 > 0 && solid == false) { - mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -distx); - mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -disty); + mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), force), -distx); + mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), force), -disty); } // Do the bump fx when we've CONFIRMED we can bump. From 9c1749d26982fd36fc05d531e26182314b7f10b8 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 18 Feb 2019 23:35:01 -0600 Subject: [PATCH 24/58] Make extra sure we launch in the correct direction --- 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 f8efff2b..807c9ce7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1114,9 +1114,9 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) momdifx = mobj1->momx - mobj2->momx; momdify = mobj1->momy - mobj2->momy; - // Adds the OTHER player's momentum, so that it reduces the chance of you being "inside" the other object - distx = (mobj1->x + mobj2->momx) - (mobj2->x + mobj1->momx); - disty = (mobj1->y + mobj2->momy) - (mobj2->y + mobj1->momy); + // Adds the OTHER player's momentum times a bunch, for the best chance of getting the correct direction + distx = (mobj1->x + mobj2->momx*3) - (mobj2->x + mobj1->momx*3); + disty = (mobj1->y + mobj2->momy*3) - (mobj2->y + mobj1->momy*3); if (distx == 0 && disty == 0) // if there's no distance between the 2, they're directly on top of each other, don't run this From caf7888eed70c9778875adacddb83b1dbad3b9d9 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 18 Feb 2019 23:35:24 -0600 Subject: [PATCH 25/58] Fix players sometimes snapping backwards on landing after spikeball hits --- 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 807c9ce7..9887318a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5476,7 +5476,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } // Wipeout slowdown - if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) + if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] && player->mo->friction > FRACUNIT/2) { if (player->kartstuff[k_offroad]) player->mo->friction -= 4912; From 838ed005d217344326c602744f9d960384259c0a Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 18 Feb 2019 23:39:08 -0600 Subject: [PATCH 26/58] Remove debugging print --- src/k_kart.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 9887318a..fded8b1c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1130,11 +1130,6 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) distx = FixedMul(mobj1->radius+mobj2->radius, nx); disty = FixedMul(mobj1->radius+mobj2->radius, ny); - CONS_Printf("dist %f %f %d %d %d %d\n", - FIXED_TO_FLOAT(P_AproxDistance(distx, disty)), - FIXED_TO_FLOAT(P_AproxDistance(momdifx, momdify)), - mobj1->momx, mobj1->momy, mobj2->momx, mobj2->momy); - if (momdifx == 0 && momdify == 0) { // If there's no momentum difference, they're moving at exactly the same rate. Pretend they moved into each other. From 9c5ae02755d01e002c1943de1d091e4b5d06a0b0 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 08:05:35 -0600 Subject: [PATCH 27/58] Fix cmd latency occasionally jumping to max --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f0d221ff..3944c02a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2162,7 +2162,7 @@ void G_Ticker(boolean run) G_CopyTiccmd(cmd, &netcmds[buf][i], 1); // Use the leveltime sent in the player's ticcmd to determine control lag - cmd->latency = modeattacking ? 0 : min((leveltime & 0xFF) - cmd->latency, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max + cmd->latency = modeattacking ? 0 : min(((leveltime & 0xFF) - cmd->latency) & 0xFF, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max } } From 580e12a32af9763eee3d71053e0ed53e505983ff Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 16:04:23 -0600 Subject: [PATCH 28/58] Add null check too --- 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 2c913e10..e67de72b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1979,7 +1979,7 @@ static void K_RemoveGrowShrink(player_t *player) { player->kartstuff[k_growshrinktimer] = 0; - if (!P_MobjWasRemoved(player->mo)) + if (player->mo && !P_MobjWasRemoved(player->mo)) { if (player->kartstuff[k_invincibilitytimer] == 0) player->mo->color = player->skincolor; From 8988927d160957d4bad569ff0ec214ac7f5c7329 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 16:46:48 -0600 Subject: [PATCH 29/58] Only apply friction changes on the ground --- 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 fded8b1c..d63591e7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5471,7 +5471,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } // Wipeout slowdown - if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] && player->mo->friction > FRACUNIT/2) + if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] && P_IsObjectOnGround(player->mo)) { if (player->kartstuff[k_offroad]) player->mo->friction -= 4912; From a59a1c53b0d2f11888d788e8936d22a45f2824b4 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 17:05:04 -0600 Subject: [PATCH 30/58] Add check to all of the friction stuff --- src/k_kart.c | 63 +++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d63591e7..39f2a714 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5440,43 +5440,46 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } } - // Friction - if (!player->kartstuff[k_offroad]) + if (onground) { - if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) - player->mo->friction += 4608; - if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) - player->mo->friction += 1608; - } + // Friction + if (!player->kartstuff[k_offroad]) + { + if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) + player->mo->friction += 4608; + if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) + player->mo->friction += 1608; + } - // Karma ice physics - if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) - { - player->mo->friction += 1228; + // Karma ice physics + if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) + { + player->mo->friction += 1228; - if (player->mo->friction > FRACUNIT) - player->mo->friction = FRACUNIT; - if (player->mo->friction < 0) - player->mo->friction = 0; + if (player->mo->friction > FRACUNIT) + player->mo->friction = FRACUNIT; + if (player->mo->friction < 0) + player->mo->friction = 0; - player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->friction); + player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->friction); - if (player->mo->movefactor < FRACUNIT) - player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT; - else - player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80; + if (player->mo->movefactor < FRACUNIT) + player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT; + else + player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80; - if (player->mo->movefactor < 32) - player->mo->movefactor = 32; - } + if (player->mo->movefactor < 32) + player->mo->movefactor = 32; + } - // Wipeout slowdown - if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] && P_IsObjectOnGround(player->mo)) - { - if (player->kartstuff[k_offroad]) - player->mo->friction -= 4912; - if (player->kartstuff[k_wipeoutslow] == 1) - player->mo->friction -= 9824; + // Wipeout slowdown + if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) + { + if (player->kartstuff[k_offroad]) + player->mo->friction -= 4912; + if (player->kartstuff[k_wipeoutslow] == 1) + player->mo->friction -= 9824; + } } K_KartDrift(player, onground); From 1fb65c72ff0b1db2546830bf825b19da75b42d9e Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 18:52:57 -0600 Subject: [PATCH 31/58] Reorganization + kill old interfaces --- src/djgppdos/i_video.c | 5 ----- src/hu_stuff.c | 15 --------------- src/hu_stuff.h | 1 - src/screen.c | 13 +++++++++++++ src/screen.h | 1 + src/sdl/i_video.c | 8 +++----- src/sdl12/i_video.c | 5 ----- src/win32/win_vid.c | 5 ----- src/win32ce/win_vid.c | 5 ----- 9 files changed, 17 insertions(+), 41 deletions(-) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 69addfb0..612c7221 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -41,7 +41,6 @@ #include "../m_argv.h" #include "vid_vesa.h" #include "../i_video.h" -#include "../hu_stuff.h" //dosstuff -newly added @@ -94,10 +93,6 @@ void I_FinishUpdate (void) // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); //blast it to the screen // this code sucks diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 175c8bf3..1ae48886 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2199,21 +2199,6 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans< servermaxping)) // only show 2 (warning) if our ping is at a bad level - { - INT32 dispy = cv_ticrate.value ? 160 : 181; - HU_drawPing(307, dispy, ping, V_SNAPTORIGHT|V_SNAPTOBOTTOM); - } -} // Heads up displays drawer, call each frame // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 6788c701..0f316bc7 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -109,7 +109,6 @@ void HU_Start(void); boolean HU_Responder(event_t *ev); void HU_Ticker(void); -void HU_drawLocalPing(void); void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); diff --git a/src/screen.c b/src/screen.c index 937d6caa..4de2abd0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -434,3 +434,16 @@ void SCR_DisplayTicRate(void) lasttic = ontic; } + +// SCR_DisplayLocalPing +// Used to draw the user's local ping next to the framerate for a quick check without having to hold TAB for instance. By default, it only shows up if your ping is too high and risks getting you kicked. + +void SCR_DisplayLocalPing(void) +{ + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level + { + INT32 dispy = cv_ticrate.value ? 160 : 181; + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM); + } +} diff --git a/src/screen.h b/src/screen.h index 9ad254d3..5b4a8e58 100644 --- a/src/screen.h +++ b/src/screen.h @@ -180,5 +180,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height); // move out to main code for consistency void SCR_DisplayTicRate(void); +void SCR_DisplayLocalPing(void); #undef DNWH #endif //__SCREEN_H__ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 9e5e4b60..39a2c5ef 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -67,7 +67,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" // ping drawer #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1361,10 +1360,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); + + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); if (rendermode == render_soft && screens[0]) { diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 08e6bd94..69cf5ca9 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -99,7 +99,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1343,10 +1342,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); if (render_soft == rendermode && screens[0]) { diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index cba0c209..9f3d13f8 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -28,7 +28,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -366,10 +365,6 @@ void I_FinishUpdate(void) // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); // if (bDIBMode) diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index c6610fa0..5e8e7e1f 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -26,7 +26,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -199,10 +198,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); - // if (bDIBMode) { From 30d37ce4cadcd2b09084ce677a5c68a896be0868 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 18:54:24 -0600 Subject: [PATCH 32/58] ...remove this forgotten comment too while I'm at it. --- src/hu_stuff.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 1ae48886..a9aa7c56 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2312,10 +2312,6 @@ void HU_Drawer(void) V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); } - - // draw the ping if the user wishes to - // THIS IS NOW HANDLED IN I_VIDEO - //HU_drawLocalPing(); } //====================================================================== From d2c708ba93886a1a5f3037299a04ef0054c15cb8 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 19:26:32 -0600 Subject: [PATCH 33/58] Maybe this is a better way to work around the DrawMasked crash... --- src/r_things.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 52c92b02..d94001c9 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -651,7 +651,7 @@ void R_DrawMaskedColumn(column_t *column) basetexturemid = dc_texturemid; - for (; column && column->topdelta != 0xff ;) + for (; column->topdelta != 0xff ;) { // calculate unclipped screen coordinates // for post @@ -925,6 +925,13 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->x2 >= vid.width) vis->x2 = vid.width-1; +#if 1 + // Something is occasionally setting 1px-wide sprites whose frac is exactly the width of the sprite, causing crashes due to + // accessing invalid column info. Until the cause is found, let's try to correct those manually... + while (frac + vis->xiscale*(vis->x2-vis->x1) > SHORT(patch->width)<x2 >= vis->x1) + vis->x2--; +#endif + for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale) { if (vis->scalestep) // currently papersprites only From 0913a623fb35e6073773fc3e5ba7034fdfbfbff3 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 19 Feb 2019 21:22:35 -0500 Subject: [PATCH 34/58] Some small changes. --- src/d_clisrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ea8077d6..2054d166 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2781,9 +2781,9 @@ static void Command_BanIP(void) if (I_SetBanAddress && I_SetBanAddress(address, NULL)) { if (reason) - CONS_Printf("Banned ip address %s for: %s\n", address, reason); + CONS_Printf("Banned IP address %s for: %s\n", address, reason); else - CONS_Printf("Banned ip address %s\n", address); + CONS_Printf("Banned IP address %s\n", address); Ban_Add(reason); D_SaveBan(); From ca87cfbf01302d398bf5970c3b5980be3262e9b4 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 21:57:56 -0500 Subject: [PATCH 35/58] Water skipping speed requirements are stricter --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 746fc1af..fd42a1d7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3399,8 +3399,8 @@ void P_MobjCheckWater(mobj_t *mobj) // skipping stone! if (p && p->kartstuff[k_waterskip] < 2 - && ((p->speed/2 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water. - || (p->speed > K_GetKartSpeed(p,false)/4 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more! + && ((p->speed/3 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water. + || (p->speed > K_GetKartSpeed(p,false)/3 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more! && ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop) || ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom))) { From df1a22d5fdcf21da81b2cee6d1cd5fa1a7178a8f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 21:27:14 -0600 Subject: [PATCH 36/58] Fix Hyudoro being tangible to Jawz and Orbinauts --- src/p_map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index 41e5a455..ccb66676 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -747,6 +747,9 @@ static boolean PIT_CheckThing(mobj_t *thing) && !(tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)) return true; + if (thing->player && thing->player->kartstuff[k_hyudorotimer]) + return true; // no interaction + if (thing->type == MT_PLAYER) { // Player Damage @@ -1021,6 +1024,9 @@ static boolean PIT_CheckThing(mobj_t *thing) && !(thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)) return true; + if (tmthing->player && tmthing->player->kartstuff[k_hyudorotimer]) // I thought about doing this for just the objects below but figured it should apply to everything. + return true; // no interaction + if (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD || thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD) { From 68b8ec81626a9023f638e7e22e9bb01489637ea6 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 23:01:19 -0500 Subject: [PATCH 37/58] Wipeout particles come from back wheels --- src/k_kart.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 468f5438..5ccc969b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2771,11 +2771,24 @@ void K_SpawnSparkleTrail(mobj_t *mo) void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) { mobj_t *dust; + angle_t aoff; I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25) * mo->scale), mo->y + (P_RandomRange(-25,25) * mo->scale), mo->z, MT_WIPEOUTTRAIL); + if (mo->player) + aoff = (mo->player->frameangle + ANGLE_180); + else + aoff = (mo->angle + ANGLE_180); + + if ((leveltime / 2) & 1) + aoff -= ANGLE_45; + else + aoff += ANGLE_45; + + dust = P_SpawnMobj(mo->x + FixedMul(24*mo->scale, FINECOSINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS), + mo->y + FixedMul(24*mo->scale, FINESINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS), + mo->z, MT_WIPEOUTTRAIL); P_SetTarget(&dust->target, mo); dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); From 879d3aa1a804005943b93f9f1e1ef1a6fd6d9425 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 19 Feb 2019 22:21:07 -0600 Subject: [PATCH 38/58] Hold on, this works. --- src/r_things.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index d94001c9..e4eaf413 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -925,13 +925,6 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->x2 >= vid.width) vis->x2 = vid.width-1; -#if 1 - // Something is occasionally setting 1px-wide sprites whose frac is exactly the width of the sprite, causing crashes due to - // accessing invalid column info. Until the cause is found, let's try to correct those manually... - while (frac + vis->xiscale*(vis->x2-vis->x1) > SHORT(patch->width)<x2 >= vis->x1) - vis->x2--; -#endif - for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale) { if (vis->scalestep) // currently papersprites only @@ -1321,7 +1314,7 @@ static void R_ProjectSprite(mobj_t *thing) if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier return; - scalestep = (yscale2 - yscale)/(x2 - x1); + scalestep = (yscale2 - yscale)/(x2 - x1) ?: 1; // The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2? // sortscale = max(yscale, yscale2); From 38ad726e55eb443702b3a76676ce14054fdae71e Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 23:38:16 -0500 Subject: [PATCH 39/58] Modify momz underwater for lots of things in k_kart.c --- src/k_kart.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 468f5438..81877a64 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1399,7 +1399,7 @@ void K_RespawnChecker(player_t *player) mo->eflags |= MFE_VERTICALFLIP; P_SetTarget(&mo->target, player->mo); mo->angle = newangle+ANGLE_90; - mo->momz = (8*FRACUNIT)*P_MobjFlip(player->mo); + mo->momz = (8<mo); P_SetScale(mo, (mo->destscale = FRACUNIT)); } } @@ -2212,6 +2212,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b player->mo->momz *= 2; } + if (player->mo->eflags & MFE_UNDERWATER) + player->mo->momz = (117 * player->mo->momz) / 200; + if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); @@ -2421,6 +2424,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; truc->momz = P_RandomRange(-speed, speed)*FRACUNIT; + if (truc->eflags & MFE_UNDERWATER) + truc->momz = (117 * truc->momz) / 200; truc->color = color; } @@ -2449,6 +2454,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) truc->momz = P_RandomRange(speed, speed2)*FRACUNIT; if (P_RandomChance(FRACUNIT/2)) truc->momz = -truc->momz; + if (truc->eflags & MFE_UNDERWATER) + truc->momz = (117 * truc->momz) / 200; truc->tics = TICRATE*2; truc->color = color; } @@ -3006,6 +3013,9 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map mo->momy = player->mo->momy + FixedMul(FINESINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); mo->momz = P_MobjFlip(player->mo) * HEIGHT; + if (mo->eflags & MFE_UNDERWATER) + mo->momz = (117 * mo->momz) / 200; + if (player->mo->eflags & MFE_VERTICALFLIP) mo->eflags |= MFE_VERTICALFLIP; } @@ -3364,6 +3374,9 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) else mo->momz = FixedMul(vertispeed, vscale); + if (mo->eflags & MFE_UNDERWATER) + mo->momz = (117 * mo->momz) / 200; + if (sound) S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos)); } @@ -3513,6 +3526,8 @@ void K_DropHnextList(player_t *player) dropwork->momx = player->mo->momx>>1; dropwork->momy = player->mo->momy>>1; dropwork->momz = 3*flip*mapobjectscale; + if (dropwork->eflags & MFE_UNDERWATER) + dropwork->momz = (117 * dropwork->momz) / 200; P_Thrust(dropwork, work->angle - ANGLE_90, 6*mapobjectscale); dropwork->movecount = 2; dropwork->movedir = work->angle - ANGLE_90; @@ -3571,6 +3586,8 @@ void K_DropItems(player_t *player) FixedAngle(P_RandomFixed()*180) + player->mo->angle + ANGLE_90, 16*mapobjectscale); drop->momz = P_MobjFlip(player->mo)*3*mapobjectscale; + if (drop->eflags & MFE_UNDERWATER) + drop->momz = (117 * drop->momz) / 200; drop->threshold = (thunderhack ? KITEM_THUNDERSHIELD : player->kartstuff[k_itemtype]); drop->movecount = player->kartstuff[k_itemamount]; From 0eb30bceb75116db4f6275f979011c35bb3766f3 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 22 Feb 2019 15:57:44 -0800 Subject: [PATCH 40/58] Rename splitscreen member to something more meaningful --- src/d_clisrv.c | 6 +++--- src/d_clisrv.h | 2 +- src/d_player.h | 2 +- src/g_game.c | 6 +++--- src/lua_playerlib.c | 6 +++--- src/p_saveg.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 0aec7fd9..bf9c1695 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -648,7 +648,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->jointime = (tic_t)LONG(players[i].jointime); - rsp->splitscreen = players[i].splitscreen; + rsp->splitscreenindex = players[i].splitscreenindex; rsp->hasmo = false; //Transfer important mo information if the player has a body. @@ -785,7 +785,7 @@ static void resynch_read_player(resynch_pak *rsp) players[i].jointime = (tic_t)LONG(rsp->jointime); - players[i].splitscreen = rsp->splitscreen; + players[i].splitscreenindex = rsp->splitscreenindex; //We get a packet for each player in game. if (!playeringame[i]) @@ -3320,7 +3320,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) addedtogame = true; } - players[newplayernum].splitscreen = splitscreenplayer; + players[newplayernum].splitscreenindex = splitscreenplayer; if (netgame) { diff --git a/src/d_clisrv.h b/src/d_clisrv.h index b628606d..5dc48753 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -283,7 +283,7 @@ typedef struct tic_t jointime; - UINT8 splitscreen; + UINT8 splitscreenindex; //player->mo stuff UINT8 hasmo; // Boolean diff --git a/src/d_player.h b/src/d_player.h index baed9a72..a5d73ec7 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -572,7 +572,7 @@ typedef struct player_s tic_t jointime; // Timer when player joins game to change skin/color - UINT8 splitscreen; + UINT8 splitscreenindex; #ifdef HWRENDER fixed_t fovadd; // adjust FOV for hw rendering #endif diff --git a/src/g_game.c b/src/g_game.c index eb0396c8..d04bbf6b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2357,7 +2357,7 @@ void G_PlayerReborn(INT32 player) UINT8 skincolor; INT32 skin; tic_t jointime; - UINT8 psplitscreen; + UINT8 splitscreenindex; boolean spectator; INT16 bot; SINT8 pity; @@ -2381,7 +2381,7 @@ void G_PlayerReborn(INT32 player) ctfteam = players[player].ctfteam; exiting = players[player].exiting; jointime = players[player].jointime; - psplitscreen = players[player].splitscreen; + splitscreenindex = players[player].splitscreenindex; spectator = players[player].spectator; pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN)); @@ -2478,7 +2478,7 @@ void G_PlayerReborn(INT32 player) p->pflags = pflags; p->ctfteam = ctfteam; p->jointime = jointime; - p->splitscreen = psplitscreen; + p->splitscreenindex = splitscreenindex; p->spectator = spectator; // save player config truth reborn diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 0bea1e7b..1c37f4c4 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -325,8 +325,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->bot); else if (fastcmp(field,"jointime")) lua_pushinteger(L, plr->jointime); - else if (fastcmp(field,"splitscreen")) - lua_pushinteger(L, plr->splitscreen); + else if (fastcmp(field,"splitscreenindex")) + lua_pushinteger(L, plr->splitscreenindex); #ifdef HWRENDER else if (fastcmp(field,"fovadd")) lua_pushfixed(L, plr->fovadd); @@ -615,7 +615,7 @@ static int player_set(lua_State *L) return NOSET; else if (fastcmp(field,"jointime")) plr->jointime = (tic_t)luaL_checkinteger(L, 3); - else if (fastcmp(field,"splitscreen")) + else if (fastcmp(field,"splitscreenindex")) return NOSET; #ifdef HWRENDER else if (fastcmp(field,"fovadd")) diff --git a/src/p_saveg.c b/src/p_saveg.c index a2ae8f17..5a43745b 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -249,7 +249,7 @@ static void P_NetArchivePlayers(void) WRITEUINT32(save_p, players[i].jointime); - WRITEUINT8(save_p, players[i].splitscreen); + WRITEUINT8(save_p, players[i].splitscreenindex); WRITEUINT16(save_p, flags); @@ -428,7 +428,7 @@ static void P_NetUnArchivePlayers(void) players[i].jointime = READUINT32(save_p); - players[i].splitscreen = READUINT8(save_p); + players[i].splitscreenindex = READUINT8(save_p); flags = READUINT16(save_p); From df503c7f198f8e29e5d254bdb52638359e913e4a Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Fri, 22 Feb 2019 19:07:54 -0500 Subject: [PATCH 41/58] Add parentheses --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index e2a59969..71906027 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4767,7 +4767,7 @@ void G_WriteGhostTic(mobj_t *ghost) if (abs(ghost->x-oldghost.x) > MAXMOM || abs(ghost->y-oldghost.y) > MAXMOM || abs(ghost->z-oldghost.z) > MAXMOM - || leveltime & 255 == 1) // Hack to enable slightly nicer resyncing + || (leveltime & 255 == 1)) // Hack to enable slightly nicer resyncing { oldghost.x = ghost->x; oldghost.y = ghost->y; From b2d4ec501cb2ec67a0b345a3fe49667c1975540a Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Fri, 22 Feb 2019 19:11:50 -0500 Subject: [PATCH 42/58] Add parentheses 2: Move parentheses --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 71906027..0a19ec8f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4767,7 +4767,7 @@ void G_WriteGhostTic(mobj_t *ghost) if (abs(ghost->x-oldghost.x) > MAXMOM || abs(ghost->y-oldghost.y) > MAXMOM || abs(ghost->z-oldghost.z) > MAXMOM - || (leveltime & 255 == 1)) // Hack to enable slightly nicer resyncing + || (leveltime & 255) == 1) // Hack to enable slightly nicer resyncing { oldghost.x = ghost->x; oldghost.y = ghost->y; From d9759df874608e97a1ea5708b95916f224f3d18d Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 22 Feb 2019 18:13:22 -0600 Subject: [PATCH 43/58] I don't think these old interfaces even compile but let's not kill them off --- src/djgppdos/i_video.c | 3 +++ src/sdl12/i_video.c | 3 +++ src/win32/win_vid.c | 3 +++ src/win32ce/win_vid.c | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c7221..7829acbb 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -94,6 +94,9 @@ void I_FinishUpdate (void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + //blast it to the screen // this code sucks //memcpy(dascreen,screens[0],screenwidth*screenheight); diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 69cf5ca9..a2a20c61 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -1343,6 +1343,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + if (render_soft == rendermode && screens[0]) { SDL_Rect *dstrect = NULL; diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 9f3d13f8..45f96e9d 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -366,6 +366,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) { diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 5e8e7e1f..244dfaf3 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -198,6 +198,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) { From cec79dee87128b0d9f48f6a6c0a87a6b31e596e4 Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Fri, 22 Feb 2019 21:04:53 -0500 Subject: [PATCH 44/58] if you going to use abs(), you need to work in signed types --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 0a19ec8f..842ac1a7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4896,7 +4896,7 @@ void G_WriteGhostTic(mobj_t *ghost) void G_ConsGhostTic(void) { UINT8 ziptic; - UINT32 px,py,pz,gx,gy,gz; + fixed_t px,py,pz,gx,gy,gz; mobj_t *testmo; UINT32 syncleeway; boolean nightsfail = false; From d5a4759121b89340016b22f332bdc174dc4a56a7 Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Fri, 22 Feb 2019 21:13:00 -0500 Subject: [PATCH 45/58] signed and unsigned compare --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 842ac1a7..003c11e9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4898,7 +4898,7 @@ void G_ConsGhostTic(void) UINT8 ziptic; fixed_t px,py,pz,gx,gy,gz; mobj_t *testmo; - UINT32 syncleeway; + fixed_t syncleeway; boolean nightsfail = false; if (!demo_p || !demo_start) From f91eb68b709c660f319c6546a3a27dd1ce4100f1 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Fri, 22 Feb 2019 22:49:27 -0500 Subject: [PATCH 46/58] Update item table Not looking forward to testing... --- src/k_kart.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c8c1e1e5..93ef33db 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -496,20 +496,20 @@ boolean K_IsPlayerWanted(player_t *player) static INT32 K_KartItemOddsRace[NUMKARTRESULTS][10] = { //P-Odds 0 1 2 3 4 5 6 7 8 9 - /*Sneaker*/ {20, 0, 0, 4, 6, 6, 0, 0, 0, 0 }, // Sneaker - /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3, 0 }, // Rocket Sneaker - /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,14, 0 }, // Invincibility - /*Banana*/ { 0,10, 4, 2, 1, 0, 0, 0, 0, 0 }, // Banana + /*Sneaker*/ {20, 0, 0, 4, 7, 7, 0, 0, 0, 0 }, // Sneaker + /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 4, 5, 3, 0 }, // Rocket Sneaker + /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,10, 0 }, // Invincibility + /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 3, 2, 1, 0, 0, 0, 0, 0, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 8, 6, 4, 2, 0, 0, 0, 0, 0 }, // Orbinaut + /*Orbinaut*/ { 0, 7, 6, 4, 2, 0, 0, 0, 0, 0 }, // Orbinaut /*Jawz*/ { 0, 0, 3, 2, 1, 1, 0, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 0, 2, 1, 0, 0, 0, 0, 0 }, // Ballhog /*Self-Propelled Bomb*/ { 0, 0, 1, 2, 3, 4, 2, 2, 0,20 }, // Self-Propelled Bomb - /*Grow*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3, 0 }, // Grow + /*Grow*/ { 0, 0, 0, 0, 0, 0, 2, 5, 7, 0 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 }, // Shrink /*Thunder Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0, 0 }, // Thunder Shield - /*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0, 0 }, // Hyudoro + /*Hyudoro*/ { 0, 0, 0, 0, 0, 2, 1, 0, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink /*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 9, 2, 0, 0 }, // Sneaker x3 From c543c35b91cb217faaa9c2b2a9b9e4d57eb9d4a3 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Fri, 22 Feb 2019 22:50:13 -0500 Subject: [PATCH 47/58] Revert this minor change --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 93ef33db..d49b4f4d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -496,7 +496,7 @@ boolean K_IsPlayerWanted(player_t *player) static INT32 K_KartItemOddsRace[NUMKARTRESULTS][10] = { //P-Odds 0 1 2 3 4 5 6 7 8 9 - /*Sneaker*/ {20, 0, 0, 4, 7, 7, 0, 0, 0, 0 }, // Sneaker + /*Sneaker*/ {20, 0, 0, 4, 6, 7, 0, 0, 0, 0 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 4, 5, 3, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,10, 0 }, // Invincibility /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0, 0 }, // Banana @@ -509,7 +509,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][10] = /*Grow*/ { 0, 0, 0, 0, 0, 0, 2, 5, 7, 0 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 }, // Shrink /*Thunder Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0, 0 }, // Thunder Shield - /*Hyudoro*/ { 0, 0, 0, 0, 0, 2, 1, 0, 0, 0 }, // Hyudoro + /*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink /*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 9, 2, 0, 0 }, // Sneaker x3 From a993cffb6969dba552a49d46423db6070ea6bc14 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 26 Feb 2019 04:30:51 -0500 Subject: [PATCH 48/58] Modify a few colors - The following colors were given either more noticeable highlights or deeper shading for better colorized WANTED poster appearance: Nickel, Black, Beige, Brown, Leather, Salmon, Red, Crimson, Pumpkin, Rosewood, Burgundy, Pinetree, Swamp, Periwinkle, Blue, Blueberry, Dusk, Purple, Lavender, and Byzantium. - Fixed an off-looking purple tone on Ruby. - Salmon's outline & shading was made darker, to make it slightly easier on the eyes. - Peach recieved a complete overhaul, featuring high contrast and yellow highlights. - Add kartdebugcolorize for taking a quick glance at all of the colorizations --- src/d_netcmd.c | 1 + src/d_netcmd.h | 2 +- src/k_kart.c | 82 +++++++++++++++++++++++++++----------------------- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 53d88f2f..a8efd306 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -378,6 +378,7 @@ consvar_t cv_kartdebughuddrop = {"kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|C consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartdebugnodes = {"kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugcolorize = {"kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 54c00484..e0827013 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -126,7 +126,7 @@ extern consvar_t cv_karteliminatelast; extern consvar_t cv_votetime; extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugshrink, cv_kartdebugdistribution, cv_kartdebughuddrop; -extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes; +extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize; extern consvar_t cv_itemfinder; diff --git a/src/k_kart.c b/src/k_kart.c index d49b4f4d..ffa24abd 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -180,31 +180,31 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = UINT8 colortranslations[MAXSKINCOLORS][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE - {120, 120, 120, 120, 0, 1, 3, 4, 6, 7, 10, 14, 18, 22, 25, 28}, // SKINCOLOR_WHITE - { 0, 1, 2, 4, 5, 7, 8, 10, 13, 15, 18, 20, 23, 25, 28, 30}, // SKINCOLOR_SILVER + {120, 120, 120, 120, 0, 2, 5, 8, 9, 11, 14, 17, 20, 22, 25, 28}, // SKINCOLOR_WHITE + { 0, 1, 2, 3, 5, 7, 9, 12, 13, 15, 18, 20, 23, 25, 27, 30}, // SKINCOLOR_SILVER { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY - { 12, 14, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, // SKINCOLOR_NICKEL - { 16, 17, 19, 21, 22, 24, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK + { 3, 5, 8, 11, 15, 17, 19, 21, 23, 24, 25, 26, 27, 29, 30, 31}, // SKINCOLOR_NICKEL + { 4, 7, 11, 15, 20, 22, 24, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK { 0, 1, 3, 5, 7, 9, 34, 36, 38, 40, 42, 44, 60, 61, 62, 63}, // SKINCOLOR_SEPIA - { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, // SKINCOLOR_BEIGE - { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN - { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER - {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON + {120, 65, 67, 69, 32, 34, 36, 38, 40, 42, 44, 45, 46, 47, 62, 63}, // SKINCOLOR_BEIGE + { 67, 70, 73, 76, 48, 49, 51, 53, 54, 56, 58, 59, 61, 63, 29, 30}, // SKINCOLOR_BROWN + { 72, 76, 48, 51, 53, 55, 57, 59, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER + {120, 120, 120, 121, 121, 122, 123, 124, 126, 127, 129, 131, 133, 135, 137, 139}, // SKINCOLOR_SALMON {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE - {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY - {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY - {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED - {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON + {120, 121, 144, 145, 147, 149, 132, 133, 134, 136, 198, 198, 199, 255, 30, 31}, // SKINCOLOR_RUBY + {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 134, 136, 137, 139, 140}, // SKINCOLOR_RASPBERRY + {122, 123, 124, 126, 129, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142}, // SKINCOLOR_RED + {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_CRIMSON {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 120, 80, 80, 81, 82, 83, 83, 84, 85, 86, 88, 89, 91, 93, 95}, // SKINCOLOR_CREAMSICLE { 80, 81, 82, 83, 84, 85, 86, 88, 89, 91, 94, 95, 154, 156, 158, 159}, // SKINCOLOR_ORANGE - { 84, 85, 86, 87, 88, 90, 92, 93, 94, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_PUMPKIN - { 90, 91, 92, 93, 94, 152, 153, 154, 155, 156, 157, 158, 159, 139, 141, 143}, // SKINCOLOR_ROSEWOOD - { 94, 95, 152, 153, 154, 156, 157, 159, 141, 141, 141, 142, 142, 143, 143, 31}, // SKINCOLOR_BURGUNDY + { 82, 83, 84, 85, 87, 89, 90, 92, 94, 152, 153, 155, 157, 159, 141, 142}, // SKINCOLOR_PUMPKIN + { 83, 85, 88, 90, 92, 94, 152, 153, 154, 156, 157, 159, 140, 141, 142, 143}, // SKINCOLOR_ROSEWOOD + { 84, 86, 89, 91, 152, 154, 155, 157, 158, 159, 140, 141, 142, 143, 31, 31}, // SKINCOLOR_BURGUNDY { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE - { 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 48, 50, 53, 56, 59}, // SKINCOLOR_PEACH + {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE @@ -220,9 +220,9 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN - {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE + {161, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD - {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP + {160, 184, 185, 186, 187, 188, 189, 190, 191, 191, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL @@ -234,27 +234,15 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE - {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE - {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE - {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY - {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK - {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE - {248, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255}, // SKINCOLOR_LAVENDER - {192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM + {120, 120, 224, 225, 226, 202, 227, 228, 229, 230, 231, 233, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE + {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 236, 238, 242, 244, 246}, // SKINCOLOR_BLUE + {226, 228, 229, 230, 232, 233, 235, 237, 239, 240, 242, 244, 246, 31, 31, 31}, // SKINCOLOR_BLUEBERRY + {121, 145, 192, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK + {121, 145, 192, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_PURPLE + {121, 145, 192, 248, 249, 250, 251, 252, 252, 253, 253, 254, 254, 255, 30, 31}, // SKINCOLOR_LAVENDER + {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC - /* Removed Colours - {120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143}, // old SKINCOLOR_RUBY, removed for other colors - {224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246}, // old SKINCOLOR_SAPPHIRE, removed for other colors - { 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55}, // old SKINCOLOR_CARAMEL, new Caramel was previously Shiny Caramel - {215, 216, 217, 218, 204, 205, 206, 237, 238, 239, 240, 241, 242, 243, 244, 245}, // old SKINCOLOR_NAVY, too similar to Jet - { 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_AMBER, removed for other colors - {160, 160, 160, 184, 184, 184, 185, 185, 185, 186, 187, 187, 188, 188, 189, 190}, // SKINCOLOR_JADE, removed for other colors - {224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175}, // SKINCOLOR_FROST, merged into Aqua - { 96, 97, 99, 100, 102, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111}, // SKINCOLOR_CANARY, replaced with Mustard - {192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_INDIGO, too similar to Byzantium - { 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255}, // SKINCOLOR_RAINBOW, is Vomit 2.0 - */ }; // Define for getting accurate color brightness readings according to how the human eye sees them. @@ -443,6 +431,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugcheckpoint); CV_RegisterVar(&cv_kartdebugnodes); + CV_RegisterVar(&cv_kartdebugcolorize); } //} @@ -8593,6 +8582,25 @@ void K_drawKartHUD(void) for (p = 0; p < MAXPLAYERS; p++) V_DrawString(8, 64+(8*p), V_YELLOWMAP, va("%d - %d (%dl)", p, playernode[p], players[p].cmd.latency)); } + + if (cv_kartdebugcolorize.value && stplyr->mo && stplyr->mo->skin) + { + INT32 x = 0, y = 0; + UINT8 c; + + for (c = 1; c < MAXSKINCOLORS; c++) + { + UINT8 *cm = R_GetTranslationColormap(TC_RAINBOW, c, 0); + V_DrawFixedPatch(x<skin], cm); + + x += 30; + if (x > BASEVIDWIDTH-30) + { + x = 0; + y += 30; + } + } + } } //} From 7de2cf8d3978af5e2d9d8b3bf6a8cbfe21ec0ce2 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 26 Feb 2019 07:14:03 -0500 Subject: [PATCH 49/58] Fix Super colors from base SRB2 giving a garbage color --- src/dehacked.c | 73 +++++++++++++++++++++++++++++++++++++------------- src/doomdef.h | 47 ++++++++++++++++++++++++++++++-- src/k_kart.c | 49 ++++++++++++++++++++++++++++++++- src/k_kart.h | 2 +- 4 files changed, 149 insertions(+), 22 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 11aed24d..d346de5f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8199,24 +8199,61 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "POMEGRANATE", // 62 // SKINCOLOR_POMEGRANATE "LILAC", // 63 // SKINCOLOR_LILAC - // Super special awesome Super flashing colors! - "SUPER1", // SKINCOLOR_SUPER1 - "SUPER2", // SKINCOLOR_SUPER2, - "SUPER3", // SKINCOLOR_SUPER3, - "SUPER4", // SKINCOLOR_SUPER4, - "SUPER5", // SKINCOLOR_SUPER5, - // Super Tails - "TSUPER1", // SKINCOLOR_TSUPER1, - "TSUPER2", // SKINCOLOR_TSUPER2, - "TSUPER3", // SKINCOLOR_TSUPER3, - "TSUPER4", // SKINCOLOR_TSUPER4, - "TSUPER5", // SKINCOLOR_TSUPER5, - // Super Knuckles - "KSUPER1", // SKINCOLOR_KSUPER1, - "KSUPER2", // SKINCOLOR_KSUPER2, - "KSUPER3", // SKINCOLOR_KSUPER3, - "KSUPER4", // SKINCOLOR_KSUPER4, - "KSUPER5" // SKINCOLOR_KSUPER5, + // Special super colors + // Super Sonic Yellow + "SUPER1", // SKINCOLOR_SUPER1 + "SUPER2", // SKINCOLOR_SUPER2, + "SUPER3", // SKINCOLOR_SUPER3, + "SUPER4", // SKINCOLOR_SUPER4, + "SUPER5", // SKINCOLOR_SUPER5, + // Super Tails Orange + "TSUPER1", // SKINCOLOR_TSUPER1, + "TSUPER2", // SKINCOLOR_TSUPER2, + "TSUPER3", // SKINCOLOR_TSUPER3, + "TSUPER4", // SKINCOLOR_TSUPER4, + "TSUPER5", // SKINCOLOR_TSUPER5, + // Super Knuckles Red + "KSUPER1", // SKINCOLOR_KSUPER1, + "KSUPER2", // SKINCOLOR_KSUPER2, + "KSUPER3", // SKINCOLOR_KSUPER3, + "KSUPER4", // SKINCOLOR_KSUPER4, + "KSUPER5", // SKINCOLOR_KSUPER5, + // Hyper Sonic Pink + "PSUPER1", // SKINCOLOR_PSUPER1, + "PSUPER2", // SKINCOLOR_PSUPER2, + "PSUPER3", // SKINCOLOR_PSUPER3, + "PSUPER4", // SKINCOLOR_PSUPER4, + "PSUPER5", // SKINCOLOR_PSUPER5, + // Hyper Sonic Blue + "BSUPER1", // SKINCOLOR_BSUPER1, + "BSUPER2", // SKINCOLOR_BSUPER2, + "BSUPER3", // SKINCOLOR_BSUPER3, + "BSUPER4", // SKINCOLOR_BSUPER4, + "BSUPER5" // SKINCOLOR_BSUPER5, + // Hyper Sonic Green + "GSUPER1", // SKINCOLOR_GSUPER1, + "GSUPER2", // SKINCOLOR_GSUPER2, + "GSUPER3", // SKINCOLOR_GSUPER3, + "GSUPER4", // SKINCOLOR_GSUPER4, + "GSUPER5", // SKINCOLOR_GSUPER5, + // Hyper Sonic White + "WSUPER1", // SKINCOLOR_WSUPER1, + "WSUPER2", // SKINCOLOR_WSUPER2, + "WSUPER3", // SKINCOLOR_WSUPER3, + "WSUPER4", // SKINCOLOR_WSUPER4, + "WSUPER5", // SKINCOLOR_WSUPER5, + // Creamy Super (Shadow?) + "CSUPER1", // SKINCOLOR_CSUPER1, + "CSUPER2", // SKINCOLOR_CSUPER2, + "CSUPER3", // SKINCOLOR_CSUPER3, + "CSUPER4", // SKINCOLOR_CSUPER4, + "CSUPER5", // SKINCOLOR_CSUPER5, + // Aqua Super + "ASUPER1", // SKINCOLOR_ASUPER1, + "ASUPER2", // SKINCOLOR_ASUPER2, + "ASUPER3", // SKINCOLOR_ASUPER3, + "ASUPER4", // SKINCOLOR_ASUPER4, + "ASUPER5" // SKINCOLOR_ASUPER5, }; static const char *const POWERS_LIST[] = { diff --git a/src/doomdef.h b/src/doomdef.h index ab863c6f..338bd7e6 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -319,26 +319,69 @@ typedef enum MAXSKINCOLORS, // Super special awesome Super flashing colors! + // Super Sonic Yellow SKINCOLOR_SUPER1 = MAXSKINCOLORS, SKINCOLOR_SUPER2, SKINCOLOR_SUPER3, SKINCOLOR_SUPER4, SKINCOLOR_SUPER5, - // Super Tails + // Super Tails Orange SKINCOLOR_TSUPER1, SKINCOLOR_TSUPER2, SKINCOLOR_TSUPER3, SKINCOLOR_TSUPER4, SKINCOLOR_TSUPER5, - // Super Knuckles + // Super Knuckles Red SKINCOLOR_KSUPER1, SKINCOLOR_KSUPER2, SKINCOLOR_KSUPER3, SKINCOLOR_KSUPER4, SKINCOLOR_KSUPER5, + // Hyper Sonic Pink + SKINCOLOR_PSUPER1, + SKINCOLOR_PSUPER2, + SKINCOLOR_PSUPER3, + SKINCOLOR_PSUPER4, + SKINCOLOR_PSUPER5, + + // Hyper Sonic Blue + SKINCOLOR_BSUPER1, + SKINCOLOR_BSUPER2, + SKINCOLOR_BSUPER3, + SKINCOLOR_BSUPER4, + SKINCOLOR_BSUPER5, + + // Hyper Sonic Green + SKINCOLOR_GSUPER1, + SKINCOLOR_GSUPER2, + SKINCOLOR_GSUPER3, + SKINCOLOR_GSUPER4, + SKINCOLOR_GSUPER5, + + // Hyper Sonic White + SKINCOLOR_WSUPER1, + SKINCOLOR_WSUPER2, + SKINCOLOR_WSUPER3, + SKINCOLOR_WSUPER4, + SKINCOLOR_WSUPER5, + + // Creamy Super (Shadow?) + SKINCOLOR_CSUPER1, + SKINCOLOR_CSUPER2, + SKINCOLOR_CSUPER3, + SKINCOLOR_CSUPER4, + SKINCOLOR_CSUPER5, + + // Aqua Super + SKINCOLOR_ASUPER1, + SKINCOLOR_ASUPER2, + SKINCOLOR_ASUPER3, + SKINCOLOR_ASUPER4, + SKINCOLOR_ASUPER5, + MAXTRANSLATIONS } skincolors_t; diff --git a/src/k_kart.c b/src/k_kart.c index ffa24abd..eb3a4fc1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -178,7 +178,7 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_JAWZ,6 // 63 // SKINCOLOR_LILAC }; -UINT8 colortranslations[MAXSKINCOLORS][16] = { +UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE {120, 120, 120, 120, 0, 2, 5, 8, 9, 11, 14, 17, 20, 22, 25, 28}, // SKINCOLOR_WHITE { 0, 1, 2, 3, 5, 7, 9, 12, 13, 15, 18, 20, 23, 25, 27, 30}, // SKINCOLOR_SILVER @@ -243,6 +243,53 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC + // MAXSKINCOLORS + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2 + {120, 120, 120, 120, 120, 120, 96, 98, 100, 102, 104, 113, 114, 116, 117, 119}, // SKINCOLOR_SUPER3 + {120, 120, 120, 120, 96, 97, 99, 100, 102, 104, 113, 114, 115, 116, 117, 119}, // SKINCOLOR_SUPER4 + {120, 120, 96, 120, 120, 120, 120, 120, 104, 113, 114, 115, 116, 117, 118, 119}, // SKINCOLOR_SUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 80, 82, 85, 115, 117, 119}, // SKINCOLOR_TSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 80, 81, 83, 85, 115, 116, 117, 119}, // SKINCOLOR_TSUPER2 + {120, 120, 120, 120, 120, 120, 80, 81, 82, 83, 85, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER3 + {120, 120, 120, 120, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER4 + {120, 120, 80, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 117, 118, 119}, // SKINCOLOR_TSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 123, 125, 127, 129, 132}, // SKINCOLOR_KSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 121, 122, 124, 125, 127, 128, 130, 132}, // SKINCOLOR_KSUPER2 + {120, 120, 120, 120, 120, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 132}, // SKINCOLOR_KSUPER3 + {120, 120, 120, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER4 + {120, 120, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 122, 124, 248, 251, 255}, // SKINCOLOR_PSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 0, 121, 122, 124, 248, 250, 252, 255}, // SKINCOLOR_PSUPER2 + {120, 120, 120, 120, 120, 120, 0, 121, 122, 123, 124, 248, 249, 251, 253, 255}, // SKINCOLOR_PSUPER3 + {120, 120, 120, 120, 0, 121, 122, 123, 124, 248, 249, 250, 251, 252, 253, 255}, // SKINCOLOR_PSUPER4 + {120, 120, 0, 121, 122, 123, 124, 248, 248, 249, 250, 251, 252, 253, 254, 255}, // SKINCOLOR_PSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 224, 225, 227, 228, 230, 232}, // SKINCOLOR_BSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 224, 225, 226, 227, 228, 229, 230, 232}, // SKINCOLOR_BSUPER2 + {120, 120, 120, 120, 120, 120, 224, 224, 225, 226, 227, 228, 229, 230, 231, 232}, // SKINCOLOR_BSUPER3 + {120, 120, 120, 120, 224, 224, 225, 226, 226, 227, 228, 229, 229, 230, 231, 232}, // SKINCOLOR_BSUPER4 + {120, 120, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 232}, // SKINCOLOR_BSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 176, 160, 163, 167, 171, 175}, // SKINCOLOR_GSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 176, 176, 160, 163, 166, 169, 172, 175}, // SKINCOLOR_GSUPER2 + {120, 120, 120, 120, 120, 120, 176, 176, 160, 162, 164, 166, 168, 170, 172, 175}, // SKINCOLOR_GSUPER3 + {120, 120, 120, 120, 176, 176, 176, 160, 161, 163, 165, 167, 169, 171, 173, 175}, // SKINCOLOR_GSUPER4 + {120, 120, 176, 176, 176, 160, 161, 163, 164, 166, 167, 169, 170, 172, 173, 175}, // SKINCOLOR_GSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}, // SKINCOLOR_WSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 4, 9}, // SKINCOLOR_WSUPER2 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 2, 4, 6, 8, 11}, // SKINCOLOR_WSUPER3 + {120, 120, 120, 120, 120, 120, 120, 0, 1, 3, 4, 6, 8, 9, 11, 13}, // SKINCOLOR_WSUPER4 + {120, 120, 120, 120, 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 15}, // SKINCOLOR_WSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 99, 81, 73, 79}, // SKINCOLOR_CSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 96, 97, 98, 81, 81, 71, 75, 79}, // SKINCOLOR_CSUPER2 + {120, 120, 120, 120, 120, 120, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3 + {120, 120, 120, 120, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4 + {120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2 + {120, 120, 120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3 + {120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4 + {120, 120, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5 + // MAXTRANSLATIONS }; // Define for getting accurate color brightness readings according to how the human eye sees them. diff --git a/src/k_kart.h b/src/k_kart.h index dc37956a..e193b662 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,7 +11,7 @@ #define KART_FULLTURN 800 -UINT8 colortranslations[MAXSKINCOLORS][16]; +UINT8 colortranslations[MAXTRANSLATIONS][16]; extern const char *KartColor_Names[MAXSKINCOLORS]; extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2]; void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); From 1d3adb04911702f13b0a89d101b589d5ef2cf9d3 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 26 Feb 2019 17:33:10 -0500 Subject: [PATCH 50/58] Remove mixed declaration that triggers ERRORMODE on my setup --- src/d_clisrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6eda1445..e8700cd0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5096,9 +5096,10 @@ static inline void PingUpdate(void) pingtimeout[i]++; if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { - pingtimeout[i] = 0; XBOXSTATIC char buf[2]; + pingtimeout[i] = 0; + buf[0] = (char)i; buf[1] = KICK_MSG_PING_HIGH; SendNetXCmd(XD_KICK, &buf, 2); From 22434949e52afd5cf0c87a1622426974668d2e35 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 26 Feb 2019 17:44:35 -0500 Subject: [PATCH 51/58] Extend pingtable by 1 for the servermaxping entry --- src/d_clisrv.c | 6 +++--- src/d_clisrv.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index e8700cd0..f8938d6c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4400,12 +4400,12 @@ FILESTAMP //Update client ping table from the server. if (client) { - INT32 i; + UINT8 i; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; - servermaxping = (tic_t)netbuffer->u.pingtable[i++]; + servermaxping = (tic_t)netbuffer->u.pingtable[MAXPLAYERS]; } break; @@ -5122,7 +5122,7 @@ static inline void PingUpdate(void) } // send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked. - netbuffer->u.pingtable[i++] = cv_maxping.value; + netbuffer->u.pingtable[MAXPLAYERS] = cv_maxping.value; //send out our ping packets for (i = 0; i < MAXNETNODES; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 21fe7c38..6615d67d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -452,10 +452,10 @@ typedef struct serverrefuse_pak serverrefuse; // 65025 bytes (somehow I feel like those values are garbage...) askinfo_pak askinfo; // 61 bytes msaskinfo_pak msaskinfo; // 22 bytes - plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes (I'd say 36~38) - plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes (welp they ARE) + plrinfo playerinfo[MAXPLAYERS]; // 576 bytes(?) + plrconfig playerconfig[MAXPLAYERS]; // (up to) 528 bytes(?) #ifdef NEWPING - UINT32 pingtable[MAXPLAYERS]; // 128 bytes + UINT32 pingtable[MAXPLAYERS+1]; // 68 bytes #endif } u; // This is needed to pack diff packet types data together } ATTRPACK doomdata_t; From 44462d0dd747fa0e03c41f8fd657448274a1a9e7 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Wed, 27 Feb 2019 00:08:13 -0500 Subject: [PATCH 52/58] 10 new colors new Crimson (old Crimson was renamed to Scarlet), new Peach (the replacement from last commit was renamed to Cream), Cherry, Nova, Copper, Handheld, Algae, Pastel, Fuchsia, and Toxic. Also, updated Robo-Hood. --- src/dehacked.c | 138 ++++++++++++----------- src/doomdef.h | 10 ++ src/hu_stuff.c | 6 +- src/k_kart.c | 294 +++++++++++++++++++++++++++---------------------- 4 files changed, 249 insertions(+), 199 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index d346de5f..7795f1f5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8134,70 +8134,80 @@ static const char *const ML_LIST[16] = { // This DOES differ from r_draw's Color_Names, unfortunately. // Also includes Super colors static const char *COLOR_ENUMS[] = { // Rejigged for Kart. - "NONE", // 00 // SKINCOLOR_NONE - "WHITE", // 01 // SKINCOLOR_WHITE - "SILVER", // 02 // SKINCOLOR_SILVER - "GREY", // 03 // SKINCOLOR_GREY - "NICKEL", // 04 // SKINCOLOR_NICKEL - "BLACK", // 05 // SKINCOLOR_BLACK - "SEPIA", // 06 // SKINCOLOR_SEPIA - "BEIGE", // 07 // SKINCOLOR_BEIGE - "BROWN", // 08 // SKINCOLOR_BROWN - "LEATHER", // 09 // SKINCOLOR_LEATHER - "SALMON", // 10 // SKINCOLOR_SALMON - "PINK", // 11 // SKINCOLOR_PINK - "ROSE", // 12 // SKINCOLOR_ROSE - "RUBY", // 13 // SKINCOLOR_RUBY - "RASPBERRY", // 14 // SKINCOLOR_RASPBERRY - "RED", // 15 // SKINCOLOR_RED - "CRIMSON", // 16 // SKINCOLOR_CRIMSON - "KETCHUP", // 17 // SKINCOLOR_KETCHUP - "DAWN", // 18 // SKINCOLOR_DAWN - "CREAMSICLE", // 19 // SKINCOLOR_CREAMSICLE - "ORANGE", // 20 // SKINCOLOR_ORANGE - "PUMPKIN", // 21 // SKINCOLOR_PUMPKIN - "ROSEWOOD", // 22 // SKINCOLOR_ROSEWOOD - "BURGUNDY", // 23 // SKINCOLOR_BURGUNDY - "TANGERINE", // 24 // SKINCOLOR_TANGERINE - "PEACH", // 25 // SKINCOLOR_PEACH - "CARAMEL", // 26 // SKINCOLOR_CARAMEL - "GOLD", // 27 // SKINCOLOR_GOLD - "BRONZE", // 28 // SKINCOLOR_BRONZE - "YELLOW", // 29 // SKINCOLOR_YELLOW - "MUSTARD", // 30 // SKINCOLOR_MUSTARD - "OLIVE", // 31 // SKINCOLOR_OLIVE - "VOMIT", // 32 // SKINCOLOR_VOMIT - "GARDEN", // 33 // SKINCOLOR_GARDEN - "LIME", // 34 // SKINCOLOR_LIME - "TEA", // 35 // SKINCOLOR_TEA - "PISTACHIO", // 36 // SKINCOLOR_PISTACHIO - "ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD - "MOSS", // 38 // SKINCOLOR_MOSS - "MINT", // 39 // SKINCOLOR_MINT - "GREEN", // 40 // SKINCOLOR_GREEN - "PINETREE", // 41 // SKINCOLOR_PINETREE - "EMERALD", // 42 // SKINCOLOR_EMERALD - "SWAMP", // 43 // SKINCOLOR_SWAMP - "DREAM", // 44 // SKINCOLOR_DREAM - "AQUA", // 45 // SKINCOLOR_AQUA - "TEAL", // 46 // SKINCOLOR_TEAL - "CYAN", // 47 // SKINCOLOR_CYAN - "JAWZ", // 48 // SKINCOLOR_JAWZ - "CERULEAN", // 49 // SKINCOLOR_CERULEAN - "NAVY", // 50 // SKINCOLOR_NAVY - "SLATE", // 51 // SKINCOLOR_SLATE - "STEEL", // 52 // SKINCOLOR_STEEL - "JET", // 53 // SKINCOLOR_JET - "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE - "PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE - "BLUE", // 56 // SKINCOLOR_BLUE - "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY - "DUSK", // 58 // SKINCOLOR_DUSK - "PURPLE", // 59 // SKINCOLOR_PURPLE - "LAVENDER", // 60 // SKINCOLOR_LAVENDER - "BYZANTIUM", // 61 // SKINCOLOR_BYZANTIUM - "POMEGRANATE", // 62 // SKINCOLOR_POMEGRANATE - "LILAC", // 63 // SKINCOLOR_LILAC + "NONE", // SKINCOLOR_NONE + "WHITE", // SKINCOLOR_WHITE + "SILVER", // SKINCOLOR_SILVER + "GREY", // SKINCOLOR_GREY + "NICKEL", // SKINCOLOR_NICKEL + "BLACK", // SKINCOLOR_BLACK + "SEPIA", // SKINCOLOR_SEPIA + "BEIGE", // SKINCOLOR_BEIGE + "BROWN", // SKINCOLOR_BROWN + "LEATHER", // SKINCOLOR_LEATHER + "SALMON", // SKINCOLOR_SALMON + "PINK", // SKINCOLOR_PINK + "ROSE", // SKINCOLOR_ROSE + "RUBY", // SKINCOLOR_RUBY + "RASPBERRY", // SKINCOLOR_RASPBERRY + "CHERRY", // SKINCOLOR_CHERRY + "RED", // SKINCOLOR_RED + "SCARLET", // SKINCOLOR_SCARLET + "CRIMSON", // SKINCOLOR_CRIMSON + "NOVA", // SKINCOLOR_NOVA + "KETCHUP", // SKINCOLOR_KETCHUP + "DAWN", // SKINCOLOR_DAWN + "CREAMSICLE", // SKINCOLOR_CREAMSICLE + "ORANGE", // SKINCOLOR_ORANGE + "PUMPKIN", // SKINCOLOR_PUMPKIN + "ROSEWOOD", // SKINCOLOR_ROSEWOOD + "BURGUNDY", // SKINCOLOR_BURGUNDY + "TANGERINE", // SKINCOLOR_TANGERINE + "PEACH", // SKINCOLOR_PEACH + "CARAMEL", // SKINCOLOR_CARAMEL + "CREAM", // SKINCOLOR_CREAM + "GOLD", // SKINCOLOR_GOLD + "BRONZE", // SKINCOLOR_BRONZE + "COPPER", // SKINCOLOR_COPPER + "YELLOW", // SKINCOLOR_YELLOW + "MUSTARD", // SKINCOLOR_MUSTARD + "OLIVE", // SKINCOLOR_OLIVE + "VOMIT", // SKINCOLOR_VOMIT + "GARDEN", // SKINCOLOR_GARDEN + "LIME", // SKINCOLOR_LIME + "HANDHELD", // SKINCOLOR_HANDHELD + "TEA", // SKINCOLOR_TEA + "PISTACHIO", // SKINCOLOR_PISTACHIO + "ROBOHOOD", // SKINCOLOR_ROBOHOOD + "MOSS", // SKINCOLOR_MOSS + "MINT", // SKINCOLOR_MINT + "GREEN", // SKINCOLOR_GREEN + "PINETREE", // SKINCOLOR_PINETREE + "EMERALD", // SKINCOLOR_EMERALD + "SWAMP", // SKINCOLOR_SWAMP + "DREAM", // SKINCOLOR_DREAM + "ALGAE", // SKINCOLOR_ALGAE + "AQUA", // SKINCOLOR_AQUA + "TEAL", // SKINCOLOR_TEAL + "CYAN", // SKINCOLOR_CYAN + "JAWZ", // SKINCOLOR_JAWZ + "CERULEAN", // SKINCOLOR_CERULEAN + "NAVY", // SKINCOLOR_NAVY + "SLATE", // SKINCOLOR_SLATE + "STEEL", // SKINCOLOR_STEEL + "JET", // SKINCOLOR_JET + "SAPPHIRE", // SKINCOLOR_SAPPHIRE + "PERIWINKLE", // SKINCOLOR_PERIWINKLE + "BLUE", // SKINCOLOR_BLUE + "BLUEBERRY", // SKINCOLOR_BLUEBERRY + "PASTEL", // SKINCOLOR_PASTEL + "DUSK", // SKINCOLOR_DUSK + "PURPLE", // SKINCOLOR_PURPLE + "FUCHSIA", // SKINCOLOR_FUCHSIA + "TOXIC", // SKINCOLOR_TOXIC + "LAVENDER", // SKINCOLOR_LAVENDER + "BYZANTIUM", // SKINCOLOR_BYZANTIUM + "POMEGRANATE", // SKINCOLOR_POMEGRANATE + "LILAC", // SKINCOLOR_LILAC // Special super colors // Super Sonic Yellow diff --git a/src/doomdef.h b/src/doomdef.h index 338bd7e6..7fc92f48 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -265,8 +265,11 @@ typedef enum SKINCOLOR_ROSE, SKINCOLOR_RUBY, SKINCOLOR_RASPBERRY, + SKINCOLOR_CHERRY, SKINCOLOR_RED, + SKINCOLOR_SCARLET, SKINCOLOR_CRIMSON, + SKINCOLOR_NOVA, SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, SKINCOLOR_CREAMSICLE, @@ -277,14 +280,17 @@ typedef enum SKINCOLOR_TANGERINE, SKINCOLOR_PEACH, SKINCOLOR_CARAMEL, + SKINCOLOR_CREAM, SKINCOLOR_GOLD, SKINCOLOR_BRONZE, + SKINCOLOR_COPPER, SKINCOLOR_YELLOW, SKINCOLOR_MUSTARD, SKINCOLOR_OLIVE, SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, SKINCOLOR_LIME, + SKINCOLOR_HANDHELD, SKINCOLOR_TEA, SKINCOLOR_PISTACHIO, SKINCOLOR_ROBOHOOD, @@ -295,6 +301,7 @@ typedef enum SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, SKINCOLOR_DREAM, + SKINCOLOR_ALGAE, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, @@ -308,8 +315,11 @@ typedef enum SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, SKINCOLOR_BLUEBERRY, + SKINCOLOR_PASTEL, SKINCOLOR_DUSK, SKINCOLOR_PURPLE, + SKINCOLOR_FUCHSIA, + SKINCOLOR_TOXIC, SKINCOLOR_LAVENDER, SKINCOLOR_BYZANTIUM, SKINCOLOR_POMEGRANATE, diff --git a/src/hu_stuff.c b/src/hu_stuff.c index a9aa7c56..94cca970 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -795,15 +795,15 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x85"; // V_REDMAP else if (color <= SKINCOLOR_TANGERINE) cstart = "\x87"; // V_ORANGEMAP - else if (color <= SKINCOLOR_CARAMEL) + else if (color <= SKINCOLOR_CREAM) cstart = "\x8f"; // V_PEACHMAP - else if (color <= SKINCOLOR_BRONZE) + else if (color <= SKINCOLOR_COPPER) cstart = "\x8A"; // V_GOLDMAP else if (color <= SKINCOLOR_OLIVE) cstart = "\x82"; // V_YELLOWMAP else if (color <= SKINCOLOR_PISTACHIO) cstart = "\x8b"; // V_TEAMAP - else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME) + else if (color <= SKINCOLOR_ALGAE || color == SKINCOLOR_LIME || color == SKINCOLOR_HANDHELD) cstart = "\x83"; // V_GREENMAP else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) cstart = "\x88"; // V_SKYMAP diff --git a/src/k_kart.c b/src/k_kart.c index eb3a4fc1..17db15e6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -43,139 +43,159 @@ // These should be within 14 characters to fit on the character select screen const char *KartColor_Names[MAXSKINCOLORS] = { - "None", // 00 // SKINCOLOR_NONE - "White", // 01 // SKINCOLOR_WHITE - "Silver", // 02 // SKINCOLOR_SILVER - "Grey", // 03 // SKINCOLOR_GREY - "Nickel", // 04 // SKINCOLOR_NICKEL - "Black", // 05 // SKINCOLOR_BLACK - "Sepia", // 06 // SKINCOLOR_SEPIA - "Beige", // 07 // SKINCOLOR_BEIGE - "Brown", // 08 // SKINCOLOR_BROWN - "Leather", // 09 // SKINCOLOR_LEATHER - "Salmon", // 10 // SKINCOLOR_SALMON - "Pink", // 11 // SKINCOLOR_PINK - "Rose", // 12 // SKINCOLOR_ROSE - "Ruby", // 13 // SKINCOLOR_RUBY - "Raspberry", // 14 // SKINCOLOR_RASPBERRY - "Red", // 15 // SKINCOLOR_RED - "Crimson", // 16 // SKINCOLOR_CRIMSON - "Ketchup", // 17 // SKINCOLOR_KETCHUP - "Dawn", // 18 // SKINCOLOR_DAWN - "Creamsicle", // 19 // SKINCOLOR_CREAMSICLE - "Orange", // 20 // SKINCOLOR_ORANGE - "Pumpkin", // 21 // SKINCOLOR_PUMPKIN - "Rosewood", // 22 // SKINCOLOR_ROSEWOOD - "Burgundy", // 23 // SKINCOLOR_BURGUNDY - "Tangerine", // 24 // SKINCOLOR_TANGERINE - "Peach", // 25 // SKINCOLOR_PEACH - "Caramel", // 26 // SKINCOLOR_CARAMEL - "Gold", // 27 // SKINCOLOR_GOLD - "Bronze", // 28 // SKINCOLOR_BRONZE - "Yellow", // 29 // SKINCOLOR_YELLOW - "Mustard", // 30 // SKINCOLOR_MUSTARD - "Olive", // 31 // SKINCOLOR_OLIVE - "Vomit", // 32 // SKINCOLOR_VOMIT - "Garden", // 33 // SKINCOLOR_GARDEN - "Lime", // 34 // SKINCOLOR_LIME - "Tea", // 35 // SKINCOLOR_TEA - "Pistachio", // 36 // SKINCOLOR_PISTACHIO - "Robo-Hood", // 37 // SKINCOLOR_ROBOHOOD - "Moss", // 38 // SKINCOLOR_MOSS - "Mint", // 39 // SKINCOLOR_MINT - "Green", // 40 // SKINCOLOR_GREEN - "Pinetree", // 41 // SKINCOLOR_PINETREE - "Emerald", // 42 // SKINCOLOR_EMERALD - "Swamp", // 43 // SKINCOLOR_SWAMP - "Dream", // 44 // SKINCOLOR_DREAM - "Aqua", // 45 // SKINCOLOR_AQUA - "Teal", // 46 // SKINCOLOR_TEAL - "Cyan", // 47 // SKINCOLOR_CYAN - "Jawz", // 48 // SKINCOLOR_JAWZ - "Cerulean", // 49 // SKINCOLOR_CERULEAN - "Navy", // 50 // SKINCOLOR_NAVY - "Slate", // 51 // SKINCOLOR_SLATE - "Steel", // 52 // SKINCOLOR_STEEL - "Jet", // 53 // SKINCOLOR_JET - "Sapphire", // 54 // SKINCOLOR_SAPPHIRE - "Periwinkle", // 55 // SKINCOLOR_PERIWINKLE - "Blue", // 56 // SKINCOLOR_BLUE - "Blueberry", // 57 // SKINCOLOR_BLUEBERRY - "Dusk", // 58 // SKINCOLOR_DUSK - "Purple", // 59 // SKINCOLOR_PURPLE - "Lavender", // 60 // SKINCOLOR_LAVENDER - "Byzantium", // 61 // SKINCOLOR_BYZANTIUM - "Pomegranate", // 62 // SKINCOLOR_POMEGRANATE - "Lilac" // 63 // SKINCOLOR_LILAC + "None", // SKINCOLOR_NONE + "White", // SKINCOLOR_WHITE + "Silver", // SKINCOLOR_SILVER + "Grey", // SKINCOLOR_GREY + "Nickel", // SKINCOLOR_NICKEL + "Black", // SKINCOLOR_BLACK + "Sepia", // SKINCOLOR_SEPIA + "Beige", // SKINCOLOR_BEIGE + "Brown", // SKINCOLOR_BROWN + "Leather", // SKINCOLOR_LEATHER + "Salmon", // SKINCOLOR_SALMON + "Pink", // SKINCOLOR_PINK + "Rose", // SKINCOLOR_ROSE + "Ruby", // SKINCOLOR_RUBY + "Raspberry", // SKINCOLOR_RASPBERRY + "Cherry", // SKINCOLOR_CHERRY + "Red", // SKINCOLOR_RED + "Scarlet", // SKINCOLOR_SCARLET + "Crimson", // SKINCOLOR_CRIMSON + "Nova", // SKINCOLOR_NOVA + "Ketchup", // SKINCOLOR_KETCHUP + "Dawn", // SKINCOLOR_DAWN + "Creamsicle", // SKINCOLOR_CREAMSICLE + "Orange", // SKINCOLOR_ORANGE + "Pumpkin", // SKINCOLOR_PUMPKIN + "Rosewood", // SKINCOLOR_ROSEWOOD + "Burgundy", // SKINCOLOR_BURGUNDY + "Tangerine", // SKINCOLOR_TANGERINE + "Peach", // SKINCOLOR_PEACH + "Caramel", // SKINCOLOR_CARAMEL + "Cream", // SKINCOLOR_CREAM + "Gold", // SKINCOLOR_GOLD + "Bronze", // SKINCOLOR_BRONZE + "Copper", // SKINCOLOR_COPPER + "Yellow", // SKINCOLOR_YELLOW + "Mustard", // SKINCOLOR_MUSTARD + "Olive", // SKINCOLOR_OLIVE + "Vomit", // SKINCOLOR_VOMIT + "Garden", // SKINCOLOR_GARDEN + "Lime", // SKINCOLOR_LIME + "Handheld", // SKINCOLOR_HANDHELD + "Tea", // SKINCOLOR_TEA + "Pistachio", // SKINCOLOR_PISTACHIO + "Robo-Hood", // SKINCOLOR_ROBOHOOD + "Moss", // SKINCOLOR_MOSS + "Mint", // SKINCOLOR_MINT + "Green", // SKINCOLOR_GREEN + "Pinetree", // SKINCOLOR_PINETREE + "Emerald", // SKINCOLOR_EMERALD + "Swamp", // SKINCOLOR_SWAMP + "Dream", // SKINCOLOR_DREAM + "Algae", // SKINCOLOR_ALGAE + "Aqua", // SKINCOLOR_AQUA + "Teal", // SKINCOLOR_TEAL + "Cyan", // SKINCOLOR_CYAN + "Jawz", // SKINCOLOR_JAWZ + "Cerulean", // SKINCOLOR_CERULEAN + "Navy", // SKINCOLOR_NAVY + "Slate", // SKINCOLOR_SLATE + "Steel", // SKINCOLOR_STEEL + "Jet", // SKINCOLOR_JET + "Sapphire", // SKINCOLOR_SAPPHIRE + "Periwinkle", // SKINCOLOR_PERIWINKLE + "Blue", // SKINCOLOR_BLUE + "Blueberry", // SKINCOLOR_BLUEBERRY + "Pastel", // SKINCOLOR_PASTEL + "Dusk", // SKINCOLOR_DUSK + "Purple", // SKINCOLOR_PURPLE + "Fuchsia", // SKINCOLOR_FUCHSIA + "Toxic", // SKINCOLOR_TOXIC + "Lavender", // SKINCOLOR_LAVENDER + "Byzantium", // SKINCOLOR_BYZANTIUM + "Pomegranate", // SKINCOLOR_POMEGRANATE + "Lilac" // SKINCOLOR_LILAC }; // Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = { - SKINCOLOR_NONE,8, // 00 // SKINCOLOR_NONE - SKINCOLOR_BLACK,8, // 01 // SKINCOLOR_WHITE - SKINCOLOR_NICKEL,8, // 02 // SKINCOLOR_SILVER - SKINCOLOR_GREY,8, // 03 // SKINCOLOR_GREY - SKINCOLOR_SILVER,8, // 04 // SKINCOLOR_NICKEL - SKINCOLOR_WHITE,8, // 05 // SKINCOLOR_BLACK - SKINCOLOR_LEATHER,6, // 06 // SKINCOLOR_SEPIA - SKINCOLOR_BROWN,2, // 07 // SKINCOLOR_BEIGE - SKINCOLOR_BEIGE,8, // 08 // SKINCOLOR_BROWN - SKINCOLOR_SEPIA,8, // 09 // SKINCOLOR_LEATHER - SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON - SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK - SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE - SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY - SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY - SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED - SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON - SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP - SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN - SKINCOLOR_PERIWINKLE,8, // 19 // SKINCOLOR_CREAMSICLE - SKINCOLOR_BLUE,8, // 20 // SKINCOLOR_ORANGE - SKINCOLOR_BLUEBERRY,8, // 21 // SKINCOLOR_PUMPKIN - SKINCOLOR_NAVY,6, // 22 // SKINCOLOR_ROSEWOOD - SKINCOLOR_JET,8, // 23 // SKINCOLOR_BURGUNDY - SKINCOLOR_LIME,8, // 24 // SKINCOLOR_TANGERINE - SKINCOLOR_CYAN,8, // 25 // SKINCOLOR_PEACH - SKINCOLOR_CERULEAN,8, // 26 // SKINCOLOR_CARAMEL - SKINCOLOR_SLATE,8, // 27 // SKINCOLOR_GOLD - SKINCOLOR_STEEL,8, // 28 // SKINCOLOR_BRONZE - SKINCOLOR_AQUA,8, // 29 // SKINCOLOR_YELLOW - SKINCOLOR_KETCHUP,8, // 30 // SKINCOLOR_MUSTARD - SKINCOLOR_TEAL,8, // 31 // SKINCOLOR_OLIVE - SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT - SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN - SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME - SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA - SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO - SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD - SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS - SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT - SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN - SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE - SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD - SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP - SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM - SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA - SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL - SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN - SKINCOLOR_LILAC,10, // 48 // SKINCOLOR_JAWZ - SKINCOLOR_CARAMEL,8, // 49 // SKINCOLOR_CERULEAN - SKINCOLOR_ROSEWOOD,8, // 50 // SKINCOLOR_NAVY - SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE - SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL - SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET - SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE - SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE - SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE - SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY - SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK - SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE - SKINCOLOR_GARDEN,6, // 60 // SKINCOLOR_LAVENDER - SKINCOLOR_SWAMP,8, // 61 // SKINCOLOR_BYZANTIUM - SKINCOLOR_DREAM,8, // 62 // SKINCOLOR_POMEGRANATE - SKINCOLOR_JAWZ,6 // 63 // SKINCOLOR_LILAC + SKINCOLOR_NONE,8, // SKINCOLOR_NONE + SKINCOLOR_BLACK,8, // SKINCOLOR_WHITE + SKINCOLOR_NICKEL,8, // SKINCOLOR_SILVER + SKINCOLOR_GREY,8, // SKINCOLOR_GREY + SKINCOLOR_SILVER,8, // SKINCOLOR_NICKEL + SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK + SKINCOLOR_LEATHER,6, // SKINCOLOR_SEPIA + SKINCOLOR_BROWN,2, // SKINCOLOR_BEIGE + SKINCOLOR_BEIGE,8, // SKINCOLOR_BROWN + SKINCOLOR_SEPIA,8, // SKINCOLOR_LEATHER + SKINCOLOR_TEA,8, // SKINCOLOR_SALMON + SKINCOLOR_PISTACHIO,8, // SKINCOLOR_PINK + SKINCOLOR_MOSS,8, // SKINCOLOR_ROSE + SKINCOLOR_SAPPHIRE,8, // SKINCOLOR_RUBY + SKINCOLOR_MINT,8, // SKINCOLOR_RASPBERRY + SKINCOLOR_HANDHELD,10, // SKINCOLOR_CHERRY + SKINCOLOR_GREEN,6, // SKINCOLOR_RED + SKINCOLOR_PINETREE,6, // SKINCOLOR_SCARLET + SKINCOLOR_TOXIC,8, // SKINCOLOR_CRIMSON + SKINCOLOR_ALGAE,10, // SKINCOLOR_NOVA + SKINCOLOR_MUSTARD,10, // SKINCOLOR_KETCHUP + SKINCOLOR_DUSK,8, // SKINCOLOR_DAWN + SKINCOLOR_PERIWINKLE,8, // SKINCOLOR_CREAMSICLE + SKINCOLOR_BLUE,8, // SKINCOLOR_ORANGE + SKINCOLOR_BLUEBERRY,8, // SKINCOLOR_PUMPKIN + SKINCOLOR_NAVY,6, // SKINCOLOR_ROSEWOOD + SKINCOLOR_JET,8, // SKINCOLOR_BURGUNDY + SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE + SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH + SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL + SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM + SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD + SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE + SKINCOLOR_CREAM,6, // SKINCOLOR_COPPER + SKINCOLOR_AQUA,8, // SKINCOLOR_YELLOW + SKINCOLOR_KETCHUP,8, // SKINCOLOR_MUSTARD + SKINCOLOR_TEAL,8, // SKINCOLOR_OLIVE + SKINCOLOR_ROBOHOOD,8, // SKINCOLOR_VOMIT + SKINCOLOR_LAVENDER,6, // SKINCOLOR_GARDEN + SKINCOLOR_TANGERINE,8, // SKINCOLOR_LIME + SKINCOLOR_CHERRY,8, // SKINCOLOR_HANDHELD + SKINCOLOR_SALMON,8, // SKINCOLOR_TEA + SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // SKINCOLOR_ROBOHOOD + SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT + SKINCOLOR_RED,8, // SKINCOLOR_GREEN + SKINCOLOR_SCARLET,8, // SKINCOLOR_PINETREE + SKINCOLOR_PURPLE,8, // SKINCOLOR_EMERALD + SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP + SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM + SKINCOLOR_NOVA,10, // SKINCOLOR_ALGAE + SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUA + SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL + SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN + SKINCOLOR_LILAC,10, // SKINCOLOR_JAWZ + SKINCOLOR_CARAMEL,8, // SKINCOLOR_CERULEAN + SKINCOLOR_ROSEWOOD,8, // SKINCOLOR_NAVY + SKINCOLOR_GOLD,10, // SKINCOLOR_SLATE + SKINCOLOR_BRONZE,10, // SKINCOLOR_STEEL + SKINCOLOR_BURGUNDY,8, // SKINCOLOR_JET + SKINCOLOR_RUBY,6, // SKINCOLOR_SAPPHIRE + SKINCOLOR_CREAMSICLE,8, // SKINCOLOR_PERIWINKLE + SKINCOLOR_ORANGE,8, // SKINCOLOR_BLUE + SKINCOLOR_PUMPKIN,8, // SKINCOLOR_BLUEBERRY + SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL + SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK + SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE + SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA + SKINCOLOR_CRIMSON,8, // SKINCOLOR_TOXIC + SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER + SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM + SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE + SKINCOLOR_JAWZ,6 // SKINCOLOR_LILAC }; UINT8 colortranslations[MAXTRANSLATIONS][16] = { @@ -194,8 +214,11 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {120, 121, 144, 145, 147, 149, 132, 133, 134, 136, 198, 198, 199, 255, 30, 31}, // SKINCOLOR_RUBY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 134, 136, 137, 139, 140}, // SKINCOLOR_RASPBERRY + {120, 65, 67, 69, 71, 124, 125, 127, 132, 133, 135, 136, 138, 139, 140, 141}, // SKINCOLOR_CHERRY {122, 123, 124, 126, 129, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142}, // SKINCOLOR_RED - {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_CRIMSON + {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_SCARLET + {123, 124, 126, 128, 132, 135, 137, 63, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_CRIMSON + { 99, 113, 113, 84, 85, 87, 126, 128, 130, 196, 197, 198, 199, 240, 243, 246}, // SKINCOLOR_NOVA {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 120, 80, 80, 81, 82, 83, 83, 84, 85, 86, 88, 89, 91, 93, 95}, // SKINCOLOR_CREAMSICLE @@ -204,19 +227,22 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 83, 85, 88, 90, 92, 94, 152, 153, 154, 156, 157, 159, 140, 141, 142, 143}, // SKINCOLOR_ROSEWOOD { 84, 86, 89, 91, 152, 154, 155, 157, 158, 159, 140, 141, 142, 143, 31, 31}, // SKINCOLOR_BURGUNDY { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE - {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_PEACH + {120, 80, 66, 70, 72, 76, 148, 149, 150, 151, 153, 154, 156, 61, 62, 63}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL + {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_CREAM {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE + {120, 99, 113, 114, 116, 117, 119, 61, 63, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_COPPER { 96, 97, 98, 100, 101, 102, 104, 113, 114, 115, 116, 117, 118, 119, 156, 159}, // SKINCOLOR_YELLOW { 96, 98, 99, 112, 113, 114, 114, 106, 106, 107, 107, 108, 108, 109, 110, 111}, // SKINCOLOR_MUSTARD {105, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31}, // SKINCOLOR_OLIVE {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME + { 98, 104, 105, 105, 106, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_HANDHELD {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO - {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD + {120, 176, 178, 165, 167, 168, 169, 182, 182, 171, 171, 172, 173, 174, 175, 30}, // SKINCOLOR_ROBOHOOD {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN @@ -224,6 +250,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {160, 184, 185, 186, 187, 188, 189, 190, 191, 191, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM + {208, 209, 210, 211, 213, 220, 216, 167, 168, 188, 188, 189, 190, 191, 30, 31}, // SKINCOLOR_ALGAE {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN @@ -237,8 +264,11 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {120, 120, 224, 225, 226, 202, 227, 228, 229, 230, 231, 233, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 236, 238, 242, 244, 246}, // SKINCOLOR_BLUE {226, 228, 229, 230, 232, 233, 235, 237, 239, 240, 242, 244, 246, 31, 31, 31}, // SKINCOLOR_BLUEBERRY + {120, 208, 209, 210, 211, 226, 202, 249, 194, 195, 196, 197, 198, 199, 255, 30}, // SKINCOLOR_PASTEL {121, 145, 192, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {121, 145, 192, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_PURPLE + {120, 122, 124, 125, 126, 150, 196, 197, 198, 198, 199, 199, 240, 242, 244, 246}, // SKINCOLOR_FUCHSIA + {120, 120, 176, 176, 177, 6, 8, 10, 249, 250, 196, 197, 198, 199, 143, 31}, // SKINCOLOR_TOXIC {121, 145, 192, 248, 249, 250, 251, 252, 252, 253, 253, 254, 254, 255, 30, 31}, // SKINCOLOR_LAVENDER {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE @@ -4257,7 +4287,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) else { player->mo->colorized = true; - player->mo->color = SKINCOLOR_CRIMSON; + player->mo->color = SKINCOLOR_SCARLET; } } else if (player->kartstuff[k_invincibilitytimer]) // setting players to use the star colormap and spawning afterimages From 3b9c4fff521d00e9dbd6dbfe8b5e3267aa153092 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 27 Feb 2019 15:43:29 -0500 Subject: [PATCH 53/58] Upped MAXNETNODES --- src/d_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_net.h b/src/d_net.h index 9cc1bbd2..2efb6d9c 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -19,7 +19,7 @@ #define __D_NET__ // Max computers in a game -#define MAXNETNODES 16 +#define MAXNETNODES MAXPLAYERS+4 #define BROADCASTADDR MAXNETNODES #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer #define NETSPLITSCREEN // Kart's splitscreen netgame feature From 5975d3fb3004d1e82006b11b07ec9c46be2df49f Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 27 Feb 2019 15:55:39 -0500 Subject: [PATCH 54/58] Add some parentheses --- src/d_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_net.h b/src/d_net.h index 2efb6d9c..8e518e40 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -19,7 +19,7 @@ #define __D_NET__ // Max computers in a game -#define MAXNETNODES MAXPLAYERS+4 +#define MAXNETNODES (MAXPLAYERS+4) #define BROADCASTADDR MAXNETNODES #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer #define NETSPLITSCREEN // Kart's splitscreen netgame feature From 56e8f09ae8335327cf6a8c7484ead411a09c84f9 Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Mon, 4 Mar 2019 16:33:06 -0500 Subject: [PATCH 55/58] fixed compiling for MSVC 2017 --- src/hardware/r_opengl/r_opengl.c | 4 ++-- src/k_kart.c | 3 ++- src/p_user.c | 2 +- src/r_things.c | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3a8be6a0..0c4dfdce 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2056,7 +2056,7 @@ EXPORT void HWRAPI(DrawMD2) (INT32 *gl_cmd_buffer, md2_frame_t *frame, FTransfor EXPORT void HWRAPI(SetTransform) (FTransform *stransform) { static boolean special_splitscreen; - float used_fov; + double used_fov; pglLoadIdentity(); if (stransform) { @@ -2088,7 +2088,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform) pglLoadIdentity(); if (special_splitscreen) { - used_fov = atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI; + used_fov = atan(tan(used_fov*M_PIl/360)*0.8)*360/M_PIl; GLPerspective(used_fov, 2*ASPECT_RATIO); } else diff --git a/src/k_kart.c b/src/k_kart.c index 8e607191..f5fe06bc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1191,10 +1191,11 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) return; { // Normalize distance to the sum of the two objects' radii, since in a perfect world that would be the distance at the point of collision... - fixed_t dist = P_AproxDistance(distx, disty) ?: 1; + fixed_t dist = P_AproxDistance(distx, disty); fixed_t nx = FixedDiv(distx, dist); fixed_t ny = FixedDiv(disty, dist); + dist = dist ? dist : 1; distx = FixedMul(mobj1->radius+mobj2->radius, nx); disty = FixedMul(mobj1->radius+mobj2->radius, ny); diff --git a/src/p_user.c b/src/p_user.c index e26acdfd..7350b921 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6662,7 +6662,7 @@ static void P_MovePlayer(player_t *player) //CONS_Printf("leftover turn (%s): %5d or %4d%%\n", // player_names[player-players], // (INT16) (cmd->angleturn - (player->mo->angle>>16)), - // (INT16) (cmd->angleturn - (player->mo->angle>>16)) * 100 / (angle_diff ?: 1)); + // (INT16) (cmd->angleturn - (player->mo->angle>>16)) * 100 / (angle_diff ? angle_diff : 1)); } } diff --git a/src/r_things.c b/src/r_things.c index e4eaf413..59a904cb 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1314,7 +1314,8 @@ static void R_ProjectSprite(mobj_t *thing) if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier return; - scalestep = (yscale2 - yscale)/(x2 - x1) ?: 1; + scalestep = (yscale2 - yscale)/(x2 - x1); + scalestep = scalestep ? scalestep : 1; // The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2? // sortscale = max(yscale, yscale2); From 145ccfd4056018bcda1020050a7eee9a8f519ea9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 4 Mar 2019 16:44:15 -0500 Subject: [PATCH 56/58] no more floating constants warnings, and disable bad array bounds warnings --- src/Makefile.cfg | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 9e624cc7..b6faf446 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -189,12 +189,6 @@ ifdef GCC46 WFLAGS+=-Wno-suggest-attribute=noreturn endif -ifndef MINGW -ifdef GCC45 -WFLAGS+=-Wunsuffixed-float-constants -endif -endif - ifdef NOLDWARNING LDFLAGS+=-Wl,--as-needed endif @@ -208,6 +202,9 @@ WFLAGS+=$(OLDWFLAGS) ifdef GCC43 #WFLAGS+=-Wno-error=clobbered endif +ifdef GCC44 + WFLAGS+=-Wno-error=array-bounds +endif ifdef GCC46 WFLAGS+=-Wno-error=suggest-attribute=noreturn endif From 67e246cd53aea71e78bed11d0dd61e529b77b45b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 4 Mar 2019 16:45:24 -0500 Subject: [PATCH 57/58] No more errors for VC6 support --- src/Makefile.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index b6faf446..236d7ae2 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -116,6 +116,7 @@ WFLAGS+=-Wfloat-equal #WFLAGS+=-Wtraditional ifdef VCHELP WFLAGS+=-Wdeclaration-after-statement + WFLAGS+=-Wno-error=declaration-after-statement endif WFLAGS+=-Wundef ifndef GCC295 From 3fa175170624527bbca9ab140b966899d0fe2b13 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 4 Mar 2019 16:51:39 -0500 Subject: [PATCH 58/58] CircleCi: we need SSH for buildbot --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3129c3bd..c3674a9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - v1-SRB2-APT - run: name: Install SDK - command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx + command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx openssh-client - save_cache: key: v1-SRB2-APT paths: