Skip to content

Commit

Permalink
Heretic|Intermission: Show map play time
Browse files Browse the repository at this point in the history
The play time of the map is shown below the other stats.
  • Loading branch information
skyjake committed Jul 21, 2019
1 parent 474f9ee commit a13c389
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions doomsday/apps/plugins/heretic/src/intermission.cpp
Expand Up @@ -663,7 +663,7 @@ static void drawSinglePlayerStats()

if(sounds < 1 && interTime >= 30)
{
S_LocalSound(SFX_DORCLS, NULL);
S_LocalSound(SFX_DORCLS, nullptr);
sounds++;
}

Expand All @@ -687,7 +687,7 @@ static void drawSinglePlayerStats()

if(sounds < 2 && interTime >= 60)
{
S_LocalSound(SFX_DORCLS, NULL);
S_LocalSound(SFX_DORCLS, nullptr);
sounds++;
}

Expand All @@ -709,7 +709,7 @@ static void drawSinglePlayerStats()

if(sounds < 3 && interTime >= 90)
{
S_LocalSound(SFX_DORCLS, NULL);
S_LocalSound(SFX_DORCLS, nullptr);
sounds++;
}

Expand All @@ -733,23 +733,25 @@ static void drawSinglePlayerStats()

if(sounds < 4 && interTime >= 150)
{
S_LocalSound(SFX_DORCLS, NULL);
S_LocalSound(SFX_DORCLS, nullptr);
sounds++;
}

if(gameMode != heretic_extended || haveLocationMap)
// Map play time.
{
DGL_Enable(DGL_TEXTURE_2D);

FR_SetFont(FID(GF_FONTB));
FR_SetColorAndAlpha(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1);
FR_DrawTextXY3(labelString("TIME"), 85, 160, ALIGN_TOPLEFT, DTF_ONLY_SHADOW);
FR_DrawTextXY3(labelString("TIME"), 50, 140, ALIGN_TOPLEFT, DTF_ONLY_SHADOW);

drawTime(Vector2i(284, 160), hours, minutes, seconds, Vector4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1));
drawTime(Vector2i(284, 140), hours, minutes, seconds, Vector4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1));

DGL_Disable(DGL_TEXTURE_2D);
}
else

// Without a location map, show at least here on the stats screen what the next map will be.
if (!haveLocationMap && interTime > 220)
{
if (!wbs->nextMap.isEmpty())
{
Expand Down Expand Up @@ -938,15 +940,15 @@ void IN_Ticker()
{
inState = 2;
advanceState = false;
S_StartSound(SFX_DORCLS, NULL);
S_StartSound(SFX_DORCLS, nullptr);
NetSv_Intermission(IMF_STATE, inState, 0);
return;
}

endIntermissionGoToNextLevel();
stateCounter = 10;
advanceState = false;
S_StartSound(SFX_DORCLS, NULL);
S_StartSound(SFX_DORCLS, nullptr);
NetSv_Intermission(IMF_STATE, inState, 0);
}
}
Expand Down Expand Up @@ -987,7 +989,7 @@ void IN_Drawer()

if(oldInterState != 2 && inState == 2)
{
S_LocalSound(SFX_PSTOP, NULL);
S_LocalSound(SFX_PSTOP, nullptr);
}

if(inState != -1)
Expand Down Expand Up @@ -1075,7 +1077,7 @@ static void initVariables(wbstartstruct_t const &wbstartstruct)
advanceState = false;
interTime = 0;
oldInterTime = 0;
haveLocationMap = locationsForEpisode(gfw_Session()->episodeId()) != 0;
haveLocationMap = locationsForEpisode(gfw_Session()->episodeId()) != nullptr;
}

void IN_Begin(wbstartstruct_t const &wbstartstruct)
Expand Down

0 comments on commit a13c389

Please sign in to comment.