- Added Blzut3's submission for displaying underwater stats in SBARINFO.

SVN r1629 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-01 07:10:22 +00:00
parent 14cdab7e39
commit 5061e2e8fd
4 changed files with 21 additions and 1 deletions

View file

@ -1,4 +1,7 @@
May 31, 2009 (Changes by Graf Zahl)
June 1, 2009 (Changes by Graf Zahl)
- Added Blzut3's submission for displaying underwater stats in SBARINFO.
May 31, 2009 (Changes by Graf Zahl)
- Added Gez's AMMO_CHECKBOTH submission.
- Added Gez's THRUSPECIES submission.
- Added loading directories into the lump directory.

View file

@ -241,6 +241,7 @@ enum //drawnumber flags
DRAWNUMBER_WHENNOTZERO = 0x40000,
DRAWNUMBER_POWERUPTIME = 0x80000,
DRAWNUMBER_DRAWSHADOW = 0x100000,
DRAWNUMBER_AIRTIME = 0x200000,
};
enum //drawbar flags (will go into special2)

View file

@ -710,6 +710,13 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
value = 0;
}
}
else if(cmd.flags & DRAWNUMBER_AIRTIME)
{
if(CPlayer->mo->waterlevel < 3)
value = level.airsupply/TICRATE;
else
value = clamp<int>((CPlayer->air_finished - level.time + (TICRATE-1))/TICRATE, 0, INT_MAX);
}
bool fillzeros = !!(cmd.flags & DRAWNUMBER_FILLZEROS);
bool drawshadow = !!(cmd.flags & DRAWNUMBER_DRAWSHADOW);
EColorRange translation = cmd.translation;
@ -921,6 +928,11 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
max = powerupGiver->EffectTics + 1;
}
}
else if(cmd.flags & DRAWNUMBER_AIRTIME)
{
value = clamp<int>(CPlayer->air_finished - level.time, 0, INT_MAX);
max = level.airsupply;
}
if(cmd.special3 != 0)
value = max - value; //invert since the new drawing method requires drawing the bg on the fg.
if(max != 0 && value > 0)

View file

@ -606,6 +606,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
cmd.flags |= DRAWNUMBER_TOTALSECRETS;
else if(sc.Compare("armorclass"))
cmd.flags |= DRAWNUMBER_ARMORCLASS;
else if(sc.Compare("airtime"))
cmd.flags |= DRAWNUMBER_AIRTIME;
else if(sc.Compare("globalvar"))
{
cmd.flags |= DRAWNUMBER_GLOBALVAR;
@ -926,6 +928,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
cmd.flags = DRAWNUMBER_ITEMS;
else if(sc.Compare("secrets"))
cmd.flags = DRAWNUMBER_SECRETS;
else if(sc.Compare("airtime"))
cmd.flags = DRAWNUMBER_AIRTIME;
else if(sc.Compare("poweruptime"))
{
cmd.flags |= DRAWNUMBER_POWERUPTIME;