Mapname lowercase support (#146)

*  Moved levelname parsing to before where uppercase conversion occurs.
*  Extended titlecard font range.
*  Replaced misc. "ZONE" strings with "Zone" for titlecard purposes.
*  Don't convert to uppercase when rendering the titlecard name.


Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
Nev3r 2019-03-17 21:44:24 +01:00 committed by Steel Titanium
parent 144502729a
commit 5dc494da16
No known key found for this signature in database
GPG Key ID: 924BA411F18DFDBE
5 changed files with 16 additions and 14 deletions

View File

@ -1201,6 +1201,14 @@ static void readlevelheader(MYFILE *f, INT32 num)
word2 = tmp += 2;
i = atoi(word2); // used for numerical settings
if (fastcmp(word, "LEVELNAME"))
{
deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2,
sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num));
strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_ so only complains once
continue;
}
// CHEAP HACK: move this over here for lowercase subtitles
if (fastcmp(word, "SUBTITLE"))
{
@ -1344,12 +1352,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
// Strings that can be truncated
else if (fastcmp(word, "LEVELNAME"))
{
deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2,
sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num));
strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_ so only complains once
}
else if (fastcmp(word, "SELECTHEADING"))
{
deh_strlcpy(mapheaderinfo[num-1]->selectheading, word2,

View File

@ -4031,7 +4031,7 @@ char *G_BuildMapTitle(INT32 mapnum)
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
{
zonetext = M_GetText("ZONE");
zonetext = M_GetText("Zone");
len += strlen(zonetext) + 1; // ' ' + zonetext
}
if (actnum > 0)

View File

@ -28,7 +28,7 @@
// Level title font
#define LT_FONTSTART '!' // the first font characters
#define LT_FONTEND 'Z' // the last font characters
#define LT_FONTEND 'z' // the last font characters
#define LT_FONTSIZE (LT_FONTEND - LT_FONTSTART + 1)
#define CRED_FONTSTART '!' // the first font character

View File

@ -1177,7 +1177,7 @@ void ST_drawLevelTitle(tic_t titletime)
lvlttlxpos -= V_LevelActNumWidth(actnum);
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("Zone"));
ttlnumxpos++;
if (lvlttlxpos < 0)
@ -1204,7 +1204,7 @@ void ST_drawLevelTitle(tic_t titletime)
else
{
fixed_t z = ((titletime - 105)<<FRACBITS)/7;
INT32 zoneh = V_LevelNameHeight(M_GetText("ZONE"));
INT32 zoneh = V_LevelNameHeight(M_GetText("Zone"));
zoney = (MIDZONEY + zoneh - MIDDIFF)*(FRACUNIT - z) - (zoneh<<FRACBITS);
lvlttly = ((MIDTTLY + MIDDIFF)<<FRACBITS) + ((200 - (MIDTTLY + MIDDIFF))*z);
}
@ -1239,7 +1239,7 @@ void ST_drawLevelTitle(tic_t titletime)
V_DrawLevelTitle(lvlttlxpos, lvlttly, V_PERPLAYER, lvlttl);
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
V_DrawLevelTitle(zonexpos, zoney, V_PERPLAYER, M_GetText("ZONE"));
V_DrawLevelTitle(zonexpos, zoney, V_PERPLAYER, M_GetText("Zone"));
if (lvlttly+48 < 200)
V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl);

View File

@ -2899,7 +2899,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
continue;
}
c = toupper(*ch) - LT_FONTSTART;
c = *ch - LT_FONTSTART;
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
{
cx += 16*dupx;
@ -2934,7 +2934,7 @@ INT32 V_LevelNameWidth(const char *string)
{
if (string[i] & 0x80)
continue;
c = toupper(string[i]) - LT_FONTSTART;
c = string[i] - LT_FONTSTART;
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
w += 16;
else
@ -2953,7 +2953,7 @@ INT32 V_LevelNameHeight(const char *string)
for (i = 0; i < strlen(string); i++)
{
c = toupper(string[i]) - LT_FONTSTART;
c = string[i] - LT_FONTSTART;
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
continue;