From f49b12a705f99394036a03da087354e7021a9b16 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 4 Jul 2018 22:57:50 +0100 Subject: [PATCH] * Fix the fades mess, and have the title screen always have a smooth, non-checkered fade from blapck! * Fix all the bugs with skin not being set properly or kept synchronised with the multiplayer setup in record attack. * Reduce the amount of flashing on the voting screen. --- src/d_main.c | 8 +++++--- src/d_netcmd.c | 12 +++--------- src/dehacked.c | 8 ++++++++ src/f_finale.h | 7 +++++-- src/f_wipe.c | 2 ++ src/m_menu.c | 23 ++++++++++++++++------- src/y_inter.c | 2 +- 7 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 15e11b0d..89210a17 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -296,15 +296,15 @@ static void D_Display(void) { // set for all later wipedefindex = gamestate; // wipe_xxx_toblack - if (gamestate == GS_INTERMISSION) + if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO) + wipedefindex = wipe_multinter_toblack; + else if (gamestate == GS_INTERMISSION) { if (intertype == int_spec) // Special Stage wipedefindex = wipe_specinter_toblack; else //if (intertype != int_coop) // Multiplayer wipedefindex = wipe_multinter_toblack; } - else if (gamestate == GS_VOTING) - wipedefindex = wipe_multinter_toblack; if (rendermode != render_none) { @@ -385,6 +385,8 @@ static void D_Display(void) case GS_TITLESCREEN: F_TitleScreenDrawer(); + if (wipe) + wipedefindex = wipe_titlescreen_toblack; break; case GS_WAITINGPLAYERS: diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2388891d..ad6973d5 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2241,6 +2241,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) emeralds = 0; } + if (modeattacking) // i remember moving this here in internal fixed a heisenbug so + SetPlayerSkinByNum(0, cv_chooseskin.value-1); + #ifdef HAVE_BLUA LUAh_MapChange(); #endif @@ -2252,15 +2255,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) if (timingdemo) G_DoneLevelLoad(); - if (modeattacking) - { - SetPlayerSkinByNum(0, cv_chooseskin.value-1); - players[0].skincolor = cv_playercolor.value; // srb2kart - - // a copy of color - if (players[0].mo) - players[0].mo->color = players[0].skincolor; - } if (metalrecording) G_BeginMetal(); if (demorecording) // Okay, level loaded, character spawned and skinned, diff --git a/src/dehacked.c b/src/dehacked.c index 92d3a0ff..aef81496 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3182,6 +3182,14 @@ static void readwipes(MYFILE *f) else if (fastcmp(pword, "FINAL")) wipeoffset = wipe_specinter_final; } + else if (fastncmp(word, "VOTING_", 10)) + { + pword = word + 10; + if (fastcmp(pword, "TOBLACK")) + wipeoffset = wipe_specinter_toblack; + else if (fastcmp(pword, "FINAL")) + wipeoffset = wipe_specinter_final; + } else if (fastncmp(word, "MULTINTER_", 10)) { pword = word + 10; diff --git a/src/f_finale.h b/src/f_finale.h index 4e16e0ed..46375b6e 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -82,6 +82,7 @@ enum wipe_level_toblack, wipe_intermission_toblack, + wipe_voting_toblack, wipe_continuing_toblack, wipe_titlescreen_toblack, wipe_timeattack_toblack, @@ -98,6 +99,7 @@ enum wipe_level_final, wipe_intermission_final, + wipe_voting_final, wipe_continuing_final, wipe_titlescreen_final, wipe_timeattack_final, @@ -111,9 +113,10 @@ enum wipe_specinter_final, wipe_multinter_final, - NUMWIPEDEFS + NUMWIPEDEFS, + WIPEFINALSHIFT = wipe_level_final - wipe_level_toblack }; -#define WIPEFINALSHIFT 13 + extern UINT8 wipedefs[NUMWIPEDEFS]; #endif diff --git a/src/f_wipe.c b/src/f_wipe.c index ed5736cb..8f3c2605 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -47,6 +47,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { 0, // wipe_level_toblack UINT8_MAX, // wipe_intermission_toblack + 0, // wipe_voting_toblack, UINT8_MAX, // wipe_continuing_toblack 3, // wipe_titlescreen_toblack 0, // wipe_timeattack_toblack @@ -62,6 +63,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { 0, // wipe_level_final 0, // wipe_intermission_final + 0, // wipe_voting_final 0, // wipe_continuing_final 3, // wipe_titlescreen_final 0, // wipe_timeattack_final diff --git a/src/m_menu.c b/src/m_menu.c index 0000fa55..57f535e7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -241,6 +241,7 @@ menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef; // Single Player //static void M_LoadGame(INT32 choice); static void M_TimeAttack(INT32 choice); +static boolean M_QuitTimeAttackMenu(void); //static void M_NightsAttack(INT32 choice); static void M_Statistics(INT32 choice); static void M_HandleStaffReplay(INT32 choice); @@ -1684,7 +1685,7 @@ static menu_t SP_TimeAttackDef = M_DrawTimeAttackMenu, 34, 40, 0, - NULL + M_QuitTimeAttackMenu }; static menu_t SP_ReplayDef = { @@ -3784,20 +3785,21 @@ static void M_PatchSkinNameTable(void) if (skins[j].name[0] != '\0') { skins_cons_t[j].strvalue = skins[j].name; - skins_cons_t[j].value = j+1; + skins_cons_t[j].value = j; } else { skins_cons_t[j].strvalue = NULL; skins_cons_t[j].value = 0; + break; } } - CV_SetValue(&cv_chooseskin, cv_chooseskin.value); // This causes crash sometimes?! + j = R_SkinAvailable(cv_skin.string); + if (j == -1) + j = 0; - CV_SetValue(&cv_chooseskin, 1); - CV_AddValue(&cv_chooseskin, -1); - CV_AddValue(&cv_chooseskin, 1); + CV_SetValue(&cv_chooseskin, j+1); // This causes crash sometimes?! return; } @@ -3831,7 +3833,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) { case LLM_CREATESERVER: // Should the map be hidden? - if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU) + if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap) return false; if (M_MapLocked(mapnum+1)) @@ -5848,6 +5850,13 @@ static void M_TimeAttack(INT32 choice) S_ChangeMusicInternal("racent", true); } +static boolean M_QuitTimeAttackMenu(void) +{ + // you know what? always putting these in the buffer won't hurt anything. + COM_BufAddText(va("skin \"%s\"\n", cv_chooseskin.string)); + return true; +} + // Drawing function for Nights Attack /*void M_DrawNightsAttackMenu(void) { diff --git a/src/y_inter.c b/src/y_inter.c index 4593e657..d46f1351 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2253,7 +2253,7 @@ void Y_VoteDrawer(void) if (!timer && i == voteclient.ranim) { V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, cursor); - if (!(votetic % 4)) + if (voteendtic != -1 && !(votetic % 4)) V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT); else V_DrawFill(x-1, y-1, 42, 27, levelinfo[votes[i]].gtc|V_SNAPTOLEFT);