Skip to content

Commit 41231b9

Browse files
committed
Fix warnings
1 parent de41d7d commit 41231b9

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

prboom2/src/heretic/in_lude.c

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ static void IN_DrawInterpic(void)
207207
}
208208
else
209209
{
210-
if (gameepisode < 1 || gameepisode > 3) return;
211-
212-
const char name[9];
210+
char name[9];
213211
snprintf(name, sizeof(name), "MAPE%d", gameepisode);
214212

215213
V_DrawNamePatchFS(0, 0, 0, name, CR_DEFAULT, VPT_STRETCH);
@@ -249,13 +247,13 @@ static void IN_InitLumps(void)
249247

250248
static void IN_InitVariables(wbstartstruct_t* wbstartstruct)
251249
{
252-
wbs = wbstartstruct;
253-
prevmap = wbs->last + 1;
254-
nextmap = wbs->next + 1;
255-
256250
int behaviour;
257251
dsda_ShowNextLocBehaviour(&behaviour);
258252
finalintermission = (behaviour & WI_SHOW_NEXT_DONE);
253+
254+
wbs = wbstartstruct;
255+
prevmap = wbs->last + 1;
256+
nextmap = wbs->next + 1;
259257
}
260258

261259
//========================================================================
@@ -650,12 +648,10 @@ void IN_DrawStatBack(void)
650648

651649
void IN_DrawOldLevel(void)
652650
{
653-
int x;
654-
655651
const char *prev_level_name = lf_levelname ? lf_levelname : NameForMap(prevmap);
652+
656653
IN_DrawLevelname(lf_levelpic, prev_level_name, 3);
657-
x = 160 - MN_TextAWidth("FINISHED") / 2;
658-
MN_DrTextA("FINISHED", x, 25);
654+
MN_DrTextA("FINISHED", 160 - MN_TextAWidth("FINISHED") / 2, 25);
659655

660656
if (exitpic) return;
661657

@@ -697,8 +693,7 @@ void IN_DrawYAH(void)
697693
{
698694
const char *level_name = el_levelname ? el_levelname : NameForMap(nextmap);
699695

700-
int x = 160 - MN_TextAWidth("NOW ENTERING:") / 2;
701-
MN_DrTextA("NOW ENTERING:", x, 10);
696+
MN_DrTextA("NOW ENTERING:", 160 - MN_TextAWidth("NOW ENTERING:") / 2, 10);
702697
IN_DrawLevelname(el_levelpic, level_name, 20);
703698

704699
if (prevmap == 9)
@@ -816,15 +811,12 @@ void IN_DrawSingleStats(void)
816811
}
817812
else
818813
{
814+
const char *next_level_name = el_levelname ? el_levelname : NameForMap(nextmap);
819815
yoffset = 0;
820816

821-
const char *next_level_name = NameForMap(nextmap);
822-
if (el_levelname) next_level_name = el_levelname;
823-
824817
x = 160 - MN_TextAWidth("NOW ENTERING:") / 2;
825818
MN_DrTextA("NOW ENTERING:", x, 160);
826-
x = 160 - MN_TextBWidth(next_level_name) / 2;
827-
IN_DrTextB(next_level_name, x, 170);
819+
IN_DrawLevelname(el_levelpic, next_level_name, 170);
828820
skipintermission = false;
829821
}
830822

@@ -856,20 +848,18 @@ void IN_DrawSingleStats(void)
856848

857849
void IN_DrawCoopStats(void)
858850
{
859-
const char *level_name = NameForMap(prevmap);
860-
if (lf_levelname) level_name = lf_levelname;
851+
static int sounds;
852+
int ypos = 50;
861853

862-
int x = 160 - MN_TextBWidth(level_name) / 2;
863-
IN_DrTextB(level_name, x, 3);
864-
x = 160 - MN_TextAWidth("FINISHED") / 2;
865-
MN_DrTextA("FINISHED", x, 25);
854+
const char *prev_level_name = lf_levelname ? lf_levelname : NameForMap(prevmap);
855+
IN_DrawLevelname(lf_levelpic, prev_level_name, 3);
856+
857+
MN_DrTextA("FINISHED", 160 - MN_TextAWidth("FINISHED") / 2, 25);
866858

867859
IN_DrTextB("KILLS", 95, 35);
868860
IN_DrTextB("BONUS", 155, 35);
869861
IN_DrTextB("SECRET", 232, 35);
870862

871-
static int sounds;
872-
int ypos = 50;
873863
for (int i = 0; i < g_maxplayers; i++)
874864
{
875865
if (playeringame[i])
@@ -1131,13 +1121,13 @@ void IN_DrTextB(const char *text, int x, int y)
11311121

11321122
while ((c = *text++) != 0)
11331123
{
1124+
if (c > 90) // Lowercase chars
1125+
c -= 32;
1126+
11341127
if (c < 33)
1135-
{
1136-
x += 8;
1137-
}
1128+
x += 8;
11381129
else
11391130
{
1140-
if (c > 90) c -= 32;
11411131
int lump = FontBLump + c - 33;
11421132
V_DrawShadowedNumPatch(x, y, lump);
11431133
x += R_NumPatchWidth(lump) - 1;

0 commit comments

Comments
 (0)