- add_int_bvel_z

This commit is contained in:
Christoph Oelckers 2022-09-01 21:08:05 +02:00
parent 49d280c665
commit 1999340c8a
6 changed files with 27 additions and 27 deletions

View file

@ -246,16 +246,16 @@ public:
__int_vel .Y += x;
}
void add_int_bvel_z(int x)
{
__int_vel .Z += x;
}
void clear_vel_xy()
{
__int_vel .X = __int_vel .Y = 0;
}
void add_int_bvel_z(int x)
{
__int_vel.Z += x;
}
// Same as above but with inverted y and z axes to match the renderer's coordinate system.
double interpolatedx(double const smoothratio, int const scale = 16)

View file

@ -2577,7 +2577,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector
int t = Scale(damage, size, mass);
actor->add_int_bvel_x((int)MulScaleF(t, vect.X, 12));
actor->add_int_bvel_y((int)MulScaleF(t, vect.Y, 12));
actor->__int_vel.Z += (int)MulScaleF(t, vect.Z, 12);
actor->add_int_bvel_z((int)MulScaleF(t, vect.Z, 12));
}
}
actDamageSprite(source, actor, kDamageExplode, damage);
@ -4577,7 +4577,7 @@ static Collision MoveThing(DBloodActor* actor)
if ((actor->spr.flags & 2) && bottom < floorZ)
{
actor->spr.pos.Z += 1.777;
actor->__int_vel.Z += 58254;
actor->add_int_bvel_z(58254);
if (actor->spr.type == kThingZombieHead)
{
auto* fxActor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos, 0);
@ -4905,7 +4905,7 @@ void MoveDude(DBloodActor* actor)
if (vc)
{
actor->add_int_z(((vc * 4) / 2) >> 8);
actor->__int_vel.Z += vc;
actor->add_int_bvel_z(vc);
}
}
if (pPlayer && actor->__int_vel.Z > 0x155555 && !pPlayer->fallScream && actor->xspr.height > 0)
@ -5238,7 +5238,7 @@ int MoveMissile(DBloodActor* actor)
int deltaz = dz / 10;
if (target->int_pos().Z < actor->int_pos().Z) deltaz = -deltaz;
actor->__int_vel.Z += deltaz;
actor->add_int_bvel_z(deltaz);
}
}
auto vel = actor->fVel();
@ -6405,7 +6405,7 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
fired->__int_vel.Z = MulScale(a6, a4, 14);
fired->add_int_bvel_x(actor->int_vel().X / 2);
fired->add_int_bvel_y(actor->int_vel().Y / 2);
fired->__int_vel.Z += actor->int_vel().Z / 2;
fired->add_int_bvel_z(actor->int_vel().Z / 2);
return fired;
}
@ -6450,7 +6450,7 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
seqSpawn(27, spawned, -1);
spawned->add_int_bvel_x(actor->int_vel().X / 2 + Random2(0x11111));
spawned->add_int_bvel_y(actor->int_vel().Y / 2 + Random2(0x11111));
spawned->__int_vel.Z += actor->int_vel().Z / 2 + Random2(0x11111);
spawned->add_int_bvel_z(actor->int_vel().Z / 2 + Random2(0x11111));
break;
case kMissileFireballCerberus:
seqSpawn(61, spawned, dword_2192E0);
@ -6460,14 +6460,14 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
seqSpawn(23, spawned, dword_2192D8);
spawned->add_int_bvel_x(actor->int_vel().X / 2 + Random2(0x11111));
spawned->add_int_bvel_y(actor->int_vel().Y / 2 + Random2(0x11111));
spawned->__int_vel.Z += actor->int_vel().Z / 2 + Random2(0x11111);
spawned->add_int_bvel_z(actor->int_vel().Z / 2 + Random2(0x11111));
break;
case kMissileFlameSpray:
if (Chance(0x8000)) seqSpawn(0, spawned, -1);
else seqSpawn(1, spawned, -1);
spawned->add_int_bvel_x(actor->int_vel().X / 2 + Random2(0x11111));
spawned->add_int_bvel_y(actor->int_vel().Y / 2 + Random2(0x11111));
spawned->__int_vel.Z += actor->int_vel().Z / 2 + Random2(0x11111);
spawned->add_int_bvel_z(actor->int_vel().Z / 2 + Random2(0x11111));
break;
case kMissileFlareAlt:
evPostActor(spawned, 30, kCallbackFXFlareBurst);
@ -6771,7 +6771,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
int t2 = DivScale(pVectorData->impulse, t, 8);
actor->add_int_bvel_x(MulScale(a4, t2, 16));
actor->add_int_bvel_y(MulScale(a5, t2, 16));
actor->__int_vel.Z += MulScale(a6, t2, 16);
actor->add_int_bvel_z(MulScale(a6, t2, 16));
}
if (pVectorData->burnTime)
{
@ -6801,7 +6801,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
int t2 = DivScale(pVectorData->impulse, t, 8);
actor->add_int_bvel_x(MulScale(a4, t2, 16));
actor->add_int_bvel_y(MulScale(a5, t2, 16));
actor->__int_vel.Z += MulScale(a6, t2, 16);
actor->add_int_bvel_z(MulScale(a6, t2, 16));
}
if (pVectorData->burnTime)
{
@ -6859,7 +6859,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
int impulse = DivScale(pVectorData->impulse, ClipLow(actor->spriteMass.mass, 10), 6);
actor->add_int_bvel_x(MulScale(a4, impulse, 16));
actor->add_int_bvel_y(MulScale(a5, impulse, 16));
actor->__int_vel.Z += MulScale(a6, impulse, 16);
actor->add_int_bvel_z(MulScale(a6, impulse, 16));
if (pVectorData->burnTime != 0) {
if (!actor->xspr.burnTime) evPostActor(actor, 0, kCallbackFXFlameLick);

View file

@ -110,7 +110,7 @@ void FlareBurst(DBloodActor* actor, sectortype*) // 2
RotateVector(&dx, &dy, nAngle);
spawnedactor->add_int_bvel_x(dx);
spawnedactor->add_int_bvel_y(dy);
spawnedactor->__int_vel.Z += dz;
spawnedactor->add_int_bvel_z(dz);
evPostActor(spawnedactor, 960, kCallbackRemove);
}
evPostActor(actor, 0, kCallbackRemove);

View file

@ -260,7 +260,7 @@ void CFX::fxProcess(void)
continue;
}
}
actor->__int_vel.Z += pFXData->gravity;
actor->add_int_bvel_z(pFXData->gravity);
}
}

