From 599d7a5345fe85c44dc6f43397b999a912d599b0 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sat, 11 Jan 2020 14:59:10 +0100 Subject: [PATCH 1/2] Make >5 <10 emblem hints appear "symmetrical"-ish With more than 5 but less than 10 emblem hints, only put half of the hints on each side of the hint menu, instead of putting e.g. 5 on the left and 1 on the right. --- src/m_menu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index f2287177f..27514df5e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7234,7 +7234,7 @@ static void M_EmblemHints(INT32 choice) static void M_DrawEmblemHints(void) { INT32 i, j = 0, x, y; - UINT32 collected = 0, local = 0; + UINT32 collected = 0, local = 0, left_hints = NUMHINTS; emblem_t *emblem; const char *hint; @@ -7250,6 +7250,11 @@ static void M_DrawEmblemHints(void) x = (local > NUMHINTS ? 4 : 12); y = 8; + // If there are more than 1 page's but less than 2 pages' worth of emblems, + // put half (rounded up) of the hints on the left, and half (rounded down) on the right + if (local > NUMHINTS && local < (NUMHINTS*2)-1) + left_hints = (local + 1) / 2; + if (!local) V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map."); else for (i = 0; i < numemblems; i++) @@ -7282,7 +7287,7 @@ static void M_DrawEmblemHints(void) y += 28; - if (++j == NUMHINTS) + if (++j == left_hints) { x = 4+(BASEVIDWIDTH/2); y = 8; From eb58de0980a57e53c7988211e8c6df2753a33247 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 12 Jan 2020 23:09:27 +0100 Subject: [PATCH 2/2] Fix "symmetrical"-ish emblem hints for ERRORMODE "left_hints" is always 3, 4, or 5, so the signedness is irrelevant. But with ERRORMODE set to 1 when compiling, the compile would previously stop due to comparing INT32 to UINT32. --- 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 27514df5e..142361bf2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7233,8 +7233,8 @@ static void M_EmblemHints(INT32 choice) static void M_DrawEmblemHints(void) { - INT32 i, j = 0, x, y; - UINT32 collected = 0, local = 0, left_hints = NUMHINTS; + INT32 i, j = 0, x, y, left_hints = NUMHINTS; + UINT32 collected = 0, local = 0; emblem_t *emblem; const char *hint;