- converted all remaining add_int_bvel* calls.

This commit is contained in:
Christoph Oelckers 2022-09-25 20:57:28 +02:00
parent 068feae64e
commit e6cfb165f8
2 changed files with 12 additions and 31 deletions

View file

@ -118,21 +118,6 @@ public:
vel .Z = FixedToFloat(x);
}
void add_int_bvel_x(int x)
{
vel .X += FixedToFloat(x);
}
void add_int_bvel_y(int x)
{
vel .Y += FixedToFloat(x);
}
void add_int_bvel_z(int x)
{
vel .Z += FixedToFloat(x);
}
void ZeroVelocityXY()
{
vel .X = vel .Y = 0;

View file

@ -5631,17 +5631,16 @@ static void actCheckThings()
GetActorExtents(actor, &top, &bottom);
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
{
int angle = pXSector->panAngle.Buildang();
int speed = 0;
DAngle angle = pXSector->panAngle;
double speed = 0;
if (pXSector->panAlways || pXSector->state || pXSector->busy)
{
speed = pXSector->panVel << 9;
if (!pXSector->panAlways && pXSector->busy) speed = MulScale(speed, pXSector->busy, 16);
speed = pXSector->panVel / 128.;
if (!pXSector->panAlways && pXSector->busy) speed = MulScaleF(speed, pXSector->busy, 16);
}
if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle += pSector->firstWall()->normalAngle();
actor->add_int_bvel_x(MulScale(speed, Cos(angle), 30));
actor->add_int_bvel_y(MulScale(speed, Sin(angle), 30));
actor->vel += angle.ToVector() * speed;
}
}
actAirDrag(actor, 128);
@ -6056,20 +6055,17 @@ static void actCheckDudes()
GetActorExtents(actor, &top, &bottom);
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
{
int angle = pXSector->panAngle.Buildang();
int speed = 0;
DAngle angle = pXSector->panAngle;
double speed = 0;
if (pXSector->panAlways || pXSector->state || pXSector->busy)
{
speed = pXSector->panVel << 9;
speed = pXSector->panVel / 128.;
if (!pXSector->panAlways && pXSector->busy)
speed = MulScale(speed, pXSector->busy, 16);
speed = MulScaleF(speed, pXSector->busy, 16);
}
if (pSector->floorstat & CSTAT_SECTOR_ALIGN)
angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
actor->add_int_bvel_x(dx);
actor->add_int_bvel_y(dy);
angle += pSector->firstWall()->normalAngle();
actor->vel += angle.ToVector() * speed;
}
}
if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376);