mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- Fixed: when using the border property of drawbar, interpolation didn't work quite right.
SVN r2705 (trunk)
This commit is contained in:
parent
e9211aaad3
commit
31754a582d
2 changed files with 7 additions and 8 deletions
|
@ -1288,7 +1288,7 @@ public:
|
|||
}
|
||||
|
||||
if(clearDontDraw)
|
||||
screen->Clear(static_cast<int>(rcx), static_cast<int>(rcy), static_cast<int>(MIN<double>(rcr, w)), static_cast<int>(MIN<double>(rcb, h)), GPalette.BlackIndex, 0);
|
||||
screen->Clear(static_cast<int>(rcx), static_cast<int>(rcy), static_cast<int>(MIN<double>(rcr, rcx+w)), static_cast<int>(MIN<double>(rcb, rcy+h)), GPalette.BlackIndex, 0);
|
||||
else
|
||||
{
|
||||
if(alphaMap)
|
||||
|
|
|
@ -2084,9 +2084,12 @@ class CommandDrawBar : public SBarInfoCommand
|
|||
|
||||
FTexture *fg = statusBar->Images[foreground];
|
||||
FTexture *bg = (background != -1) ? statusBar->Images[background] : NULL;
|
||||
|
||||
|
||||
fixed_t value = drawValue;
|
||||
if(border != 0)
|
||||
{
|
||||
value = FRACUNIT - value; //invert since the new drawing method requires drawing the bg on the fg.
|
||||
|
||||
//Draw the whole foreground
|
||||
statusBar->DrawGraphic(fg, this->x, this->y, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
|
||||
}
|
||||
|
@ -2103,7 +2106,7 @@ class CommandDrawBar : public SBarInfoCommand
|
|||
fixed_t clip[4] = {0, 0, 0, 0};
|
||||
|
||||
fixed_t sizeOfImage = (horizontal ? fg->GetScaledWidth()-border*2 : fg->GetScaledHeight()-border*2)<<FRACBITS;
|
||||
clip[(!horizontal)|((horizontal ? !reverse : reverse)<<1)] = sizeOfImage - FixedMul(sizeOfImage, drawValue);
|
||||
clip[(!horizontal)|((horizontal ? !reverse : reverse)<<1)] = sizeOfImage - FixedMul(sizeOfImage, value);
|
||||
// Draw background
|
||||
if(border != 0)
|
||||
{
|
||||
|
@ -2360,17 +2363,13 @@ class CommandDrawBar : public SBarInfoCommand
|
|||
}
|
||||
default: return;
|
||||
}
|
||||
|
||||
if(border != 0)
|
||||
value = max - value; //invert since the new drawing method requires drawing the bg on the fg.
|
||||
|
||||
if(max != 0 && value > 0)
|
||||
{
|
||||
value = (value << FRACBITS) / max;
|
||||
if(value > FRACUNIT)
|
||||
value = FRACUNIT;
|
||||
}
|
||||
else if(border != 0 && max == 0 && value <= 0)
|
||||
value = FRACUNIT;
|
||||
else
|
||||
value = 0;
|
||||
if(interpolationSpeed != 0 && (!hudChanged || level.time == 1))
|
||||
|
|
Loading…
Reference in a new issue