- replaced AActor::vel and player_t::Vel with a floating point version.

- Converted P_MovePlayer and all associated variables to floating point because this wasn't working well with a mixture between float and fixed.

Like the angle commit this has just been patched up to compile, the bulk of work is yet to be done.
This commit is contained in:
Christoph Oelckers 2016-03-20 00:54:18 +01:00
commit 51b05d331d
140 changed files with 2406 additions and 2403 deletions

View file

@ -114,16 +114,16 @@ bool AArtiPoisonBag3::Use (bool pickup)
// is as set by the projectile. To accommodate this with a proper trajectory, we
// aim the projectile ~20 degrees higher than we're looking at and increase the
// speed we fire at accordingly.
angle_t orgpitch = angle_t(-Owner->_f_pitch()) >> ANGLETOFINESHIFT;
angle_t modpitch = angle_t(0xDC00000 - Owner->_f_pitch()) >> ANGLETOFINESHIFT;
angle_t angle = mo->_f_angle() >> ANGLETOFINESHIFT;
fixed_t speed = fixed_t(g_sqrt((double)mo->Speed*mo->Speed + (4.0*65536*4*65536)));
fixed_t xyscale = FixedMul(speed, finecosine[modpitch]);
DAngle orgpitch = -Owner->Angles.Pitch;
DAngle modpitch = clamp<DAngle>(-Owner->Angles.Pitch + 20, -89., 89.);
DAngle angle = mo->Angles.Yaw;
double speed = DVector2(mo->Speed, 4.).Length();
double xyscale = speed * modpitch.Cos();
mo->vel.z = FixedMul(speed, finesine[modpitch]);
mo->vel.x = FixedMul(xyscale, finecosine[angle]) + (Owner->vel.x >> 1);
mo->vel.y = FixedMul(xyscale, finesine[angle]) + (Owner->vel.y >> 1);
mo->AddZ(FixedMul(mo->Speed, finesine[orgpitch]));
mo->Vel.Z = speed * modpitch.Sin();
mo->Vel.X = xyscale * angle.Cos() + Owner->Vel.X / 2;
mo->Vel.Y = xyscale * angle.Sin() + Owner->Vel.Y / 2;
mo->AddZ(mo->Speed * orgpitch.Sin());
mo->target = Owner;
mo->tics -= pr_poisonbag()&3;
@ -306,7 +306,7 @@ IMPLEMENT_CLASS (APoisonCloud)
void APoisonCloud::BeginPlay ()
{
vel.x = 1; // missile objects must move to impact other objects
Vel.X = MinVel; // missile objects must move to impact other objects
special1 = 24+(pr_poisoncloud()&7);
special2 = 0;
}
@ -419,7 +419,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
P_RadiusAttack (self, self->target, 4, 40, self->DamageType, RADF_HURTSOURCE);
bobIndex = self->special2;
self->AddZ(finesine[bobIndex << BOBTOFINESHIFT] >> 1);
self->_f_AddZ(finesine[bobIndex << BOBTOFINESHIFT] >> 1);
self->special2 = (bobIndex + 1) & 63;
return 0;
}
@ -454,13 +454,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
// [RH] Check using actual velocity, although the vel.z < 2 check still stands
//if (abs(self->vel.x) < FRACUNIT*3/2 && abs(self->vel.y) < FRACUNIT*3/2
// && self->vel.z < 2*FRACUNIT)
if (self->vel.z < 2*FRACUNIT &&
TMulScale32 (self->vel.x, self->vel.x, self->vel.y, self->vel.y, self->vel.z, self->vel.z)
< (3*3)/(2*2))
if (self->Vel.Z < 2 && self->Vel.LengthSquared() < (9./4.))
{
self->SetState (self->SpawnState + 6);
self->SetZ(self->floorz);
self->vel.z = 0;
self->_f_SetZ(self->floorz);
self->Vel.Z = 0;
self->BounceFlags = BOUNCE_None;
self->flags &= ~MF_MISSILE;
}