* Updated to ZDoom r2713:

- Replaced AM_Rotate with a more precise floating point version posted by Entryway.
- Fixed: when using the border property of drawbar, interpolation didn't work quite right.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@942 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2010-09-08 08:45:15 +00:00
parent 67fb643a5f
commit 67a7eefbb8
4 changed files with 20 additions and 16 deletions

View file

@ -1938,14 +1938,19 @@ void AM_drawWalls (bool allmap)
//
//=============================================================================
void AM_rotate (fixed_t *x, fixed_t *y, angle_t a)
void AM_rotate(fixed_t *xp, fixed_t *yp, angle_t a)
{
fixed_t tmpx;
double x = FIXED2FLOAT(*xp);
double y = FIXED2FLOAT(*yp);
double rot = (double)a / (double)(1u << 31) * (double)M_PI;
double sinrot = sin(rot);
double cosrot = cos(rot);
a >>= ANGLETOFINESHIFT;
tmpx = DMulScale16 (*x,finecosine[a],*y,-finesine[a]);
*y = DMulScale16 (*x,finesine[a],*y,finecosine[a]);
*x = tmpx;
double tmpx = (x * cosrot) - (y * sinrot);
y = (x * sinrot) + (y * cosrot);
x = tmpx;
*xp = FLOAT2FIXED(x);
*yp = FLOAT2FIXED(y);
}
//=============================================================================

View file

@ -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)

View file

@ -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))

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "2697"
#define ZD_SVN_REVISION_NUMBER 2697
#define ZD_SVN_REVISION_STRING "2713"
#define ZD_SVN_REVISION_NUMBER 2713