From 4f744bc06f26e718e84a798c53b529ccb14e680e Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 18 Feb 2022 15:17:59 +0100 Subject: [PATCH 1/2] Various changes to emblem drawing: - Emblems in a row now have a little bit of spacing between them. - Score/time/ring emblems are drawn only once in the pause menu. - Record Attack & NiGHTS Mode show in-level emblems as well. --- src/m_menu.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 9daab767f..24697980e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4223,7 +4223,7 @@ static void M_CentreText(INT32 y, const char *string) // // used by pause & statistics to draw a row of emblems for a map // -static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) +static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y, boolean globalonly) { UINT8 lasttype = UINT8_MAX, curtype; emblem_t *emblem = M_GetLevelEmblems(mapnum); @@ -4242,6 +4242,12 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) curtype = 0; break; } + if (globalonly && curtype) + { + emblem = M_GetLevelEmblems(-1); + continue; + } + // Shift over if emblem is of a different discipline if (lasttype != UINT8_MAX && lasttype != curtype) x -= 4; @@ -4254,7 +4260,7 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) V_DrawSmallScaledPatch(x, y, 0, W_CachePatchName("NEEDIT", PU_PATCH)); emblem = M_GetLevelEmblems(-1); - x -= 12; + x -= 12+1; } } @@ -4689,7 +4695,7 @@ static void M_DrawPauseMenu(void) M_DrawTextBox(27, 16, 32, 6); // Draw any and all emblems at the top. - M_DrawMapEmblems(gamemap, 272, 28); + M_DrawMapEmblems(gamemap, 272, 28, true); if (mapheaderinfo[gamemap-1]->actnum != 0) V_DrawString(40, 28, V_YELLOWMAP, va("%s %d", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum)); @@ -9622,7 +9628,7 @@ static void M_DrawStatsMaps(int location) } mnum = statsMapList[i]; - M_DrawMapEmblems(mnum+1, 292, y); + M_DrawMapEmblems(mnum+1, 292, y, false); if (mapheaderinfo[mnum]->actnum != 0) V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE, va("%s %d", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->actnum)); @@ -9982,6 +9988,9 @@ void M_DrawTimeAttackMenu(void) em = M_GetLevelEmblems(-1); } + // Draw in-level emblems. + M_DrawMapEmblems(cv_nextmap.value, 288, 28, true); + if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->score) sprintf(beststr, "(none)"); else @@ -10262,6 +10271,9 @@ void M_DrawNightsAttackMenu(void) skipThisOne: em = M_GetLevelEmblems(-1); } + + // Draw in-level emblems. + M_DrawMapEmblems(cv_nextmap.value, 288, 28, true); } } From a85b820b447993fd60b12499ebd6d214b8a5f728 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sat, 17 Sep 2022 00:59:35 +0200 Subject: [PATCH 2/2] Don't skip map completion emblems when skipping record attack emblems. --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 24697980e..26a17c531 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4223,7 +4223,7 @@ static void M_CentreText(INT32 y, const char *string) // // used by pause & statistics to draw a row of emblems for a map // -static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y, boolean globalonly) +static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y, boolean norecordattack) { UINT8 lasttype = UINT8_MAX, curtype; emblem_t *emblem = M_GetLevelEmblems(mapnum); @@ -4242,7 +4242,7 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y, boolean globalonly) curtype = 0; break; } - if (globalonly && curtype) + if (norecordattack && (curtype == 1 || curtype == 2)) { emblem = M_GetLevelEmblems(-1); continue;