From 8ba32064a8e37e4d36b86d78dd2b60461938b11d Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 12 Sep 2022 22:24:40 +0100 Subject: [PATCH 01/22] Clean up recent IP handling a bunch. --- src/d_clisrv.c | 8 ++++---- src/k_menudraw.c | 19 ++++++++++++------- src/m_misc.c | 19 +++++++++++++------ 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f8934c2a8..6305617cb 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2087,10 +2087,10 @@ static void CL_ConnectToServer(void) // @TODO: Save the proper server name, right now it doesn't seem like we can consistently retrieve it from the serverlist....? // It works... sometimes but not always which is weird. - if (*joinedIP && strlen(joinedIP)) // false if we have "" which is \0 + if (joinedIP[0]) // false if we have "" which is \0 M_AddToJoinedIPs(joinedIP, netbuffer->u.serverinfo.servername); - strcpy(joinedIP, ""); // And empty this for good measure regardless of whether or not we actually used it. + joinedIP[0] = '\0'; // And empty this for good measure regardless of whether or not we actually used it. } @@ -2262,7 +2262,7 @@ static void Command_connect(void) { // By default, clear the saved address that we'd save after succesfully joining just to be sure: - strcpy(joinedIP, ""); + joinedIP[0] = '\0'; if (COM_Argc() < 2 || *COM_Argv(1) == 0) { @@ -3730,7 +3730,7 @@ void SV_StartSinglePlayerServer(void) server = true; netgame = false; multiplayer = false; - strcpy(joinedIP, ""); // Make sure to empty this so that we don't save garbage when we start our own game. (because yes we use this for netgames too....) + joinedIP[0] = '\0'; // Make sure to empty this so that we don't save garbage when we start our own game. (because yes we use this for netgames too....) if ((modeattacking == ATTACKING_CAPSULES) || (bossinfo.boss == true)) { diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 76a001544..8c4ecc121 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2339,7 +2339,7 @@ void M_DrawMPHost(void) case IT_CV_STRING: V_DrawThinString(xp + 96, yp, V_ALLOWLOWERCASE|V_6WIDTHSPACE, cv->string); if (skullAnimCounter < 4 && i == itemOn) - V_DrawString(xp + 94 + V_ThinStringWidth(cv->string, V_6WIDTHSPACE), yp+1, 0, "_"); + V_DrawString(xp + 96 + V_ThinStringWidth(cv->string, V_ALLOWLOWERCASE|V_6WIDTHSPACE), yp+1, 0, "_"); break; @@ -2404,15 +2404,20 @@ void M_DrawMPJoinIP(void) if (currentMenu->numitems - i <= NUMLOGIP) { UINT8 index = NUMLOGIP - (currentMenu->numitems - i); - if (strlen(joinedIPlist[index][1])) // Try drawing server name + if (index == 0) + { + xp += 8; + } + + if (joinedIPlist[index][1][0]) // Try drawing server name strcpy(str, joinedIPlist[index][1]); - else if (strlen(joinedIPlist[index][0])) // If that fails, get the address + else if (joinedIPlist[index][0][0]) // If that fails, get the address strcpy(str, joinedIPlist[index][0]); else strcpy(str, "---"); // If that fails too then there's nothing! } - V_DrawString(xp, yp, V_ALLOWLOWERCASE | ((i == itemOn || currentMenu->menuitems[i].status & IT_SPACE) ? highlightflags : 0), str); + V_DrawThinString(xp, yp, V_ALLOWLOWERCASE | ((i == itemOn || currentMenu->menuitems[i].status & IT_SPACE) ? highlightflags : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, str); // Cvar specific handling switch (currentMenu->menuitems[i].status & IT_TYPE) @@ -2427,10 +2432,10 @@ void M_DrawMPJoinIP(void) //colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE); colormapc = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE); - V_DrawFixedPatch((xp + 20)<string); + V_DrawFixedPatch((xp + 12)<string); if (skullAnimCounter < 4 && i == itemOn) - V_DrawCharacter(xp + 24 + V_ThinStringWidth(cv->string, 0), yp, '_' | 0x80, false); + V_DrawString(xp + 18 + V_ThinStringWidth(cv->string, V_ALLOWLOWERCASE|V_6WIDTHSPACE), yp+1, 0, "_"); /*// On this specific menu the only time we'll ever see this is for the connect by IP typefield. // Draw the small GO button here (and the text which is a separate graphic) diff --git a/src/m_misc.c b/src/m_misc.c index 0628ef3b6..796fcb90d 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -190,8 +190,7 @@ void M_InitJoinedIPArray(void) UINT8 i; for (i=0; i < NUMLOGIP; i++) { - strcpy(joinedIPlist[i][0], ""); - strcpy(joinedIPlist[i][1], ""); + joinedIPlist[i][0][0] = joinedIPlist[i][1][0] = '\0'; } } @@ -564,10 +563,18 @@ void M_LoadJoinedIPs(void) s = strtok(NULL, IPLOGFILESEP); // Let's get rid of this awful \n while we're here! - if (strlen(s)) - s[strlen(s)-1] = '\0'; // Remove the \n - - strcpy(joinedIPlist[i][1], s); + if (s) + { + //strcpy(joinedIPlist[i][1], s); -- get rid of \n too... + char *c = joinedIPlist[i][1]; + while (*s && *s != '\n') + { + *c = *s; + s++; + c++; + } + *c = '\0'; + } i++; } From c493ee9ee3798f30c4a20e98893a3179cb4fffe0 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 12:19:56 +0100 Subject: [PATCH 02/22] Connection screen adjustments - Request a press of (A) or (B) instead of ACCEL, BRAKE or ESC. - Support pressing (X) and ESC (hardcoded) as well, to cohere more with the menus. --- src/d_clisrv.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6305617cb..167003f2a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -581,7 +581,7 @@ static inline void CL_DrawConnectionStatus(void) // Draw bottom box M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort"); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press (B) to abort"); for (i = 0; i < 16; ++i) V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15)); @@ -644,7 +644,7 @@ static inline void CL_DrawConnectionStatus(void) INT32 checkednum = 0; INT32 i; - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort"); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press (B) to abort"); //ima just count files here for (i = 0; i < fileneedednum; i++) @@ -666,7 +666,7 @@ static inline void CL_DrawConnectionStatus(void) INT32 loadcompletednum = 0; INT32 i; - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort"); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press (B) to abort"); //ima just count files here for (i = 0; i < fileneedednum; i++) @@ -693,7 +693,7 @@ static inline void CL_DrawConnectionStatus(void) // Draw the bottom box. M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-58-8, 32, 1); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-14, V_YELLOWMAP, "Press ESC to abort"); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-14, V_YELLOWMAP, "Press (B) to abort"); Net_GetNetStat(); dldlength = (INT32)((file->currentsize/(double)file->totalsize) * 256); @@ -757,7 +757,7 @@ static inline void CL_DrawConnectionStatus(void) //Draw bottom box M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort"); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press (B) to abort"); for (i = 0; i < 16; ++i) V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15)); @@ -1489,7 +1489,7 @@ static void M_ConfirmConnect(event_t *ev) #ifndef NONET if (ev->type == ev_keydown) { - if (G_PlayerInputDown(0, gc_a, 1)) + if (G_PlayerInputDown(0, gc_a, 1) || gamekeydown[0][KEY_ENTER]) { if (totalfilesrequestednum > 0) { @@ -1512,7 +1512,7 @@ static void M_ConfirmConnect(event_t *ev) M_ClearMenus(true); } - else if (G_PlayerInputDown(0, gc_x, 1)) + else if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE]) { cl_mode = CL_ABORTED; M_ClearMenus(true); @@ -1542,7 +1542,7 @@ static boolean CL_FinishedFileList(void) "You have too many WAD files loaded\n" "to add ones the server is using.\n" "Please restart Ring Racers before connecting.\n\n" - "Press ESC\n" + "Press (B)\n" ), NULL, MM_NOTHING); return false; } @@ -1557,7 +1557,7 @@ static boolean CL_FinishedFileList(void) "the game and don't load any addons.\n" "Ring Racers will automatically add\n" "everything you need when you join.\n\n" - "Press ESC\n" + "Press (B)\n" ), NULL, MM_NOTHING); return false; } @@ -1570,7 +1570,7 @@ static boolean CL_FinishedFileList(void) "\n" "You may load server addons (if any), and wait for a slot.\n" "\n" - "Press ACCEL to continue or BRAKE to cancel.\n\n" + "Press (A) to continue or (B) to cancel.\n\n" ), FUNCPTRCAST (M_ConfirmConnect), MM_EVENTHANDLER); cl_mode = CL_CONFIRMCONNECT; } @@ -1597,7 +1597,7 @@ static boolean CL_FinishedFileList(void) "with the server, not your game.)\n\n" "See the console or log file\n" "for additional details.\n\n" - "Press ESC\n" + "Press (B)\n" ), NULL, MM_NOTHING); return false; } @@ -1637,13 +1637,13 @@ static boolean CL_FinishedFileList(void) "\n" "You may download, load server addons, and wait for a slot.\n" "\n" - "Press ACCEL to continue or BRAKE to cancel.\n\n" + "Press (A) to continue or (B) to cancel.\n\n" ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); else M_StartMessage(va(M_GetText( "Download of %s additional content is required to join.\n" "\n" - "Press ACCEL to continue or BRAKE to cancel.\n\n" + "Press (A) to continue or (B) to cancel.\n\n" ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); Z_Free(downloadsize); @@ -1862,7 +1862,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic "5 minute wait time exceeded.\n" "You may retry connection.\n" "\n" - "Press ESC\n" + "Press (B)\n" ), NULL, MM_NOTHING); return false; } @@ -1925,10 +1925,10 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic G_MapEventsToControls(&events[eventtail]); } - if (G_PlayerInputDown(0, gc_x, 1) || cl_mode == CL_ABORTED) + if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE] || cl_mode == CL_ABORTED) { CONS_Printf(M_GetText("Network game synchronization aborted.\n")); -// M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress ESC\n"), NULL, MM_NOTHING); +// M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress (B)\n"), NULL, MM_NOTHING); D_QuitNetGame(); CL_Reset(); @@ -2948,17 +2948,17 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) CL_Reset(); D_StartTitle(); if (msg == KICK_MSG_CON_FAIL) - M_StartMessage(M_GetText("Server closed connection\n(Synch failure)\nPress ESC\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("Server closed connection\n(Synch failure)\nPress (B)\n"), NULL, MM_NOTHING); else if (msg == KICK_MSG_PING_HIGH) - M_StartMessage(M_GetText("Server closed connection\n(Broke ping limit)\nPress ESC\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("Server closed connection\n(Broke ping limit)\nPress (B)\n"), NULL, MM_NOTHING); else if (msg == KICK_MSG_BANNED) - M_StartMessage(M_GetText("You have been banned by the server\n\nPress ESC\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("You have been banned by the server\n\nPress (B)\n"), NULL, MM_NOTHING); else if (msg == KICK_MSG_CUSTOM_KICK) - M_StartMessage(va(M_GetText("You have been kicked\n(%s)\nPress ESC\n"), reason), NULL, MM_NOTHING); + M_StartMessage(va(M_GetText("You have been kicked\n(%s)\nPress (B)\n"), reason), NULL, MM_NOTHING); else if (msg == KICK_MSG_CUSTOM_BAN) - M_StartMessage(va(M_GetText("You have been banned\n(%s)\nPress ESC\n"), reason), NULL, MM_NOTHING); + M_StartMessage(va(M_GetText("You have been banned\n(%s)\nPress (B)\n"), reason), NULL, MM_NOTHING); else - M_StartMessage(M_GetText("You have been kicked by the server\n\nPress ESC\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("You have been kicked by the server\n\nPress (B)\n"), NULL, MM_NOTHING); } else if (server) { @@ -3890,7 +3890,7 @@ static void HandleShutdown(SINT8 node) D_QuitNetGame(); CL_Reset(); D_StartTitle(); - M_StartMessage(M_GetText("Server has shutdown\n\nPress Esc\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("Server has shutdown\n\nPress (B)\n"), NULL, MM_NOTHING); } /** Called when a PT_NODETIMEOUT packet is received @@ -3905,7 +3905,7 @@ static void HandleTimeout(SINT8 node) D_QuitNetGame(); CL_Reset(); D_StartTitle(); - M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING); + M_StartMessage(M_GetText("Server Timeout\n\nPress (B)\n"), NULL, MM_NOTHING); } #ifndef NONET From 033d87fbe162c176e018562df007962d05914732 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 12:38:30 +0100 Subject: [PATCH 03/22] Adjust profile "guessing" - Remove block from using connect with uninitialised profile. Instead, CL_ConnectToServer handles the guess entirely. - Add splitscreen player initialisation in circumstances previously missing it --- src/d_clisrv.c | 33 ++++++--------------------------- src/d_main.c | 6 ++++++ src/g_game.c | 6 ++++++ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 167003f2a..93a91a3ff 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2018,7 +2018,13 @@ static void CL_ConnectToServer(void) } if (cv_currprofile.value == -1) + { PR_ApplyProfilePretend(cv_ttlprofilen.value, 0); + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); // clean up intermission graphics etc if (gamestate == GS_VOTING) @@ -2279,33 +2285,6 @@ static void Command_connect(void) CONS_Printf(M_GetText("You cannot connect while in a game. End this game first.\n")); return; } - else if (cv_currprofile.value == 0) - { - CONS_Printf(M_GetText("You cannot connect while using the Guest Profile. Use a Custom Profile to play Online.\n")); - return; - } - else if (cv_currprofile.value == -1) - { - // No profile set, we're attempting to connect from the title screen. (Discord RPC / connect command) - // Automatically apply the last profiles for every potential split player. - // Make sure Player 1's Profile ISN'T the guest profile even if we do that. - - UINT8 i; - - CONS_Printf(M_GetText("No Profile set, attempting to use last used Profiles...\n")); - - for (i = 0; i < cv_splitplayers.value; i++) - { - if (cv_lastprofile[i].value || i > 0) - PR_ApplyProfile(cv_lastprofile[i].value, i); - else - { - CONS_Printf(M_GetText("Player 1's last used Profile is the Guest Profile, which cannot be used to play Online.\n")); - return; - } - } - CONS_Printf(M_GetText("Profiles have been automatically set according to the last used Profiles.\n")); - } // modified game check: no longer handled // we don't request a restart unless the filelist differs diff --git a/src/d_main.c b/src/d_main.c index d7092a901..b24592d2d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1784,6 +1784,12 @@ void D_SRB2Main(void) // Has to be done before anything else so skin, color, etc in command buffer has an affect. // ttlprofilen used because it's roughly equivalent in functionality - a QoL aid for quickly getting from startup to action PR_ApplyProfile(cv_ttlprofilen.value, 0); + { + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } // Do this here so if you run SRB2 with eg +timelimit 5, the time limit counts // as having been modified for the first game. diff --git a/src/g_game.c b/src/g_game.c index 61013cf6c..af163aea4 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1266,7 +1266,13 @@ void G_DoLoadLevel(boolean resetplayer) wipegamestate = -1; // force a wipe if (cv_currprofile.value == -1) + { PR_ApplyProfilePretend(cv_ttlprofilen.value, 0); + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); if (gamestate == GS_VOTING) From 2d253e0105641efd54c2ee43b82aa22ba8cb1fb4 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 12:59:41 +0100 Subject: [PATCH 04/22] Clear menus in one location. Fixes a number of weird extra fade and gamestate set events. --- src/d_clisrv.c | 4 +--- src/k_menufunc.c | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 93a91a3ff..993afcb87 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2031,9 +2031,8 @@ static void CL_ConnectToServer(void) Y_EndVote(); DEBFILE(va("waiting %d nodes\n", doomcom->numnodes)); + M_ClearMenus(true); G_SetGamestate(GS_WAITINGPLAYERS); - if (wipegamestate == GS_MENU) - M_ClearMenus(true); wipegamestate = GS_WAITINGPLAYERS; ClearAdminPlayers(); @@ -2347,7 +2346,6 @@ static void Command_connect(void) SplitScreen_OnChange(); } - M_ClearMenus(true); CL_ConnectToServer(); } #endif diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 753a9b767..65047c372 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -3844,7 +3844,6 @@ void M_JoinIP(const char *ipa) } COM_BufAddText(va("connect \"%s\"\n", ipa)); - M_ClearMenus(true); // A little "please wait" message. M_DrawTextBox(56, BASEVIDHEIGHT/2-12, 24, 2); From d5e6d349a507dcd6934df2b8ef32d4565eaa10c9 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 13:16:34 +0100 Subject: [PATCH 05/22] Egga Channel background for connecting --- src/d_clisrv.c | 3 +-- src/k_menu.h | 2 ++ src/k_menudraw.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 993afcb87..b8463b994 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1952,8 +1952,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_DOWNLOADSAVEGAME) { - F_TitleScreenTicker(true); - F_TitleScreenDrawer(); + M_DrawEggaChannel(); } CL_DrawConnectionStatus(); #ifdef HAVE_THREADS diff --git a/src/k_menu.h b/src/k_menu.h index 415c54284..75160c22e 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -904,6 +904,8 @@ void M_HandleVideoModes(INT32 ch); // data stuff void M_HandleProfileErase(INT32 choice); +// Draws the EGGA CHANNEL background. +void M_DrawEggaChannel(void); // Extras menu: #define DF_ENCORE 0x40 diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 8c4ecc121..4c3db159a 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2270,7 +2270,7 @@ static void M_MPOptDrawer(menu_t *m, INT16 extend[3][3]) } // Draws the EGGA CHANNEL background. -static void M_DrawEggaChannel(void) +void M_DrawEggaChannel(void) { patch_t *background = W_CachePatchName("M_EGGACH", PU_CACHE); From bff9b59b54d37c14ef94380049adec62a1653d5a Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 13:47:39 +0100 Subject: [PATCH 06/22] Move gamekeydown/deviceResponding memset to D_StartTitle Fixes an issue where, if the last button used on the menu was ESC going back to the title screen, the connection would be aborted immediately. --- src/d_clisrv.c | 2 -- src/d_main.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index b8463b994..17f8e495f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1933,8 +1933,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic D_QuitNetGame(); CL_Reset(); D_StartTitle(); - memset(gamekeydown, 0, sizeof (gamekeydown)); - memset(deviceResponding, false, sizeof (deviceResponding)); return false; } diff --git a/src/d_main.c b/src/d_main.c index b24592d2d..d75f3202e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1001,6 +1001,11 @@ void D_StartTitle(void) G_SetGametype(GT_RACE); // SRB2kart paused = false; advancedemo = false; + + // clear cmd building stuff + memset(gamekeydown, 0, sizeof (gamekeydown)); + memset(deviceResponding, false, sizeof (deviceResponding)); + F_StartTitleScreen(); // Reset the palette From 921b667c3efd65de172bba2046d1b1fc553daf05 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 14:24:38 +0100 Subject: [PATCH 07/22] Modify render delta tics in the server connection ticker Necessary so Egga Channel visual behaves properly --- src/d_clisrv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 17f8e495f..6fc4dfa84 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1913,6 +1913,10 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { I_OsPolling(); + // Needs to be updated here for M_DrawEggaChannel + renderdeltatics = FRACUNIT; + rendertimefrac = FRACUNIT; + memset(deviceResponding, false, sizeof (deviceResponding)); if (cl_mode == CL_CONFIRMCONNECT) From 7f2d28ea330b89e46dcde0b4c26219f2933f74c8 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 19:56:48 +0100 Subject: [PATCH 08/22] Refactor handling of escape input a little - Includes port of KartKrew/Kart-Public!250 --- src/d_clisrv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6fc4dfa84..a5b9bf7b8 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1923,13 +1923,18 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { D_ProcessEvents(); //needed for menu system to receive inputs } - else + else if (netgame) { for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1)) G_MapEventsToControls(&events[eventtail]); + + if (G_PlayerInputDown(0, gc_b, 1) + || G_PlayerInputDown(0, gc_x, 1) + || gamekeydown[0][KEY_ESCAPE]) + cl_mode = CL_ABORTED; } - if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE] || cl_mode == CL_ABORTED) + if (cl_mode == CL_ABORTED) { CONS_Printf(M_GetText("Network game synchronization aborted.\n")); // M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress (B)\n"), NULL, MM_NOTHING); From 36f8ce8f78b4fc2ed883814f4b106904242dda50 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 20:32:43 +0100 Subject: [PATCH 09/22] Slightly refactor M_StartControlPanel In anticipation of attempt to incorporate into CL_ABORT process --- src/k_menufunc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 65047c372..8adb24070 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -925,11 +925,6 @@ void M_StartControlPanel(void) menucmd[i].delay = MENUDELAYTIME; } - // No instantly skipping the titlescreen. - // (We can change this timer later when extra animation is added.) - if (gamestate == GS_TITLESCREEN && finalecount < 1) - return; - // intro might call this repeatedly if (menuactive) { @@ -939,6 +934,11 @@ void M_StartControlPanel(void) if (gamestate == GS_TITLESCREEN) // Set up menu state { + // No instantly skipping the titlescreen. + // (We can change this timer later when extra animation is added.) + if (finalecount < 1) + return; + G_SetGamestate(GS_MENU); gameaction = ga_nothing; From b08ae2a716a108e1efb11e961485d7f89671de47 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 22:59:02 +0100 Subject: [PATCH 10/22] Fix confirm connect Still shows the message when you open the pause menu. Needs more attention I can't give it right now --- src/d_clisrv.c | 97 ++++++++++++++++++++++++++---------------------- src/k_menu.h | 1 + src/k_menudraw.c | 8 ++-- src/k_menufunc.c | 2 +- 4 files changed, 60 insertions(+), 48 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 637bbe69a..b86888334 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1484,39 +1484,36 @@ void CL_UpdateServerList (void) #endif // ifndef NONET -static void M_ConfirmConnect(event_t *ev) +static void M_ConfirmConnect(void) { #ifndef NONET - if (ev->type == ev_keydown) + if (G_PlayerInputDown(0, gc_a, 1) || gamekeydown[0][KEY_ENTER]) { - if (G_PlayerInputDown(0, gc_a, 1) || gamekeydown[0][KEY_ENTER]) + if (totalfilesrequestednum > 0) { - if (totalfilesrequestednum > 0) +#ifdef HAVE_CURL + if (http_source[0] == '\0' || curl_failedwebdownload) +#endif { -#ifdef HAVE_CURL - if (http_source[0] == '\0' || curl_failedwebdownload) -#endif + if (CL_SendFileRequest()) { - if (CL_SendFileRequest()) - { - cl_mode = CL_DOWNLOADFILES; - } + cl_mode = CL_DOWNLOADFILES; } -#ifdef HAVE_CURL - else - cl_mode = CL_PREPAREHTTPFILES; -#endif } +#ifdef HAVE_CURL else - cl_mode = CL_LOADFILES; + cl_mode = CL_PREPAREHTTPFILES; +#endif + } + else + cl_mode = CL_LOADFILES; - M_ClearMenus(true); - } - else if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE]) - { - cl_mode = CL_ABORTED; - M_ClearMenus(true); - } + M_ClearMenus(true); + } + else if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE]) + { + cl_mode = CL_ABORTED; + M_ClearMenus(true); } #else (void)ev; @@ -1570,8 +1567,8 @@ static boolean CL_FinishedFileList(void) "\n" "You may load server addons (if any), and wait for a slot.\n" "\n" - "Press (A) to continue or (B) to cancel.\n\n" - ), FUNCPTRCAST (M_ConfirmConnect), MM_EVENTHANDLER); + "Press (A) to continue or (B) to cancel\n" + ), NULL, MM_NOTHING); cl_mode = CL_CONFIRMCONNECT; } else @@ -1633,18 +1630,21 @@ static boolean CL_FinishedFileList(void) if (serverisfull) M_StartMessage(va(M_GetText( "This server is full!\n" - "Download of %s additional content is required to join.\n" + "Download of %s additional content\n" + "is required to join.\n" "\n" - "You may download, load server addons, and wait for a slot.\n" + "You may download, load server addons,\n" + "and wait for a slot.\n" "\n" - "Press (A) to continue or (B) to cancel.\n\n" - ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); + "Press (A) to continue or (B) to cancel\n" + ), downloadsize), NULL, MM_NOTHING); else M_StartMessage(va(M_GetText( - "Download of %s additional content is required to join.\n" + "Download of %s additional content\n" + "is required to join.\n" "\n" - "Press (A) to continue or (B) to cancel.\n\n" - ), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER); + "Press (A) to continue or (B) to cancel\n" + ), downloadsize), NULL, MM_NOTHING); Z_Free(downloadsize); cl_mode = CL_CONFIRMCONNECT; @@ -1919,19 +1919,24 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic memset(deviceResponding, false, sizeof (deviceResponding)); - if (cl_mode == CL_CONFIRMCONNECT) - { - D_ProcessEvents(); //needed for menu system to receive inputs - } - else if (netgame) + if (netgame) { for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1)) + { G_MapEventsToControls(&events[eventtail]); + } - if (G_PlayerInputDown(0, gc_b, 1) - || G_PlayerInputDown(0, gc_x, 1) - || gamekeydown[0][KEY_ESCAPE]) - cl_mode = CL_ABORTED; + if (cl_mode == CL_CONFIRMCONNECT) + { + M_ConfirmConnect(); + } + else + { + if (G_PlayerInputDown(0, gc_b, 1) + || G_PlayerInputDown(0, gc_x, 1) + || gamekeydown[0][KEY_ESCAPE]) + cl_mode = CL_ABORTED; + } } if (cl_mode == CL_ABORTED) @@ -1962,13 +1967,17 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic M_DrawEggaChannel(); } CL_DrawConnectionStatus(); + + if (cl_mode == CL_CONFIRMCONNECT) + { #ifdef HAVE_THREADS - I_lock_mutex(&k_menu_mutex); + I_lock_mutex(&k_menu_mutex); #endif - M_Drawer(); //Needed for drawing messageboxes on the connection screen + M_DrawMenuMessage(); #ifdef HAVE_THREADS - I_unlock_mutex(k_menu_mutex); + I_unlock_mutex(k_menu_mutex); #endif + } I_UpdateNoVsync(); // page flip or blit buffer if (moviemode) M_SaveFrame(); diff --git a/src/k_menu.h b/src/k_menu.h index 75160c22e..859e972be 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -561,6 +561,7 @@ void M_Init(void); extern menu_t MessageDef; void M_StartMessage(const char *string, void *routine, menumessagetype_t itemtype); void M_StopMessage(INT32 choice); +void M_DrawMenuMessage(void); void M_QuitResponse(INT32 ch); void M_QuitSRB2(INT32 choice); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 4c3db159a..509fb1673 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -433,7 +433,7 @@ static void M_DrawMenuTyping(void) } // Draw the message popup submenu -static void M_DrawMenuMessage(void) +void M_DrawMenuMessage(void) { INT32 y = menumessage.y + (9-menumessage.fadetimer)*20; @@ -443,6 +443,9 @@ static void M_DrawMenuMessage(void) INT32 mlines; const char *msg = menumessage.message; + if (!menumessage.active) + return; + mlines = menumessage.m>>8; max = (INT16)((UINT8)(menumessage.m & 0xFF)*8); @@ -550,8 +553,7 @@ void M_Drawer(void) } // Draw message overlay when needed - if (menumessage.active) - M_DrawMenuMessage(); + M_DrawMenuMessage(); // Draw typing overlay when needed, above all other menu elements. if (menutyping.active) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 8adb24070..2ce5ef95b 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -1813,7 +1813,7 @@ void M_StartMessage(const char *string, void *routine, menumessagetype_t itemtyp strncpy(menumessage.message, string, MAXMENUMESSAGE); menumessage.flags = itemtype; *(void**)&menumessage.routine = routine; - menumessage.fadetimer = 1; + menumessage.fadetimer = (gamestate == GS_WAITINGPLAYERS) ? 9 : 1; menumessage.active = true; start = 0; From 1d6c32710cafefb7c0ae894bcd9b6010467e5f09 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Mon, 17 Oct 2022 22:36:29 -0500 Subject: [PATCH 11/22] win32: Add dpi aware manifest config --- src/win32/srb2kart.exe.manifest | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/win32/srb2kart.exe.manifest b/src/win32/srb2kart.exe.manifest index d3b8355cb..f9ba6c814 100644 --- a/src/win32/srb2kart.exe.manifest +++ b/src/win32/srb2kart.exe.manifest @@ -1,5 +1,11 @@ + + + true/pm + PerMonitorV2 + + From b0e079bdf0e0f0a33c1e48eb7809765517e615b5 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 29 Oct 2022 10:52:58 -0700 Subject: [PATCH 12/22] Update botvars rubberband and controller in P_PlayerAfterThink instead of K_BuildBotTiccmd These vars directly affect gamestate but K_BuildBotTiccmd only runs for the server. --- src/k_bot.c | 37 +++++++++++++++++++++++-------------- src/k_bot.h | 16 ++++++++++++++++ src/p_user.c | 6 ++++++ 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/k_bot.c b/src/k_bot.c index ebd8f0509..73139e6b6 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -921,7 +921,7 @@ static void K_DrawPredictionDebug(botprediction_t *predict, player_t *player) Return:- None --------------------------------------------------*/ -static void K_BotTrick(player_t *player, ticcmd_t *cmd, line_t *botController) +static void K_BotTrick(player_t *player, ticcmd_t *cmd, const line_t *botController) { // Trick panel state -- do nothing until a controller line is found, in which case do a trick. if (botController == NULL) @@ -1259,7 +1259,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) angle_t destangle = 0; UINT8 spindash = 0; INT32 turnamt = 0; - line_t *botController = NULL; + const line_t *botController = player->botvars.controller != UINT16_MAX ? &lines[player->botvars.controller] : NULL; // Remove any existing controls memset(cmd, 0, sizeof(ticcmd_t)); @@ -1292,18 +1292,6 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) return; } - botController = K_FindBotController(player->mo); - if (botController == NULL) - { - player->botvars.controller = UINT16_MAX; - } - else - { - player->botvars.controller = botController - lines; - } - - player->botvars.rubberband = K_UpdateRubberband(player); - if (player->trickpanel != 0) { K_BotTrick(player, cmd, botController); @@ -1531,3 +1519,24 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) Z_Free(predict); } } + +/*-------------------------------------------------- + void K_UpdateBotGameplayVars(player_t *player); + + See header file for description. +--------------------------------------------------*/ +void K_UpdateBotGameplayVars(player_t *player) +{ + const line_t *botController; + + if (gamestate != GS_LEVEL || !player->mo) + { + // Not in the level. + return; + } + + botController = K_FindBotController(player->mo); + + player->botvars.controller = botController ? (botController - lines) : UINT16_MAX; + player->botvars.rubberband = K_UpdateRubberband(player); +} diff --git a/src/k_bot.h b/src/k_bot.h index f476848f0..858e4f331 100644 --- a/src/k_bot.h +++ b/src/k_bot.h @@ -238,6 +238,22 @@ INT32 K_PositionBully(player_t *player); void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd); +/*-------------------------------------------------- + void K_UpdateBotGameplayVars(player_t *player); + + Updates gamestate affecting botvars. This must be + called for both client and server. + + Input Arguments:- + player - Player to whom to update the botvars. + + Return:- + None +--------------------------------------------------*/ + +void K_UpdateBotGameplayVars(player_t *player); + + /*-------------------------------------------------- void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt); diff --git a/src/p_user.c b/src/p_user.c index be7beff57..b43311d38 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4301,6 +4301,12 @@ void P_PlayerAfterThink(player_t *player) // Run followers in AfterThink, after the players have moved, // so a lag value of 1 is exactly attached to the player. K_HandleFollower(player); + + + if (K_PlayerUsesBotMovement(player)) + { + K_UpdateBotGameplayVars(player); + } } void P_SetPlayerAngle(player_t *player, angle_t angle) From ce4518a20c3b13d6d464bf46ea72950f3a4a3d93 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 31 Oct 2022 19:01:44 -0700 Subject: [PATCH 13/22] Use interpolated mobj x/y/z/angle for splats --- src/hardware/hw_glob.h | 2 ++ src/hardware/hw_main.c | 77 ++++++++++++++++++++++++------------------ src/r_splats.c | 8 ++--- src/r_things.c | 1 + src/r_things.h | 2 +- 5 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index c13da6889..bc05ea4d4 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -87,6 +87,8 @@ typedef struct gl_vissprite_s boolean rotated; UINT8 translucency; //alpha level 0-255 + angle_t angle; // for splats + //Hurdler: 25/04/2000: now support colormap in hardware mode UINT8 *colormap; INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index cf9e69a00..1b9c1a1bf 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4165,7 +4165,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) scale *= spr->shadowscale; if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD) - angle = spr->mobj->angle; + angle = spr->angle; else angle = viewangle; @@ -4220,8 +4220,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) // Translate for (i = 0; i < 4; i++) { - wallVerts[i].x = rotated[i].x + FIXED_TO_FLOAT(spr->mobj->x); - wallVerts[i].z = rotated[i].y + FIXED_TO_FLOAT(spr->mobj->y); + wallVerts[i].x = rotated[i].x + spr->x1; + wallVerts[i].z = rotated[i].y + spr->z1; } if (renderflags & (RF_SLOPESPLAT | RF_OBJECTSLOPESPLAT)) @@ -4248,7 +4248,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) else { for (i = 0; i < 4; i++) - wallVerts[i].y = FIXED_TO_FLOAT(spr->mobj->z) + zoffset; + wallVerts[i].y = FIXED_TO_FLOAT(spr->gz) + zoffset; } } else @@ -5369,43 +5369,52 @@ static void HWR_ProjectSprite(mobj_t *thing) this_xscale = spritexscale * this_scale; this_yscale = spriteyscale * this_scale; - if (flip) + if (splat) { - x1 = (FIXED_TO_FLOAT(spr_width - spr_offset) * this_xscale); - x2 = (FIXED_TO_FLOAT(spr_offset) * this_xscale); + z1 = z2 = tr_y; + x1 = x2 = tr_x; + gz = gzt = interp.z; } else { - x1 = (FIXED_TO_FLOAT(spr_offset) * this_xscale); - x2 = (FIXED_TO_FLOAT(spr_width - spr_offset) * this_xscale); - } + if (flip) + { + x1 = (FIXED_TO_FLOAT(spr_width - spr_offset) * this_xscale); + x2 = (FIXED_TO_FLOAT(spr_offset) * this_xscale); + } + else + { + x1 = (FIXED_TO_FLOAT(spr_offset) * this_xscale); + x2 = (FIXED_TO_FLOAT(spr_width - spr_offset) * this_xscale); + } - // test if too close -/* - if (papersprite) - { - z1 = tz - x1 * angle_scalez; - z2 = tz + x2 * angle_scalez; + // test if too close + /* + if (papersprite) + { + z1 = tz - x1 * angle_scalez; + z2 = tz + x2 * angle_scalez; - if (max(z1, z2) < ZCLIP_PLANE) - return; - } -*/ + if (max(z1, z2) < ZCLIP_PLANE) + return; + } + */ - z1 = tr_y + x1 * rightsin; - z2 = tr_y - x2 * rightsin; - x1 = tr_x + x1 * rightcos; - x2 = tr_x - x2 * rightcos; + z1 = tr_y + x1 * rightsin; + z2 = tr_y - x2 * rightsin; + x1 = tr_x + x1 * rightcos; + x2 = tr_x - x2 * rightcos; - if (vflip) - { - gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale); - gzt = gz + (FIXED_TO_FLOAT(spr_height) * this_yscale); - } - else - { - gzt = FIXED_TO_FLOAT(interp.z) + (FIXED_TO_FLOAT(spr_topoffset) * this_yscale); - gz = gzt - (FIXED_TO_FLOAT(spr_height) * this_yscale); + if (vflip) + { + gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale); + gzt = gz + (FIXED_TO_FLOAT(spr_height) * this_yscale); + } + else + { + gzt = FIXED_TO_FLOAT(interp.z) + (FIXED_TO_FLOAT(spr_topoffset) * this_yscale); + gz = gzt - (FIXED_TO_FLOAT(spr_height) * this_yscale); + } } if (thing->subsector->sector->cullheight) @@ -5561,6 +5570,8 @@ static void HWR_ProjectSprite(mobj_t *thing) vis->precip = false; vis->bbox = false; + + vis->angle = interp.angle; } #ifdef HWPRECIP diff --git a/src/r_splats.c b/src/r_splats.c index 27cc5566a..80ff44743 100644 --- a/src/r_splats.c +++ b/src/r_splats.c @@ -185,7 +185,7 @@ void R_DrawFloorSplat(vissprite_t *spr) splat.scale = FixedMul(splat.scale, ((skin_t *)mobj->skin)->highresscale); if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD) - splatangle = mobj->angle; + splatangle = spr->centerangle; else splatangle = spr->viewpoint.angle; @@ -209,14 +209,14 @@ void R_DrawFloorSplat(vissprite_t *spr) xoffset = FixedMul(leftoffset, splat.xscale); yoffset = FixedMul(topoffset, splat.yscale); - x = mobj->x; - y = mobj->y; + x = spr->gx; + y = spr->gy; w = (splat.width * splat.xscale); h = (splat.height * splat.yscale); splat.x = x; splat.y = y; - splat.z = mobj->z; + splat.z = spr->pz; splat.slope = NULL; // Set positions diff --git a/src/r_things.c b/src/r_things.c index 5b43beed2..9e042c6af 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2056,6 +2056,7 @@ static void R_ProjectSprite(mobj_t *thing) tr_y = (interp.y - sort_y) - viewy; sort_z = FixedMul(tr_x, viewcos) + FixedMul(tr_y, viewsin); sortsplat = FixedDiv(projectiony[viewssnum], sort_z); + centerangle = interp.angle; } // PORTAL SPRITE CLIPPING diff --git a/src/r_things.h b/src/r_things.h index 881de773e..18c55629b 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -171,7 +171,7 @@ typedef struct vissprite_s fixed_t paperoffset, paperdistance; // for paper sprites, offset/dist relative to the angle fixed_t xiscale; // negative if flipped - angle_t centerangle; // for paper sprites + angle_t centerangle; // for paper sprites / splats // for floor sprites struct { From 424c65955eb304d9594686b6d920c368489b48c6 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 31 Oct 2022 19:03:09 -0700 Subject: [PATCH 14/22] Use angle between viewz and mobj z to determine splat sprite angle --- src/hardware/hw_main.c | 13 ++++++++++--- src/r_things.c | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 1b9c1a1bf..655127b1b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5240,9 +5240,16 @@ static void HWR_ProjectSprite(mobj_t *thing) I_Error("sprframes NULL for sprite %d\n", thing->sprite); #endif - ang = R_PointToAngle (interp.x, interp.y) - interp.angle; - if (mirrored) - ang = InvAngle(ang); + if (splat) + { + ang = R_PointToAngle2(0, viewz, 0, interp.z); + } + else + { + ang = R_PointToAngle (interp.x, interp.y) - interp.angle; + if (mirrored) + ang = InvAngle(ang); + } if (sprframe->rotate == SRF_SINGLE) { diff --git a/src/r_things.c b/src/r_things.c index 9e042c6af..41dfc8585 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1755,7 +1755,11 @@ static void R_ProjectSprite(mobj_t *thing) I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite); #endif - if (sprframe->rotate != SRF_SINGLE || papersprite) + if (splat) + { + ang = R_PointToAngle2(0, viewz, 0, interp.z); + } + else if (sprframe->rotate != SRF_SINGLE || papersprite) { ang = R_PointToAngle (interp.x, interp.y) - interp.angle; if (mirrored) From 7e46ee1d13e5aa25d1b6fb29496637da97373893 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 3 Nov 2022 04:28:02 -0700 Subject: [PATCH 15/22] Use non-damaging hitlag for Hyudoro collide --- src/objects/hyudoro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 2b6d8cf1a..7b40ce61e 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -406,7 +406,7 @@ hyudoro_patrol_hit_player if (!player->itemamount) return false; - K_AddHitLag(toucher, TICRATE/2, true); + K_AddHitLag(toucher, TICRATE/2, false); hyudoro_mode(hyu) = HYU_RETURN; hyudoro_itemtype(hyu) = player->itemtype; From d44340e9b8ffc38d0b7f7d8ef43bd0ac3ad7fbdb Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 3 Nov 2022 04:56:21 -0700 Subject: [PATCH 16/22] Always allow combos into DMG_EXPLODE --- src/p_inter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index df22a056f..64179a58d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1997,7 +1997,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Check if the player is allowed to be damaged! // If not, then spawn the instashield effect instead. - if (!force && !(inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1 == 1)) + // NB: "allowcombo", "hardhit" and related checks are here to disallow HITLAG COMBOS, not loss-of-control combos + // DMG_EXPLODE bypasses this check to prevent blocking eggbox/SPB with spinout flashtics + if (!force && (type != DMG_EXPLODE) && !(inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1 == 1)) { if (gametyperules & GTR_BUMPERS) { From 4996692b4b476d4fb205daf3611e5bbdead51f8f Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 3 Nov 2022 05:09:18 -0700 Subject: [PATCH 17/22] Remove redundant MT_SPBEXPLOSION combo condition --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 64179a58d..da54636fb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1999,7 +1999,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // If not, then spawn the instashield effect instead. // NB: "allowcombo", "hardhit" and related checks are here to disallow HITLAG COMBOS, not loss-of-control combos // DMG_EXPLODE bypasses this check to prevent blocking eggbox/SPB with spinout flashtics - if (!force && (type != DMG_EXPLODE) && !(inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1 == 1)) + if (!force && (type != DMG_EXPLODE)) { if (gametyperules & GTR_BUMPERS) { From 13003cb66a140a44eb80037782ca10efd864c61e Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 3 Nov 2022 22:41:39 +0000 Subject: [PATCH 18/22] NONET was killed prior, get rid of its body --- src/d_clisrv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index b921afd32..f3c72155b 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1483,11 +1483,8 @@ void CL_UpdateServerList (void) SendAskInfo(BROADCASTADDR); } -#endif // ifndef NONET - static void M_ConfirmConnect(void) { -#ifndef NONET if (G_PlayerInputDown(0, gc_a, 1) || gamekeydown[0][KEY_ENTER]) { if (totalfilesrequestednum > 0) From 310ecb3cb0c65340e4ef08f1958004d4a6903cb4 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 3 Nov 2022 22:44:55 +0000 Subject: [PATCH 19/22] Missing variable --- src/d_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index e4198d129..bcfc5d1b8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1212,7 +1212,7 @@ D_ConvertVersionNumbers (void) // void D_SRB2Main(void) { - INT32 p; + INT32 i, p; INT32 numbasemapheaders; From b4227bde05eb3be3f73f75f456ffb3939597a49e Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 3 Nov 2022 23:48:58 +0000 Subject: [PATCH 20/22] Fix M_ConfirmConnect properly ending the menu popup Turns out M_ClearMenus returns early, we should do M_StopMessage directly --- 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 f3c72155b..03045933d 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1506,12 +1506,12 @@ static void M_ConfirmConnect(void) else cl_mode = CL_LOADFILES; - M_ClearMenus(true); + M_StopMessage(0); } else if (G_PlayerInputDown(0, gc_b, 1) || G_PlayerInputDown(0, gc_x, 1) || gamekeydown[0][KEY_ESCAPE]) { cl_mode = CL_ABORTED; - M_ClearMenus(true); + M_StopMessage(0); } } From a9e5904d2f1984faf56435d27e8ed2f952eafb14 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 4 Nov 2022 00:30:03 +0000 Subject: [PATCH 21/22] Show (and clear) menu messages on the titlescreen --- src/f_finale.c | 5 +++++ src/k_menufunc.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index f95f0103d..33b758d8f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2103,6 +2103,8 @@ luahook: LUA_HookHUD(luahuddrawlist_title, HUD_HOOK(title)); } LUA_HUD_DrawList(luahuddrawlist_title); + + M_DrawMenuMessage(); } // (no longer) De-Demo'd Title Screen @@ -2114,6 +2116,9 @@ void F_TitleScreenTicker(boolean run) { finalecount++; + if (menumessage.fadetimer < 9) + menumessage.fadetimer++; + if (finalecount == 1) { // Now start the music diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 3079b164c..4babf145b 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -954,6 +954,8 @@ void M_StartControlPanel(void) if (!Playing()) { + M_StopMessage(0); // Doesn't work with MM_YESNO or MM_EVENTHANDLER... but good enough to get the game as it is currently functional again + if (cv_currprofile.value == -1) // Only ask once per session. { // Make sure the profile data is ready now since we need to select a profile. @@ -1875,11 +1877,8 @@ void M_HandleMenuMessage(void) boolean btok = M_MenuConfirmPressed(pid); boolean btnok = M_MenuBackPressed(pid); - menumessage.fadetimer++; - - if (menumessage.fadetimer > 9) - menumessage.fadetimer = 9; - + if (menumessage.fadetimer < 9) + menumessage.fadetimer++; switch (menumessage.flags) { From 77be11d9525a6adb9b6247ae38e928d49b37701f Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 4 Nov 2022 00:41:53 +0000 Subject: [PATCH 22/22] Title screen adjustments - Don't show menu message on first tic of title startup --- src/f_finale.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 33b758d8f..a0ae60cf2 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2104,7 +2104,8 @@ luahook: } LUA_HUD_DrawList(luahuddrawlist_title); - M_DrawMenuMessage(); + if (finalecount > 0) + M_DrawMenuMessage(); } // (no longer) De-Demo'd Title Screen @@ -2114,16 +2115,15 @@ void F_TitleScreenTicker(boolean run) if (run) { - finalecount++; - - if (menumessage.fadetimer < 9) - menumessage.fadetimer++; - - if (finalecount == 1) + if (finalecount == 0) { // Now start the music S_ChangeMusicInternal("_title", looptitle); } + else if (menumessage.fadetimer < 9) + menumessage.fadetimer++; + + finalecount++; } // don't trigger if doing anything besides idling on title