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:
parent
144502729a
commit
5dc494da16
|
@ -1201,6 +1201,14 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
word2 = tmp += 2;
|
word2 = tmp += 2;
|
||||||
i = atoi(word2); // used for numerical settings
|
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
|
// CHEAP HACK: move this over here for lowercase subtitles
|
||||||
if (fastcmp(word, "SUBTITLE"))
|
if (fastcmp(word, "SUBTITLE"))
|
||||||
{
|
{
|
||||||
|
@ -1344,12 +1352,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strings that can be truncated
|
// 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"))
|
else if (fastcmp(word, "SELECTHEADING"))
|
||||||
{
|
{
|
||||||
deh_strlcpy(mapheaderinfo[num-1]->selectheading, word2,
|
deh_strlcpy(mapheaderinfo[num-1]->selectheading, word2,
|
||||||
|
|
|
@ -4031,7 +4031,7 @@ char *G_BuildMapTitle(INT32 mapnum)
|
||||||
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
||||||
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
|
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
|
||||||
{
|
{
|
||||||
zonetext = M_GetText("ZONE");
|
zonetext = M_GetText("Zone");
|
||||||
len += strlen(zonetext) + 1; // ' ' + zonetext
|
len += strlen(zonetext) + 1; // ' ' + zonetext
|
||||||
}
|
}
|
||||||
if (actnum > 0)
|
if (actnum > 0)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
// Level title font
|
// Level title font
|
||||||
#define LT_FONTSTART '!' // the first font characters
|
#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 LT_FONTSIZE (LT_FONTEND - LT_FONTSTART + 1)
|
||||||
|
|
||||||
#define CRED_FONTSTART '!' // the first font character
|
#define CRED_FONTSTART '!' // the first font character
|
||||||
|
|
|
@ -1177,7 +1177,7 @@ void ST_drawLevelTitle(tic_t titletime)
|
||||||
lvlttlxpos -= V_LevelActNumWidth(actnum);
|
lvlttlxpos -= V_LevelActNumWidth(actnum);
|
||||||
|
|
||||||
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
|
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
|
||||||
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
|
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("Zone"));
|
||||||
ttlnumxpos++;
|
ttlnumxpos++;
|
||||||
|
|
||||||
if (lvlttlxpos < 0)
|
if (lvlttlxpos < 0)
|
||||||
|
@ -1204,7 +1204,7 @@ void ST_drawLevelTitle(tic_t titletime)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fixed_t z = ((titletime - 105)<<FRACBITS)/7;
|
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);
|
zoney = (MIDZONEY + zoneh - MIDDIFF)*(FRACUNIT - z) - (zoneh<<FRACBITS);
|
||||||
lvlttly = ((MIDTTLY + MIDDIFF)<<FRACBITS) + ((200 - (MIDTTLY + MIDDIFF))*z);
|
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);
|
V_DrawLevelTitle(lvlttlxpos, lvlttly, V_PERPLAYER, lvlttl);
|
||||||
|
|
||||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
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)
|
if (lvlttly+48 < 200)
|
||||||
V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl);
|
V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl);
|
||||||
|
|
|
@ -2899,7 +2899,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = toupper(*ch) - LT_FONTSTART;
|
c = *ch - LT_FONTSTART;
|
||||||
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
||||||
{
|
{
|
||||||
cx += 16*dupx;
|
cx += 16*dupx;
|
||||||
|
@ -2934,7 +2934,7 @@ INT32 V_LevelNameWidth(const char *string)
|
||||||
{
|
{
|
||||||
if (string[i] & 0x80)
|
if (string[i] & 0x80)
|
||||||
continue;
|
continue;
|
||||||
c = toupper(string[i]) - LT_FONTSTART;
|
c = string[i] - LT_FONTSTART;
|
||||||
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
||||||
w += 16;
|
w += 16;
|
||||||
else
|
else
|
||||||
|
@ -2953,7 +2953,7 @@ INT32 V_LevelNameHeight(const char *string)
|
||||||
|
|
||||||
for (i = 0; i < strlen(string); i++)
|
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])
|
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue