mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- converted all remaining add_int_bvel* calls.
This commit is contained in:
parent
068feae64e
commit
e6cfb165f8
2 changed files with 12 additions and 31 deletions
|
@ -118,21 +118,6 @@ public:
|
||||||
vel .Z = FixedToFloat(x);
|
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()
|
void ZeroVelocityXY()
|
||||||
{
|
{
|
||||||
vel .X = vel .Y = 0;
|
vel .X = vel .Y = 0;
|
||||||
|
|
|
@ -5631,17 +5631,16 @@ static void actCheckThings()
|
||||||
GetActorExtents(actor, &top, &bottom);
|
GetActorExtents(actor, &top, &bottom);
|
||||||
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
|
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
|
||||||
{
|
{
|
||||||
int angle = pXSector->panAngle.Buildang();
|
DAngle angle = pXSector->panAngle;
|
||||||
int speed = 0;
|
double speed = 0;
|
||||||
if (pXSector->panAlways || pXSector->state || pXSector->busy)
|
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);
|
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->vel += angle.ToVector() * speed;
|
||||||
actor->add_int_bvel_y(MulScale(speed, Sin(angle), 30));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actAirDrag(actor, 128);
|
actAirDrag(actor, 128);
|
||||||
|
@ -6056,20 +6055,17 @@ static void actCheckDudes()
|
||||||
GetActorExtents(actor, &top, &bottom);
|
GetActorExtents(actor, &top, &bottom);
|
||||||
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
|
if (getflorzofslopeptr(pSector, actor->spr.pos) <= bottom)
|
||||||
{
|
{
|
||||||
int angle = pXSector->panAngle.Buildang();
|
DAngle angle = pXSector->panAngle;
|
||||||
int speed = 0;
|
double speed = 0;
|
||||||
if (pXSector->panAlways || pXSector->state || pXSector->busy)
|
if (pXSector->panAlways || pXSector->state || pXSector->busy)
|
||||||
{
|
{
|
||||||
speed = pXSector->panVel << 9;
|
speed = pXSector->panVel / 128.;
|
||||||
if (!pXSector->panAlways && pXSector->busy)
|
if (!pXSector->panAlways && pXSector->busy)
|
||||||
speed = MulScale(speed, pXSector->busy, 16);
|
speed = MulScaleF(speed, pXSector->busy, 16);
|
||||||
}
|
}
|
||||||
if (pSector->floorstat & CSTAT_SECTOR_ALIGN)
|
if (pSector->floorstat & CSTAT_SECTOR_ALIGN)
|
||||||
angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
|
angle += pSector->firstWall()->normalAngle();
|
||||||
int dx = MulScale(speed, Cos(angle), 30);
|
actor->vel += angle.ToVector() * speed;
|
||||||
int dy = MulScale(speed, Sin(angle), 30);
|
|
||||||
actor->add_int_bvel_x(dx);
|
|
||||||
actor->add_int_bvel_y(dy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376);
|
if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376);
|
||||||
|
|
Loading…
Reference in a new issue