Permalink
Browse files

heretic: Apply HHE level names in intermission screen.

The same string is used for the level name in the automap and intermission
screen, but string replacements were only being applied for the automap.

This fixes #1106. Thanks to @ETTiNGRiNDER for the report.
  • Loading branch information...
fragglet committed Dec 28, 2018
1 parent 8179451 commit af804990166f96c87bbd9fb317251f5fe79de56b
Showing with 26 additions and 17 deletions.
  1. +26 −17 src/heretic/in_lude.c
@@ -141,6 +141,17 @@ static yahpt_t YAHspot[3][9] = {
}
};

static const char *NameForMap(int map)
{
const char *name = LevelNames[(gameepisode - 1) * 9 + map - 1];
name = DEH_String(name);
if (strlen(name) < 7)
{
return "";
}
return name + 7;
}

//========================================================================
//
// IN_Start
@@ -596,12 +607,12 @@ void IN_DrawStatBack(void)

void IN_DrawOldLevel(void)
{
const char *level_name = NameForMap(prevmap);
int i;
int x;

x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
x = 160 - MN_TextBWidth(level_name) / 2;
IN_DrTextB(level_name, x, 3);
x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
MN_DrTextA(DEH_String("FINISHED"), x, 25);

@@ -647,14 +658,14 @@ void IN_DrawOldLevel(void)

void IN_DrawYAH(void)
{
const char *level_name = NameForMap(gamemap);
int i;
int x;

x = 160 - MN_TextAWidth(DEH_String("NOW ENTERING:")) / 2;
MN_DrTextA(DEH_String("NOW ENTERING:"), x, 10);
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] + 7, x, 20);
x = 160 - MN_TextBWidth(level_name) / 2;
IN_DrTextB(level_name, x, 20);

if (prevmap == 9)
{
@@ -685,16 +696,17 @@ void IN_DrawYAH(void)

void IN_DrawSingleStats(void)
{
const char *prev_level_name = NameForMap(prevmap);
const char *next_level_name = NameForMap(gamemap);
int x;
static int sounds;

IN_DrTextB(DEH_String("KILLS"), 50, 65);
IN_DrTextB(DEH_String("ITEMS"), 50, 90);
IN_DrTextB(DEH_String("SECRETS"), 50, 115);

x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
x = 160 - MN_TextBWidth(prev_level_name) / 2;
IN_DrTextB(prev_level_name, x, 3);
x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
MN_DrTextA(DEH_String("FINISHED"), x, 25);

@@ -754,11 +766,8 @@ void IN_DrawSingleStats(void)
{
x = 160 - MN_TextAWidth(DEH_String("NOW ENTERING:")) / 2;
MN_DrTextA(DEH_String("NOW ENTERING:"), x, 160);
x = 160 -
MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] + 7, x,
170);
x = 160 - MN_TextBWidth(next_level_name) / 2;
IN_DrTextB(next_level_name, x, 170);
skipintermission = false;
}
}
@@ -771,6 +780,7 @@ void IN_DrawSingleStats(void)

void IN_DrawCoopStats(void)
{
const char *level_name = NameForMap(prevmap);
int i;
int x;
int ypos;
@@ -780,9 +790,8 @@ void IN_DrawCoopStats(void)
IN_DrTextB(DEH_String("KILLS"), 95, 35);
IN_DrTextB(DEH_String("BONUS"), 155, 35);
IN_DrTextB(DEH_String("SECRET"), 232, 35);
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
x = 160 - MN_TextBWidth(level_name) / 2;
IN_DrTextB(level_name, x, 3);
x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
MN_DrTextA(DEH_String("FINISHED"), x, 25);

0 comments on commit af80499

Please sign in to comment.