- Fixed: DrawSelectedInventory set the wrong variable and thus always used CR_GOLD as its translation.

- Fixed: Draw(Switchable)Image didn't handle the alpha value properly.

SVN r2116 (trunk)
This commit is contained in:
Christoph Oelckers 2010-01-18 19:38:36 +00:00
parent a3ac7ee081
commit 7183a2f751
1 changed files with 13 additions and 4 deletions

View File

@ -55,7 +55,12 @@ class CommandDrawImage : public SBarInfoCommand
if(texture == NULL)
return;
statusBar->DrawGraphic(texture, imgx, imgy, block->XOffset(), block->YOffset(), alpha, block->FullScreenOffsets(),
// We must calculate this per frame in order to prevent glitches with cl_capfps true.
fixed_t frameAlpha = block->Alpha();
if(alpha != FRACUNIT)
frameAlpha = fixed_t(((double) block->Alpha() / (double) FRACUNIT) * ((double) alpha / (double) OPAQUE) * FRACUNIT);
statusBar->DrawGraphic(texture, imgx, imgy, block->XOffset(), block->YOffset(), frameAlpha, block->FullScreenOffsets(),
translatable, false, offset);
}
void Parse(FScanner &sc, bool fullScreenOffsets)
@ -132,7 +137,7 @@ class CommandDrawImage : public SBarInfoCommand
void Tick(const SBarInfoMainBlock *block, const DSBarInfo *statusBar, bool hudChanged)
{
texture = NULL;
alpha = block->Alpha();
alpha = FRACUNIT;
if(type == PLAYERICON)
texture = TexMan[statusBar->CPlayer->mo->ScoreIcon];
else if(type == AMMO1)
@ -474,6 +479,10 @@ class CommandDrawSwitchableImage : public CommandDrawImage
if(drawAlt != 0) //draw 'off' image
{
texture = statusBar->Images[conditionalImage[drawAlt-1]];
// Since we're not going to call our parent's tick() method,
// be sure to set the alpha value properly.
alpha = FRACUNIT;
return;
}
CommandDrawImage::Tick(block, statusBar, hudChanged);
@ -1061,13 +1070,13 @@ class CommandDrawSelectedInventory : public SBarInfoCommandFlowControl, private
CommandDrawImage::GetCoordinates(sc, fullScreenOffsets, imgx, imgy);
startX = imgx + 30;
y = imgy + 24;
translation = CR_GOLD;
normalTranslation = CR_GOLD;
if(sc.CheckToken(',')) //more font information
{
CommandDrawNumber::GetCoordinates(sc, fullScreenOffsets, startX, y);
if(sc.CheckToken(','))
{
translation = CommandDrawNumber::GetTranslation(sc);
normalTranslation = CommandDrawNumber::GetTranslation(sc);
if(sc.CheckToken(','))
{
sc.MustGetToken(TK_IntConst);