Menus/Map Select: split map names so only 1 word goes on the bottom

This is the minimum requirement for release, just to stop
Mega Collision Chaos from going off the screen.

- 2 words
  - 1 word on top
  - 1 word below
- 3 words
  - 2 words on top
  - 1 word below
This commit is contained in:
James R 2024-03-07 09:36:49 -08:00
parent 38811b2e4c
commit ba50685c6e

View file

@ -3338,38 +3338,25 @@ static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map)
}
else
{
boolean donewithone = false;
char *ttlsource =
mapheaderinfo[map]->menuttl[0]
? mapheaderinfo[map]->menuttl
: mapheaderinfo[map]->lvlttl;
for (i = 0; i < 22; i++)
// If there are 2 or more words:
// - Last word goes on word2
// - Everything else on word1
char *p = strrchr(ttlsource, ' ');
if (p)
{
if (!ttlsource[i])
break;
if (ttlsource[i] == ' ')
{
if (!donewithone)
{
donewithone = true;
continue;
}
}
if (donewithone)
{
word2[word2len] = ttlsource[i];
word2len++;
}
else
{
word1[word1len] = ttlsource[i];
word1len++;
}
word2len = strlen(p + 1);
memcpy(word2, p + 1, word2len);
}
else
p = ttlsource + strlen(ttlsource);
word1len = p - ttlsource;
memcpy(word1, ttlsource, word1len);
}
if (!mapheaderinfo[map]->menuttl[0] && mapheaderinfo[map]->actnum)