View file

@ -1054,13 +1054,13 @@ static void windGenDoVerticalWind(int factor, sectortype* pSector)
if (maxZfound && actor->int_pos().Z <= maxZ)
{
zdiff = actor->int_pos().Z - maxZ;
if (actor->__int_vel.Z < 0) actor->__int_vel.Z += MulScale(actor->int_vel().Z >> 4, zdiff, 16);
if (actor->__int_vel.Z < 0) actor->add_int_bvel_z(MulScale(actor->int_vel().Z >> 4, zdiff, 16));
continue;
}
val = -MulScale(factor * 64, 0x10000, 16);
if (actor->__int_vel.Z >= 0) actor->__int_vel.Z += val;
if (actor->__int_vel.Z >= 0) actor->add_int_bvel_z(val);
else actor->__int_vel.Z = val;
actor->add_int_z(actor->int_vel().Z >> 12);
@ -1583,7 +1583,7 @@ void debrisConcuss(DBloodActor* owneractor, int listIndex, int x, int y, int z,
actor->add_int_bvel_x(MulScale(t, dx, 16));
actor->add_int_bvel_y(MulScale(t, dy, 16));
actor->__int_vel.Z += MulScale(t, dz, 16);
actor->add_int_bvel_z(MulScale(t, dz, 16));
}
if (thing)
@ -1734,14 +1734,14 @@ void debrisMove(int listIndex)
if (vc)
{
actor->add_int_z(((vc << 2) >> 1) >> 8);
actor->__int_vel.Z += vc;
actor->add_int_bvel_z(vc);
}
}
else if ((actor->xspr.physAttr & kPhysGravity) && bottom < floorZ)
{
actor->spr.pos.Z += 1.777;
actor->__int_vel.Z += 58254;
actor->add_int_bvel_z(58254);
}
@ -3120,7 +3120,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi
{
pSprite->add_int_bvel_x(xv);
pSprite->add_int_bvel_y(yv);
pSprite->__int_vel.Z += zv;
pSprite->add_int_bvel_z(zv);
}
else
{
@ -9234,7 +9234,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
RotateVector(&dx, &dy, nAngle);
burstactor->add_int_bvel_x(dx);
burstactor->add_int_bvel_y(dy);
burstactor->__int_vel.Z += dz;
burstactor->add_int_bvel_z(dz);
evPostActor(burstactor, 960, kCallbackRemove);
}
evPostActor(actor, 0, kCallbackRemove);

View file

@ -1453,7 +1453,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
int t2 = DivScale(0xccccc, nMass, 8);
hitactor->add_int_bvel_x(MulScale(x, t2, 16));
hitactor->add_int_bvel_y(MulScale(y, t2, 16));
hitactor->__int_vel.Z += MulScale(z, t2, 16);
hitactor->add_int_bvel_z(MulScale(z, t2, 16));
}
if (hitactor->xspr.Push && !hitactor->xspr.state && !hitactor->xspr.isTriggered)
trTriggerSprite(hitactor, kCmdSpritePush);
@ -1658,7 +1658,7 @@ void ProcessInput(PLAYER* pPlayer)
if (pInput->actions & SB_JUMP)
actor->__int_vel.Z -= pPosture->normalJumpZ;//0x5b05;
if (pInput->actions & SB_CROUCH)
actor->__int_vel.Z += pPosture->normalJumpZ;//0x5b05;
actor->add_int_bvel_z(pPosture->normalJumpZ);//0x5b05;
break;
case 2:
if (!(pInput->actions & SB_CROUCH))