2020-08-01 19:23:33 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2021-05-12 19:46:49 +00:00
|
|
|
Copyright (C) 2020-2021 Christoph Oelckers
|
2020-08-01 19:23:33 +00:00
|
|
|
|
2021-05-12 19:46:49 +00:00
|
|
|
This file is part of Raze.
|
2020-08-01 19:23:33 +00:00
|
|
|
|
2021-05-12 19:46:49 +00:00
|
|
|
This is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
2020-08-01 19:23:33 +00:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "build.h"
|
|
|
|
#include "v_font.h"
|
|
|
|
|
2020-12-09 14:56:32 +00:00
|
|
|
#include "blood.h"
|
2020-08-01 19:23:33 +00:00
|
|
|
#include "zstring.h"
|
|
|
|
#include "v_2ddrawer.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "v_font.h"
|
2020-08-02 06:39:51 +00:00
|
|
|
#include "statusbar.h"
|
2020-09-06 18:49:43 +00:00
|
|
|
#include "automap.h"
|
2020-10-04 16:31:48 +00:00
|
|
|
#include "v_draw.h"
|
2020-11-22 12:28:20 +00:00
|
|
|
#include "gamecvars.h"
|
2020-08-01 19:23:33 +00:00
|
|
|
|
|
|
|
CVARD(Bool, hud_powerupduration, true, CVAR_ARCHIVE/*|CVAR_FRONTEND_BLOOD*/, "enable/disable displaying the remaining seconds for power-ups")
|
2021-05-13 07:31:08 +00:00
|
|
|
CVAR(Bool, hud_ctf_vanilla, false, CVAR_ARCHIVE)
|
2020-08-01 19:23:33 +00:00
|
|
|
|
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-08-02 16:02:13 +00:00
|
|
|
static void UpdateFrame(void)
|
|
|
|
{
|
|
|
|
auto tex = tileGetTexture(kBackTile);
|
2021-02-27 11:33:47 +00:00
|
|
|
int width = twod->GetWidth();
|
|
|
|
int height = twod->GetHeight();
|
2020-08-02 16:02:13 +00:00
|
|
|
|
2021-12-22 09:28:51 +00:00
|
|
|
twod->AddFlatFill(0, 0, width, windowxy1.Y - 3, tex);
|
|
|
|
twod->AddFlatFill(0, windowxy2.Y + 4, width, height, tex);
|
|
|
|
twod->AddFlatFill(0, windowxy1.Y - 3, windowxy1.X - 3, windowxy2.Y + 4, tex);
|
|
|
|
twod->AddFlatFill(windowxy2.X + 4, windowxy1.Y - 3, width, windowxy2.Y + 4, tex);
|
|
|
|
|
|
|
|
twod->AddFlatFill(windowxy1.X - 3, windowxy1.Y - 3, windowxy1.X, windowxy2.Y + 1, tex, 0, 1, 0xff545454);
|
|
|
|
twod->AddFlatFill(windowxy1.X, windowxy1.Y - 3, windowxy2.X + 4, windowxy1.Y, tex, 0, 1, 0xff545454);
|
|
|
|
twod->AddFlatFill(windowxy2.X + 1, windowxy1.Y, windowxy2.X + 4, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
|
|
|
twod->AddFlatFill(windowxy1.X - 3, windowxy2.Y + 1, windowxy2.X + 1, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
2020-08-02 16:02:13 +00:00
|
|
|
}
|
|
|
|
|
2020-09-01 18:14:15 +00:00
|
|
|
void UpdateStatusBar()
|
2020-08-02 06:39:51 +00:00
|
|
|
{
|
2020-08-24 17:47:09 +00:00
|
|
|
if (automapMode == am_off && hud_size <= Hud_Stbar)
|
2020-08-02 16:02:13 +00:00
|
|
|
{
|
|
|
|
UpdateFrame();
|
|
|
|
}
|
2021-05-11 20:21:52 +00:00
|
|
|
SummaryInfo sum;
|
|
|
|
if (gGameOptions.nGameType == 3)
|
|
|
|
{
|
2021-05-12 19:46:49 +00:00
|
|
|
sum.kills = gView ? gView->fragCount : 0;
|
|
|
|
sum.maxkills = -3;
|
2021-05-11 20:21:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-12 19:46:49 +00:00
|
|
|
sum.kills = gKillMgr.Kills;
|
|
|
|
sum.maxkills = gKillMgr.TotalKills;
|
2021-05-11 20:21:52 +00:00
|
|
|
}
|
2021-05-12 19:46:49 +00:00
|
|
|
sum.secrets = gSecretMgr.Founds;
|
|
|
|
sum.supersecrets = gSecretMgr.Super;
|
|
|
|
sum.maxsecrets = max(gSecretMgr.Founds, gSecretMgr.Total); // If we found more than there are, increase the total. Some levels have a bugged counter.
|
|
|
|
sum.time = Scale(PlayClock, 1000, 120);
|
|
|
|
UpdateStatusBar(&sum);
|
2020-08-01 19:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
END_BLD_NS
|