- Blood: Replace DBloodActor yvel with vel.Y calls.

This commit is contained in:
Mitchell Richters 2021-12-30 21:16:31 +11:00
parent a9e66ec553
commit ce08fd4304
23 changed files with 224 additions and 224 deletions

View file

@ -2387,7 +2387,7 @@ static void actInitThings()
act->spr.flags = thingInfo[nType].flags;
if (act->spr.flags & kPhysGravity) act->spr.flags |= kPhysFalling;
act->vel.X = act->yvel = act->zvel = 0;
act->vel.X = act->vel.Y = act->zvel = 0;
switch (act->spr.type)
{
@ -2486,7 +2486,7 @@ static void actInitDudes()
act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
#endif
act->vel.X = act->yvel = act->zvel = 0;
act->vel.X = act->vel.Y = act->zvel = 0;
#ifdef NOONE_EXTENSIONS
// add a way to set custom hp for every enemy - should work only if map just started and not loaded.
@ -2575,7 +2575,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, int x, int y,
int size = (tileWidth(actor->spr.picnum) * actor->spr.xrepeat * tileHeight(actor->spr.picnum) * actor->spr.yrepeat) >> 1;
int t = Scale(damage, size, mass);
actor->vel.X += MulScale(t, dx, 16);
actor->yvel += MulScale(t, dy, 16);
actor->vel.Y += MulScale(t, dy, 16);
actor->zvel += MulScale(t, dz, 16);
}
}
@ -2723,7 +2723,7 @@ static void actNapalmMove(DBloodActor* actor)
spawnparam[1] = actor->xspr.data4 - spawnparam[0];
int ang = actor->spr.ang;
actor->vel.X = 0;
actor->yvel = 0;
actor->vel.Y = 0;
actor->zvel = 0;
for (int i = 0; i < 2; i++)
{
@ -2957,7 +2957,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
actDropObject(actor, actor->xspr.dropMsg);
actor->spr.flags &= ~kPhysMove;
actor->vel.X = actor->yvel = 0;
actor->vel.X = actor->vel.Y = 0;
playGenDudeSound(actor, kGenDudeSndTransforming);
int seqId = actor->xspr.data2 + kGenDudeSeqTransform;
@ -2984,7 +2984,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
int top, bottom;
GetActorExtents(actor, &top, &bottom);
CGibPosition gibPos(actor->spr.pos.X, actor->spr.pos.Y, top);
CGibVelocity gibVel(actor->vel.X >> 1, actor->yvel >> 1, -0xccccc);
CGibVelocity gibVel(actor->vel.X >> 1, actor->vel.Y >> 1, -0xccccc);
GibSprite(actor, nGibType, &gibPos, &gibVel);
}
}
@ -3222,7 +3222,7 @@ static void spawnGibs(DBloodActor* actor, int type, int velz)
int top, bottom;
GetActorExtents(actor, &top, &bottom);
CGibPosition gibPos(actor->spr.pos.X, actor->spr.pos.Y, top);
CGibVelocity gibVel(actor->vel.X >> 1, actor->yvel >> 1, velz);
CGibVelocity gibVel(actor->vel.X >> 1, actor->vel.Y >> 1, velz);
GibSprite(actor, GIBTYPE_27, &gibPos, &gibVel);
}
@ -4097,9 +4097,9 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
static void actKickObject(DBloodActor* kicker, DBloodActor* kicked)
{
int nSpeed = ClipLow(approxDist(kicker->vel.X, kicker->yvel) * 2, 0xaaaaa);
int nSpeed = ClipLow(approxDist(kicker->vel.X, kicker->vel.Y) * 2, 0xaaaaa);
kicked->vel.X = MulScale(nSpeed, Cos(kicker->spr.ang + Random2(85)), 30);
kicked->yvel = MulScale(nSpeed, Sin(kicker->spr.ang + Random2(85)), 30);
kicked->vel.Y = MulScale(nSpeed, Sin(kicker->spr.ang + Random2(85)), 30);
kicked->zvel = MulScale(nSpeed, -0x2000, 14);
kicked->spr.flags = 7;
}
@ -4156,7 +4156,7 @@ static void checkCeilHit(DBloodActor* actor)
auto actor2 = coll.actor();
if (actor2 && actor2->hasX())
{
if ((actor2->spr.statnum == kStatThing || actor2->spr.statnum == kStatDude) && (actor->vel.X != 0 || actor->yvel != 0 || actor->zvel != 0))
if ((actor2->spr.statnum == kStatThing || actor2->spr.statnum == kStatDude) && (actor->vel.X != 0 || actor->vel.Y != 0 || actor->zvel != 0))
{
if (actor2->spr.statnum == kStatThing)
{
@ -4166,13 +4166,13 @@ static void checkCeilHit(DBloodActor* actor)
if (pThingInfo->flags & 2) actor2->spr.flags |= 4;
// Inlined ?
actor2->vel.X += MulScale(4, actor2->spr.pos.X - actor->spr.pos.X, 2);
actor2->yvel += MulScale(4, actor2->spr.pos.Y - actor->spr.pos.Y, 2);
actor2->vel.Y += MulScale(4, actor2->spr.pos.Y - actor->spr.pos.Y, 2);
}
else
{
actor2->spr.flags |= 5;
actor2->vel.X += MulScale(4, actor2->spr.pos.X - actor->spr.pos.X, 2);
actor2->yvel += MulScale(4, actor2->spr.pos.Y - actor->spr.pos.Y, 2);
actor2->vel.Y += MulScale(4, actor2->spr.pos.Y - actor->spr.pos.Y, 2);
#ifdef NOONE_EXTENSIONS
// add size shroom abilities
@ -4515,7 +4515,7 @@ void actAirDrag(DBloodActor* actor, int a2)
}
}
actor->vel.X += MulScale(wind_x - actor->vel.X, a2, 16);
actor->yvel += MulScale(wind_y - actor->yvel, a2, 16);
actor->vel.Y += MulScale(wind_y - actor->vel.Y, a2, 16);
actor->zvel -= MulScale(actor->zvel, a2, 16);
}
@ -4538,13 +4538,13 @@ static Collision MoveThing(DBloodActor* actor)
lhit.setNone();
GetActorExtents(actor, &top, &bottom);
const int bakCompat = enginecompatibility_mode;
if (actor->vel.X || actor->yvel)
if (actor->vel.X || actor->vel.Y)
{
auto bakCstat = actor->spr.cstat;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
if ((actor->GetOwner()) && !cl_bloodvanillaexplosions && !VanillaMode())
enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->yvel >> 12, actor->spr.clipdist << 2, (actor->spr.pos.Z - top) / 4, (bottom - actor->spr.pos.Z) / 4, CLIPMASK0, lhit);
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, actor->spr.clipdist << 2, (actor->spr.pos.Z - top) / 4, (bottom - actor->spr.pos.Z) / 4, CLIPMASK0, lhit);
actor->hit.hit = lhit;
enginecompatibility_mode = bakCompat; // restore
actor->spr.cstat = bakCstat;
@ -4558,7 +4558,7 @@ static Collision MoveThing(DBloodActor* actor)
auto& coll = actor->hit.hit;
if (coll.type == kHitWall)
{
actWallBounceVector(&actor->vel.X, &actor->yvel, coll.hitWall, pThingInfo->elastic);
actWallBounceVector(&actor->vel.X, &actor->vel.Y, coll.hitWall, pThingInfo->elastic);
switch (actor->spr.type)
{
case kThingZombieHead:
@ -4604,7 +4604,7 @@ static Collision MoveThing(DBloodActor* actor)
RotateVector(&v2c, &v24, v30);
RotateVector(&v28, &v24, v34);
fxActor->vel.X = actor->vel.X + v2c;
fxActor->yvel = actor->yvel + v28;
fxActor->vel.Y = actor->vel.Y + v28;
fxActor->zvel = actor->zvel + v24;
}
}
@ -4623,7 +4623,7 @@ static Collision MoveThing(DBloodActor* actor)
{
actor->spr.flags |= 4;
int vax = actFloorBounceVector(&actor->vel.X, &actor->yvel, (int*)&v20, actor->spr.sector(), pThingInfo->elastic);
int vax = actFloorBounceVector(&actor->vel.X, &actor->vel.Y, (int*)&v20, actor->spr.sector(), pThingInfo->elastic);
int nDamage = MulScale(vax, vax, 30) - pThingInfo->dmgResist;
if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage);
@ -4675,7 +4675,7 @@ static Collision MoveThing(DBloodActor* actor)
if (actor->zvel < 0)
{
actor->vel.X = MulScale(actor->vel.X, 0xc000, 16);
actor->yvel = MulScale(actor->yvel, 0xc000, 16);
actor->vel.Y = MulScale(actor->vel.Y, 0xc000, 16);
actor->zvel = MulScale(-actor->zvel, 0x4000, 16);
switch (actor->spr.type)
@ -4699,7 +4699,7 @@ static Collision MoveThing(DBloodActor* actor)
if (bottom >= floorZ)
{
int nVel = approxDist(actor->vel.X, actor->yvel);
int nVel = approxDist(actor->vel.X, actor->vel.Y);
int nVelClipped = ClipHigh(nVel, 0x11111);
Collision& coll = floorColl;
@ -4709,7 +4709,7 @@ static Collision MoveThing(DBloodActor* actor)
if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING)
{
actor->vel.X += MulScale(4, actor->spr.pos.X - hitActor->spr.pos.X, 2);
actor->yvel += MulScale(4, actor->spr.pos.Y - hitActor->spr.pos.Y, 2);
actor->vel.Y += MulScale(4, actor->spr.pos.Y - hitActor->spr.pos.Y, 2);
lhit = actor->hit.hit;
}
}
@ -4717,11 +4717,11 @@ static Collision MoveThing(DBloodActor* actor)
{
int t = DivScale(nVelClipped, nVel, 16);
actor->vel.X -= MulScale(t, actor->vel.X, 16);
actor->yvel -= MulScale(t, actor->yvel, 16);
actor->vel.Y -= MulScale(t, actor->vel.Y, 16);
}
}
if (actor->vel.X || actor->yvel)
actor->spr.ang = getangle(actor->vel.X, actor->yvel);
if (actor->vel.X || actor->vel.Y)
actor->spr.ang = getangle(actor->vel.X, actor->vel.Y);
return lhit;
}
@ -4752,12 +4752,12 @@ void MoveDude(DBloodActor* actor)
assert(pSector);
if (actor->vel.X || actor->yvel)
if (actor->vel.X || actor->vel.Y)
{
if (pPlayer && gNoClip)
{
actor->spr.pos.X += actor->vel.X >> 12;
actor->spr.pos.Y += actor->yvel >> 12;
actor->spr.pos.Y += actor->vel.Y >> 12;
if (!FindSector(actor->spr.pos.X, actor->spr.pos.Y, &pSector))
pSector = actor->spr.sector();
}
@ -4765,7 +4765,7 @@ void MoveDude(DBloodActor* actor)
{
auto bakCstat = actor->spr.cstat;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->yvel >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit);
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12, actor->vel.Y >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit);
if (pSector == nullptr)
{
pSector = actor->spr.sector();
@ -4834,7 +4834,7 @@ void MoveDude(DBloodActor* actor)
// ???
}
}
actWallBounceVector((int*)&actor->vel.X, (int*)&actor->yvel, pHitWall, 0);
actWallBounceVector((int*)&actor->vel.X, (int*)&actor->vel.Y, pHitWall, 0);
break;
}
}
@ -5109,7 +5109,7 @@ void MoveDude(DBloodActor* actor)
int v30 = actor->zvel - actor->spr.sector()->velFloor;
if (v30 > 0)
{
int vax = actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->yvel, (int*)&v30, actor->spr.sector(), 0);
int vax = actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->vel.Y, (int*)&v30, actor->spr.sector(), 0);
int nDamage = MulScale(vax, vax, 30);
if (pPlayer)
{
@ -5148,7 +5148,7 @@ void MoveDude(DBloodActor* actor)
if (pFX2)
{
pFX2->vel.X = Random2(0x6aaaa);
pFX2->yvel = Random2(0x6aaaa);
pFX2->vel.Y = Random2(0x6aaaa);
pFX2->zvel = -(int)Random(0xd5555);
}
}
@ -5182,7 +5182,7 @@ void MoveDude(DBloodActor* actor)
GetActorExtents(actor, &top, &bottom);
actor->xspr.height = ClipLow(floorZ - bottom, 0) >> 8;
if (actor->vel.X || actor->yvel)
if (actor->vel.X || actor->vel.Y)
{
if (floorColl.type == kHitSprite)
{
@ -5190,7 +5190,7 @@ void MoveDude(DBloodActor* actor)
if ((hitAct->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING)
{
actor->vel.X += MulScale(4, actor->spr.pos.X - hitAct->spr.pos.X, 2);
actor->yvel += MulScale(4, actor->spr.pos.Y - hitAct->spr.pos.Y, 2);
actor->vel.Y += MulScale(4, actor->spr.pos.Y - hitAct->spr.pos.Y, 2);
return;
}
}
@ -5202,10 +5202,10 @@ void MoveDude(DBloodActor* actor)
if (actor->xspr.height > 0)
nDrag -= Scale(gDudeDrag, actor->xspr.height, 0x100);
actor->vel.X -= mulscale16r(actor->vel.X, nDrag);
actor->yvel -= mulscale16r(actor->yvel, nDrag);
actor->vel.Y -= mulscale16r(actor->vel.Y, nDrag);
if (approxDist(actor->vel.X, actor->yvel) < 0x1000)
actor->vel.X = actor->yvel = 0;
if (approxDist(actor->vel.X, actor->vel.Y) < 0x1000)
actor->vel.X = actor->vel.Y = 0;
}
}
@ -5228,7 +5228,7 @@ int MoveMissile(DBloodActor* actor)
gHitInfo.clearObj();
if (actor->spr.type == kMissileFlameSpray) actAirDrag(actor, 0x1000);
if (actor->GetTarget() != nullptr && (actor->vel.X || actor->yvel || actor->zvel))
if (actor->GetTarget() != nullptr && (actor->vel.X || actor->vel.Y || actor->zvel))
{
auto target = actor->GetTarget();
@ -5239,7 +5239,7 @@ int MoveMissile(DBloodActor* actor)
int vy = 0;
RotatePoint(&vx, &vy, (nTargetAngle + 1536) & 2047, 0, 0);
actor->vel.X = vx;
actor->yvel = vy;
actor->vel.Y = vy;
int dz = target->spr.pos.Z - actor->spr.pos.Z;
int deltaz = dz / 10;
@ -5248,7 +5248,7 @@ int MoveMissile(DBloodActor* actor)
}
}
int vx = actor->vel.X >> 12;
int vy = actor->yvel >> 12;
int vy = actor->vel.Y >> 12;
int vz = actor->zvel >> 8;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -5314,10 +5314,10 @@ int MoveMissile(DBloodActor* actor)
}
if (cliptype >= 0 && cliptype != 3)
{
int nAngle = getangle(actor->vel.X, actor->yvel);
int nAngle = getangle(actor->vel.X, actor->vel.Y);
pos.X -= MulScale(Cos(nAngle), 16, 30);
pos.Y -= MulScale(Sin(nAngle), 16, 30);
int nVel = approxDist(actor->vel.X, actor->yvel);
int nVel = approxDist(actor->vel.X, actor->vel.Y);
vz -= Scale(0x100, actor->zvel, nVel);
updatesector(pos.X, pos.Y, &pSector);
pSector2 = pSector;
@ -5499,7 +5499,7 @@ void actExplodeSprite(DBloodActor* actor)
GibSprite(actor, GIBTYPE_5, nullptr, nullptr);
break;
}
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
actPostSprite(actor, kStatExplosion);
actor->spr.xrepeat = actor->spr.yrepeat = explodeInfo[nType].repeat;
@ -5685,13 +5685,13 @@ static void actCheckThings()
if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
actor->vel.X += MulScale(speed, Cos(angle), 30);
actor->yvel += MulScale(speed, Sin(angle), 30);
actor->vel.Y += MulScale(speed, Sin(angle), 30);
}
}
actAirDrag(actor, 128);
if (((actor->GetIndex() >> 8) & 15) == (gFrameCount & 15) && (actor->spr.flags & 2)) actor->spr.flags |= 4;
if ((actor->spr.flags & 4) || actor->vel.X || actor->yvel || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
{
Collision hit = MoveThing(actor);
if (hit.type)
@ -5958,7 +5958,7 @@ static void actCheckTraps()
if (pFX)
{
pFX->vel.X = dx + Random2(0x8888);
pFX->yvel = dy + Random2(0x8888);
pFX->vel.Y = dy + Random2(0x8888);
pFX->zvel = Random2(0x8888);
}
x += (dx / 2) >> 12;
@ -6013,7 +6013,7 @@ static void actCheckDudes()
// handle incarnations of custom dude
if (actor->spr.type == kDudeModernCustom && actor->xspr.txID > 0 && actor->xspr.sysData1 == kGenDudeTransformStatus)
{
actor->vel.X = actor->yvel = 0;
actor->vel.X = actor->vel.Y = 0;
if (seqGetStatus(actor) < 0) genDudeTransform(actor);
}
#endif
@ -6066,7 +6066,7 @@ static void actCheckDudes()
else
pPlayer->chokeEffect = 0;
if (actor->vel.X || actor->yvel)
if (actor->vel.X || actor->vel.Y)
sfxPlay3DSound(actor, 709, 100, 2);
pPlayer->bubbleTime = ClipLow(pPlayer->bubbleTime - 4, 0);
@ -6112,13 +6112,13 @@ static void actCheckDudes()
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
actor->vel.X += dx;
actor->yvel += dy;
actor->vel.Y += dy;
}
}
if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376);
else actAirDrag(actor, 128);
if ((actor->spr.flags & 4) || actor->vel.X || actor->yvel || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
MoveDude(actor);
}
}
@ -6153,7 +6153,7 @@ void actCheckFlares()
vec3_t pos = { x, y, z };
SetActor(actor, &pos);
actor->vel.X = target->vel.X;
actor->yvel = target->yvel;
actor->vel.Y = target->vel.Y;
actor->zvel = target->zvel;
}
else
@ -6224,7 +6224,7 @@ DBloodActor* actSpawnSprite(DBloodActor* source, int nStat)
actor->spr.pos.Y = source->spr.pos.Y;
actor->spr.pos.Z = source->spr.pos.Z;
actor->vel.X = source->vel.X;
actor->yvel = source->yvel;
actor->vel.Y = source->vel.Y;
actor->zvel = source->zvel;
actor->spr.flags = 0;
actor->addX();
@ -6420,10 +6420,10 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
fired->SetOwner(actor);
fired->spr.ang = actor->spr.ang;
fired->vel.X = MulScale(a6, Cos(fired->spr.ang), 30);
fired->yvel = MulScale(a6, Sin(fired->spr.ang), 30);
fired->vel.Y = MulScale(a6, Sin(fired->spr.ang), 30);
fired->zvel = MulScale(a6, a4, 14);
fired->vel.X += actor->vel.X / 2;
fired->yvel += actor->yvel / 2;
fired->vel.Y += actor->vel.Y / 2;
fired->zvel += actor->zvel / 2;
return fired;
}
@ -6468,7 +6468,7 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
case kMissileFlameHound:
seqSpawn(27, spawned, -1);
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
spawned->yvel += actor->yvel / 2 + Random2(0x11111);
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
break;
case kMissileFireballCerberus:
@ -6478,14 +6478,14 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
case kMissileFireballTchernobog:
seqSpawn(23, spawned, dword_2192D8);
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
spawned->yvel += actor->yvel / 2 + Random2(0x11111);
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
break;
case kMissileFlameSpray:
if (Chance(0x8000)) seqSpawn(0, spawned, -1);
else seqSpawn(1, spawned, -1);
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
spawned->yvel += actor->yvel / 2 + Random2(0x11111);
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
break;
case kMissileFlareAlt:
@ -6552,7 +6552,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
spawned->spr.picnum = pMissileInfo->picnum;
spawned->spr.ang = (actor->spr.ang + pMissileInfo->angleOfs) & 2047;
spawned->vel.X = MulScale(pMissileInfo->velocity, a4, 14);
spawned->yvel = MulScale(pMissileInfo->velocity, a5, 14);
spawned->vel.Y = MulScale(pMissileInfo->velocity, a5, 14);
spawned->zvel = MulScale(pMissileInfo->velocity, a6, 14);
spawned->SetOwner(actor);
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK;
@ -6788,7 +6788,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
{
int t2 = DivScale(pVectorData->impulse, t, 8);
actor->vel.X += MulScale(a4, t2, 16);
actor->yvel += MulScale(a5, t2, 16);
actor->vel.Y += MulScale(a5, t2, 16);
actor->zvel += MulScale(a6, t2, 16);
}
if (pVectorData->burnTime)
@ -6818,7 +6818,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
{
int t2 = DivScale(pVectorData->impulse, t, 8);
actor->vel.X += MulScale(a4, t2, 16);
actor->yvel += MulScale(a5, t2, 16);
actor->vel.Y += MulScale(a5, t2, 16);
actor->zvel += MulScale(a6, t2, 16);
}
if (pVectorData->burnTime)
@ -6876,7 +6876,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->vel.X += MulScale(a4, impulse, 16);
actor->yvel += MulScale(a5, impulse, 16);
actor->vel.Y += MulScale(a5, impulse, 16);
actor->zvel += MulScale(a6, impulse, 16);
if (pVectorData->burnTime != 0) {
@ -6945,7 +6945,7 @@ void FireballSeqCallback(int, DBloodActor* actor)
if (pFX)
{
pFX->vel.X = actor->vel.X;
pFX->yvel = actor->yvel;
pFX->vel.Y = actor->vel.Y;
pFX->zvel = actor->zvel;
}
}
@ -6956,7 +6956,7 @@ void NapalmSeqCallback(int, DBloodActor* actor)
if (pFX)
{
pFX->vel.X = actor->vel.X;
pFX->yvel = actor->yvel;
pFX->vel.Y = actor->vel.Y;
pFX->zvel = actor->zvel;
}
}
@ -6967,7 +6967,7 @@ void Fx32Callback(int, DBloodActor* actor)
if (pFX)
{
pFX->vel.X = actor->vel.X;
pFX->yvel = actor->yvel;
pFX->vel.Y = actor->vel.Y;
pFX->zvel = actor->zvel;
}
}
@ -6978,7 +6978,7 @@ void Fx33Callback(int, DBloodActor* actor)
if (pFX)
{
pFX->vel.X = actor->vel.X;
pFX->yvel = actor->yvel;
pFX->vel.Y = actor->vel.Y;
pFX->zvel = actor->zvel;
}
}

View file

@ -254,7 +254,7 @@ void aiChooseDirection(DBloodActor* actor, int a3)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int vsi = ((t1 * 15) >> 12) / 2;
int v8 = 341;
@ -304,7 +304,7 @@ void aiMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.ang), 30);
actor->yvel += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
}
//---------------------------------------------------------------------------
@ -340,7 +340,7 @@ void aiMoveDodge(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -349,7 +349,7 @@ void aiMoveDodge(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
}

View file

@ -210,7 +210,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -219,7 +219,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x52aaa;
}
@ -235,7 +235,7 @@ static void batMoveDodgeDown(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -244,7 +244,7 @@ static void batMoveDodgeDown(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x44444;
}
@ -327,7 +327,7 @@ static void batMoveForward(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -335,7 +335,7 @@ static void batMoveForward(DBloodActor* actor)
else
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void batMoveSwoop(DBloodActor* actor)
@ -359,12 +359,12 @@ static void batMoveSwoop(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x44444;
}
@ -389,12 +389,12 @@ static void batMoveFly(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x2d555;
}

View file

@ -409,7 +409,7 @@ static void beastMoveForward(DBloodActor* actor)
if (nDist <= 0x400 && Random(64) < 32)
return;
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.ang), 30);
actor->yvel += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
}
static void sub_628A0(DBloodActor* actor)
@ -432,7 +432,7 @@ static void sub_628A0(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -440,7 +440,7 @@ static void sub_628A0(DBloodActor* actor)
else
t1 += nAccel >> 2;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void sub_62AE0(DBloodActor* actor)
@ -469,12 +469,12 @@ static void sub_62AE0(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -dz;
}
@ -504,12 +504,12 @@ static void sub_62D7C(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = dz;
}

View file

@ -224,7 +224,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -233,7 +233,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x8000;
}
@ -249,7 +249,7 @@ static void eelMoveDodgeDown(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -258,7 +258,7 @@ static void eelMoveDodgeDown(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x44444;
}
@ -337,7 +337,7 @@ static void eelMoveForward(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -345,7 +345,7 @@ static void eelMoveForward(DBloodActor* actor)
else
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void eelMoveSwoop(DBloodActor* actor)
@ -366,12 +366,12 @@ static void eelMoveSwoop(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x22222;
}
@ -393,12 +393,12 @@ static void eelMoveAscend(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x8000;
}

View file

@ -290,7 +290,7 @@ static void sub_65D04(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -298,7 +298,7 @@ static void sub_65D04(DBloodActor* actor)
else
t1 += nAccel >> 2;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void sub_65F44(DBloodActor* actor)
@ -328,12 +328,12 @@ static void sub_65F44(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -dz;
}
@ -364,12 +364,12 @@ static void sub_661E0(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = dz;
}

View file

@ -101,7 +101,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt1.at10, 12);
x2 += (actor2->vel.X * t) >> 12;
y2 += (actor2->yvel * t) >> 12;
y2 += (actor2->vel.Y * t) >> 12;
z2 += (actor2->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
@ -178,7 +178,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt1.at10, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);

View file

@ -130,7 +130,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt.at10, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
@ -286,7 +286,7 @@ static void gargMoveDodgeUp(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -295,7 +295,7 @@ static void gargMoveDodgeUp(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x1d555;
}
@ -314,7 +314,7 @@ static void gargMoveDodgeDown(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -323,7 +323,7 @@ static void gargMoveDodgeDown(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x44444;
}
@ -540,7 +540,7 @@ static void gargMoveForward(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -548,7 +548,7 @@ static void gargMoveForward(DBloodActor* actor)
else
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void gargMoveSlow(DBloodActor* actor)
@ -575,13 +575,13 @@ static void gargMoveSlow(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 = nAccel >> 1;
t2 >>= 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudeGargoyleFlesh:
actor->zvel = 0x44444;
@ -616,12 +616,12 @@ static void gargMoveSwoop(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudeGargoyleFlesh:
actor->zvel = t1;
@ -656,12 +656,12 @@ static void gargMoveFly(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudeGargoyleFlesh:
actor->zvel = -t1;

View file

@ -116,7 +116,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt.at10, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
@ -265,7 +265,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -274,7 +274,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -0x1d555;
}
@ -293,7 +293,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int dx = actor->vel.X;
int dy = actor->yvel;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
int t2 = DMulScale(dx, nSin, -dy, nCos, 30);
if (actor->xspr.dodgeDir > 0)
@ -302,7 +302,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
t2 -= pDudeInfo->sideSpeed;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = 0x44444;
}
@ -436,7 +436,7 @@ static void ghostMoveForward(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -444,7 +444,7 @@ static void ghostMoveForward(DBloodActor* actor)
else
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void ghostMoveSlow(DBloodActor* actor)
@ -471,13 +471,13 @@ static void ghostMoveSlow(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 = nAccel >> 1;
t2 >>= 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudePhantasm:
actor->zvel = 0x44444;
@ -509,12 +509,12 @@ static void ghostMoveSwoop(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudePhantasm:
actor->zvel = t1;
@ -546,12 +546,12 @@ static void ghostMoveFly(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
switch (actor->spr.type) {
case kDudePhantasm:
actor->zvel = -t1;

View file

@ -282,7 +282,7 @@ static void sub_6CB00(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -290,7 +290,7 @@ static void sub_6CB00(DBloodActor* actor)
else
t1 += nAccel >> 2;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
static void sub_6CD74(DBloodActor* actor)
@ -319,12 +319,12 @@ static void sub_6CD74(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = -dz;
}
@ -354,12 +354,12 @@ static void sub_6D03C(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
actor->zvel = dz;
}

View file

@ -122,7 +122,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
case kDudeSpiderRed:
case kDudeSpiderBlack:
actor->vel.X = IntToFixed(dx);
actor->yvel = IntToFixed(dy);
actor->vel.Y = IntToFixed(dy);
actor->zvel = IntToFixed(dz);
break;
}

View file

@ -85,7 +85,7 @@ void sub_71BD4(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt.at10, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
@ -157,7 +157,7 @@ void sub_720AC(int, DBloodActor* actor)
{
int t = DivScale(nDist, tt.at10, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);

View file

@ -220,7 +220,7 @@ void genDudeAttack1(int, DBloodActor* actor)
if (actor->GetTarget() == nullptr) return;
int dx, dy, dz;
actor->vel.X = actor->yvel = 0;
actor->vel.X = actor->vel.Y = 0;
GENDUDEEXTRA* pExtra = &actor->genDudeExtra;
int dispersion = pExtra->baseDispersion;
@ -488,7 +488,7 @@ static void unicultThinkChase(DBloodActor* actor)
// when attacking the target. It happens because vanilla function takes in account x and y velocity,
// so i use fake velocity with fixed value and pass it as argument.
int xvelocity = actor->vel.X;
int yvelocity = actor->yvel;
int yvelocity = actor->vel.Y;
if (inAttack(actor->xspr.aiState))
xvelocity = yvelocity = ClipLow(actor->spr.clipdist >> 1, 1);
@ -728,7 +728,7 @@ static void unicultThinkChase(DBloodActor* actor)
const EXPLOSION* pExpl = &explodeInfo[nType];
if (CheckProximity(actor, target->spr.pos.X, target->spr.pos.Y, target->spr.pos.Z, target->spr.sector(), pExpl->radius >> 1))
{
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
if (doExplosion(actor, nType) && actor->xspr.health > 0)
actDamageSprite(actor, actor, kDamageExplode, 65535);
}
@ -1130,7 +1130,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vx = actor->vel.X;
int vy = actor->yvel;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
int t2 = DMulScale(vx, nSin, -vy, nCos, 30);
if (actor->GetTarget() == nullptr)
@ -1138,7 +1138,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
else
t1 += nAccel >> 1;
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
actor->yvel = DMulScale(t1, nSin, -t2, nCos, 30);
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
}
else
{
@ -1154,7 +1154,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
int frontSpeed = actor->genDudeExtra.moveSpeed;
actor->vel.X += MulScale(cos, frontSpeed, 30);
actor->yvel += MulScale(sin, frontSpeed, 30);
actor->vel.Y += MulScale(sin, frontSpeed, 30);
}
}
@ -1795,7 +1795,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
{
int t = DivScale(nDist, 0x1aaaaa, 12);
x += (actTarget->vel.X * t) >> 12;
y += (actTarget->yvel * t) >> 12;
y += (actTarget->vel.Y * t) >> 12;
int angBak = actor->spr.ang;
actor->spr.ang = getangle(x - actor->spr.pos.X, y - actor->spr.pos.Y);
int dx = bcos(actor->spr.ang);

View file

@ -20,7 +20,7 @@ class DBloodActor : public DCoreActor
public:
int dudeSlope;
vec3_t vel;
int yvel, zvel;
int zvel;
bool hasx;
XSPRITE xspr;
SPRITEHIT hit;

View file

@ -54,7 +54,7 @@ void fxFlameLick(DBloodActor* actor, sectortype*) // 0
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(-dx);
pFX->yvel = actor->yvel + Random2(-dy);
pFX->vel.Y = actor->vel.Y + Random2(-dy);
pFX->zvel = actor->zvel - Random(0x1aaaa);
}
}
@ -87,7 +87,7 @@ void Remove(DBloodActor* actor, sectortype*) // 1
void FlareBurst(DBloodActor* actor, sectortype*) // 2
{
if (!actor) return;
int nAngle = getangle(actor->vel.X, actor->yvel);
int nAngle = getangle(actor->vel.X, actor->vel.Y);
int nRadius = 0x55555;
for (int i = 0; i < 8; i++)
{
@ -109,7 +109,7 @@ void FlareBurst(DBloodActor* actor, sectortype*) // 2
}
RotateVector(&dx, &dy, nAngle);
spawnedactor->vel.X += dx;
spawnedactor->yvel += dy;
spawnedactor->vel.Y += dy;
spawnedactor->zvel += dz;
evPostActor(spawnedactor, 960, kCallbackRemove);
}
@ -129,7 +129,7 @@ void fxFlareSpark(DBloodActor* actor, sectortype*) // 3
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel - Random(0x1aaaa);
}
evPostActor(actor, 4, kCallbackFXFlareSpark);
@ -148,7 +148,7 @@ void fxFlareSparkLite(DBloodActor* actor, sectortype*) // 4
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel - Random(0x1aaaa);
}
evPostActor(actor, 12, kCallbackFXFlareSparkLite);
@ -170,7 +170,7 @@ void fxZombieBloodSpurt(DBloodActor* actor, sectortype*) // 5
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x11111);
pFX->yvel = actor->yvel + Random2(0x11111);
pFX->vel.Y = actor->vel.Y + Random2(0x11111);
pFX->zvel = actor->zvel - 0x6aaaa;
}
if (actor->xspr.data1 > 0)
@ -200,7 +200,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6
{
pFX->spr.ang = 0;
pFX->vel.X = actor->vel.X >> 8;
pFX->yvel = actor->yvel >> 8;
pFX->vel.Y = actor->vel.Y >> 8;
pFX->zvel = actor->zvel >> 8;
}
evPostActor(actor, 6, kCallbackFXBloodSpurt);
@ -219,7 +219,7 @@ void fxArcSpark(DBloodActor* actor, sectortype*) // 7
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x10000);
pFX->yvel = actor->yvel + Random2(0x10000);
pFX->vel.Y = actor->vel.Y + Random2(0x10000);
pFX->zvel = actor->zvel - Random(0x1aaaa);
}
evPostActor(actor, 3, kCallbackFXArcSpark);
@ -244,7 +244,7 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8
if (pFX)
{
pFX->vel.X = actor->vel.X;
pFX->yvel = actor->yvel;
pFX->vel.Y = actor->vel.Y;
pFX->zvel = actor->zvel;
}
}
@ -291,7 +291,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
actor->spr.type = actor->spr.inittype;
actor->SetOwner(nullptr);
actor->spr.flags &= ~kHitagRespawn;
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
actor->xspr.respawnPending = 0;
actor->xspr.burnTime = 0;
actor->xspr.isTriggered = 0;
@ -368,7 +368,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel + Random2(0x1aaaa);
}
}
@ -398,7 +398,7 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel + Random2(0x1aaaa);
}
}
@ -495,7 +495,7 @@ void fxTeslaAlt(DBloodActor* actor, sectortype*) // 15
if (pFX)
{
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel - Random(0x1aaaa);
}
evPostActor(actor, 3, kCallbackFXTeslaAlt);
@ -525,7 +525,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16
if (actor->zvel == 0) sleeveStopBouncing(actor);
else if (zv > 0) {
actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->yvel, &zv, actor->spr.sector(), 0x9000);
actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->vel.Y, &zv, actor->spr.sector(), 0x9000);
actor->zvel = zv;
if (actor->spr.sector()->velFloor == 0 && abs(actor->zvel) < 0x20000) {
sleeveStopBouncing(actor);
@ -556,7 +556,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16
void sleeveStopBouncing(DBloodActor* actor)
{
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
if (actor->hasX()) seqKill(actor);
sfxKill3DSound(actor, -1, -1);
@ -627,7 +627,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18
{
pFX->spr.ang = 0;
pFX->vel.X = actor->vel.X >> 8;
pFX->yvel = actor->yvel >> 8;
pFX->vel.Y = actor->vel.Y >> 8;
pFX->zvel = actor->zvel >> 8;
}
evPostActor(actor, 6, kCallbackFXPodBloodSpray);
@ -714,7 +714,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
actor->spr.ang = actor2->spr.ang;
ChangeActorSect(actor, actor2->spr.sector());
sfxPlay3DSound(actor2, 201, -1, 0);
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
viewBackupSpriteLoc(actor);
if (pPlayer)
{

View file

@ -209,10 +209,10 @@ void CFX::fxProcess(void)
FXDATA* pFXData = &gFXData[actor->spr.type];
actAirDrag(actor, pFXData->drag);
actor->spr.pos.X += actor->vel.X >> 12;
actor->spr.pos.Y += actor->yvel >> 12;
actor->spr.pos.Y += actor->vel.Y >> 12;
actor->spr.pos.Z += actor->zvel >> 8;
// Weird...
if (actor->vel.X || (actor->yvel && actor->spr.pos.Z >= actor->spr.sector()->floorz))
if (actor->vel.X || (actor->vel.Y && actor->spr.pos.Z >= actor->spr.sector()->floorz))
{
updatesector(actor->spr.pos.X, actor->spr.pos.Y, &pSector);
if (pSector == nullptr)
@ -236,7 +236,7 @@ void CFX::fxProcess(void)
ChangeActorSect(actor, pSector);
}
}
if (actor->vel.X || actor->yvel || actor->zvel)
if (actor->vel.X || actor->vel.Y || actor->zvel)
{
int32_t floorZ, ceilZ;
getzsofslopeptr(pSector, actor->spr.pos.X, actor->spr.pos.Y, &ceilZ, &floorZ);
@ -280,7 +280,7 @@ void fxSpawnBlood(DBloodActor* actor, int)
{
bloodactor->spr.ang = 1024;
bloodactor->vel.X = Random2(0x6aaaa);
bloodactor->yvel = Random2(0x6aaaa);
bloodactor->vel.Y = Random2(0x6aaaa);
bloodactor->zvel = -(int)Random(0x10aaaa) - 100;
evPostActor(bloodactor, 8, kCallbackFXBloodSpurt);
}
@ -310,7 +310,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
{
spawnactor->spr.ang = 1024;
spawnactor->vel.X = Random2(0x6aaaa);
spawnactor->yvel = Random2(0x6aaaa);
spawnactor->vel.Y = Random2(0x6aaaa);
spawnactor->zvel = -(int)Random(0x10aaaa) - 100;
evPostActor(spawnactor, 8, kCallbackFXPodBloodSpray);
}
@ -336,7 +336,7 @@ void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4)
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
int nAngle = actor->spr.ang + Random2(56) + 512;
pBrass->vel.X = MulScale(nDist, Cos(nAngle), 30);
pBrass->yvel = MulScale(nDist, Sin(nAngle), 30);
pBrass->vel.Y = MulScale(nDist, Sin(nAngle), 30);
pBrass->zvel = actor->zvel - (0x20000 + (Random2(40) << 18) / 120);
}
}
@ -361,7 +361,7 @@ void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4)
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
int nAngle = actor->spr.ang + Random2(56) + 512;
pShell->vel.X = MulScale(nDist, Cos(nAngle), 30);
pShell->yvel = MulScale(nDist, Sin(nAngle), 30);
pShell->vel.Y = MulScale(nDist, Sin(nAngle), 30);
pShell->zvel = actor->zvel - (0x20000 + (Random2(20) << 18) / 120);
}
}

View file

@ -301,13 +301,13 @@ void GibFX(DBloodActor* actor, GIBFX* pGFX, CGibPosition* pPos, CGibVelocity* pV
if (pVel)
{
pFX->vel.X = pVel->vx + Random2(pGFX->atd);
pFX->yvel = pVel->vy + Random2(pGFX->atd);
pFX->vel.Y = pVel->vy + Random2(pGFX->atd);
pFX->zvel = pVel->vz - Random(pGFX->at11);
}
else
{
pFX->vel.X = Random2((pGFX->atd << 18) / 120);
pFX->yvel = Random2((pGFX->atd << 18) / 120);
pFX->vel.Y = Random2((pGFX->atd << 18) / 120);
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
{
case 16:
@ -382,13 +382,13 @@ void GibThing(DBloodActor* actor, GIBTHING* pGThing, CGibPosition* pPos, CGibVel
if (pVel)
{
gibactor->vel.X = pVel->vx + Random2(pGThing->atc);
gibactor->yvel = pVel->vy + Random2(pGThing->atc);
gibactor->vel.Y = pVel->vy + Random2(pGThing->atc);
gibactor->zvel = pVel->vz - Random(pGThing->at10);
}
else
{
gibactor->vel.X = Random2((pGThing->atc << 18) / 120);
gibactor->yvel = Random2((pGThing->atc << 18) / 120);
gibactor->vel.Y = Random2((pGThing->atc << 18) / 120);
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
{
case 16:
@ -465,13 +465,13 @@ void GibFX(walltype* pWall, GIBFX* pGFX, int a3, int a4, int a5, int a6, CGibVel
if (!pVel)
{
pGib->vel.X = Random2((pGFX->atd << 18) / 120);
pGib->yvel = Random2((pGFX->atd << 18) / 120);
pGib->vel.Y = Random2((pGFX->atd << 18) / 120);
pGib->zvel = -(int)Random((pGFX->at11 << 18) / 120);
}
else
{
pGib->vel.X = Random2((pVel->vx << 18) / 120);
pGib->yvel = Random2((pVel->vy << 18) / 120);
pGib->vel.Y = Random2((pVel->vy << 18) / 120);
pGib->zvel = -(int)Random((pVel->vz << 18) / 120);
}
}

View file

@ -472,7 +472,7 @@ void DBloodActor::Serialize(FSerializer& arc)
{
Super::Serialize(arc);
arc("xvel", vel.X)
("yvel", yvel)
("yvel", vel.Y)
("zvel", zvel)
("hasx", hasx);

View file

@ -1294,7 +1294,7 @@ void nnExtProcessSuperSprites()
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
debrisactor->vel.X += dx;
debrisactor->yvel += dy;
debrisactor->vel.Y += dy;
}
}
@ -1310,11 +1310,11 @@ void nnExtProcessSuperSprites()
if (pact && pact->hit.hit.type == kHitSprite && pact->hit.hit.actor() == debrisactor)
{
int nSpeed = approxDist(pact->vel.X, pact->yvel);
int nSpeed = approxDist(pact->vel.X, pact->vel.Y);
nSpeed = ClipLow(nSpeed - MulScale(nSpeed, mass, 6), 0x9000 - (mass << 3));
debrisactor->vel.X += MulScale(nSpeed, Cos(pPlayer->actor->spr.ang), 30);
debrisactor->yvel += MulScale(nSpeed, Sin(pPlayer->actor->spr.ang), 30);
debrisactor->vel.Y += MulScale(nSpeed, Sin(pPlayer->actor->spr.ang), 30);
debrisactor->hit.hit.setSprite(pPlayer->actor);
}
@ -1322,11 +1322,11 @@ void nnExtProcessSuperSprites()
}
if (debrisactor->xspr.physAttr & kPhysGravity) debrisactor->xspr.physAttr |= kPhysFalling;
if ((debrisactor->xspr.physAttr & kPhysFalling) || debrisactor->vel.X || debrisactor->yvel || debrisactor->zvel || debrisactor->spr.sector()->velFloor || debrisactor->spr.sector()->velCeil)
if ((debrisactor->xspr.physAttr & kPhysFalling) || debrisactor->vel.X || debrisactor->vel.Y || debrisactor->zvel || debrisactor->spr.sector()->velFloor || debrisactor->spr.sector()->velCeil)
debrisMove(i);
if (debrisactor->vel.X || debrisactor->yvel)
debrisactor->xspr.goalAng = getangle(debrisactor->vel.X, debrisactor->yvel) & 2047;
if (debrisactor->vel.X || debrisactor->vel.Y)
debrisactor->xspr.goalAng = getangle(debrisactor->vel.X, debrisactor->vel.Y) & 2047;
int ang = debrisactor->spr.ang & 2047;
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
@ -1340,7 +1340,7 @@ void nnExtProcessSuperSprites()
}
}
int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->vel.X) + abs(debrisactor->yvel)) >> 5)), (uwater) ? 1 : 0);
int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->vel.X) + abs(debrisactor->vel.Y)) >> 5)), (uwater) ? 1 : 0);
if (ang < debrisactor->xspr.goalAng) debrisactor->spr.ang = ClipHigh(ang + angStep, debrisactor->xspr.goalAng);
else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.ang = ClipLow(ang - angStep, debrisactor->xspr.goalAng);
@ -1561,7 +1561,7 @@ void debrisConcuss(DBloodActor* owneractor, int listIndex, int x, int y, int z,
int t = Scale(dmg, size, actor->spriteMass.mass);
actor->vel.X += MulScale(t, dx, 16);
actor->yvel += MulScale(t, dy, 16);
actor->vel.Y += MulScale(t, dy, 16);
actor->zvel += MulScale(t, dz, 16);
}
@ -1596,7 +1596,7 @@ void debrisBubble(DBloodActor* actor)
auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->spr.sector(), x, y, z, 0);
if (pFX) {
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
pFX->yvel = actor->yvel + Random2(0x1aaaa);
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
pFX->zvel = actor->zvel + Random2(0x1aaaa);
}
@ -1641,14 +1641,14 @@ void debrisMove(int listIndex)
uwater = true;
}
if (actor->vel.X || actor->yvel)
if (actor->vel.X || actor->vel.Y)
{
auto oldcstat = actor->spr.cstat;
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
ClipMove(actor->spr.pos, &pSector, actor->vel.X >> 12,
actor->yvel >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit);
actor->vel.Y >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit);
actor->hit.hit = moveHit;
actor->spr.cstat = oldcstat;
@ -1668,7 +1668,7 @@ void debrisMove(int listIndex)
if (actor->hit.hit.type == kHitWall)
{
moveHit = actor->hit.hit;
actWallBounceVector(&actor->vel.X, &actor->yvel, moveHit.hitWall, tmpFraction);
actWallBounceVector(&actor->vel.X, &actor->vel.Y, moveHit.hitWall, tmpFraction);
}
}
@ -1763,7 +1763,7 @@ void debrisMove(int listIndex)
if (v30 > 0)
{
actor->xspr.physAttr |= kPhysFalling;
actFloorBounceVector(&actor->vel.X, &actor->yvel, &v30, actor->spr.sector(), tmpFraction);
actFloorBounceVector(&actor->vel.X, &actor->vel.Y, &v30, actor->spr.sector(), tmpFraction);
actor->zvel = v30;
if (abs(actor->zvel) < 0x10000)
@ -1782,7 +1782,7 @@ void debrisMove(int listIndex)
{
if ((pFX2 = gFX.fxSpawnActor(FX_14, pFX->spr.sector(), pFX->spr.pos.X, pFX->spr.pos.Y, pFX->spr.pos.Z, 0)) == NULL) continue;
pFX2->vel.X = Random2(0x6aaaa);
pFX2->yvel = Random2(0x6aaaa);
pFX2->vel.Y = Random2(0x6aaaa);
pFX2->zvel = -(int)Random(0xd5555);
}
break;
@ -1825,14 +1825,14 @@ void debrisMove(int listIndex)
trTriggerSprite(actor, kCmdToggle);
}
if (!actor->vel.X && !actor->yvel) return;
if (!actor->vel.X && !actor->vel.Y) return;
else if (floorColl.type == kHitSprite)
{
if ((floorColl.actor()->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
{
actor->vel.X += MulScale(4, actor->spr.pos.X - floorColl.actor()->spr.pos.X, 2);
actor->yvel += MulScale(4, actor->spr.pos.Y - floorColl.actor()->spr.pos.Y, 2);
actor->vel.Y += MulScale(4, actor->spr.pos.Y - floorColl.actor()->spr.pos.Y, 2);
return;
}
}
@ -1846,9 +1846,9 @@ void debrisMove(int listIndex)
nDrag -= Scale(nDrag, actor->xspr.height, 0x100);
actor->vel.X -= mulscale16r(actor->vel.X, nDrag);
actor->yvel -= mulscale16r(actor->yvel, nDrag);
if (approxDist(actor->vel.X, actor->yvel) < 0x1000)
actor->vel.X = actor->yvel = 0;
actor->vel.Y -= mulscale16r(actor->vel.Y, nDrag);
if (approxDist(actor->vel.X, actor->vel.Y) < 0x1000)
actor->vel.X = actor->vel.Y = 0;
}
//---------------------------------------------------------------------------
@ -2594,7 +2594,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
else flags &= ~(kPhysGravity | kPhysFalling);
targetactor->spr.flags &= ~(kPhysMove | kPhysGravity | kPhysFalling);
targetactor->vel.X = targetactor->yvel = targetactor->zvel = 0;
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
targetactor->xspr.restState = targetactor->xspr.state;
}
@ -2707,7 +2707,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
{
if (oldFlags == 0)
targetactor->vel.X = targetactor->yvel = targetactor->zvel = 0;
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
if (nIndex != -1)
{
@ -2725,7 +2725,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
if (targetactor->spr.statnum == kStatThing) ChangeActorStat(targetactor, 0);
// set random goal ang for swimming so they start turning
if ((flags & kPhysDebrisSwim) && !targetactor->vel.X && !targetactor->yvel && !targetactor->zvel)
if ((flags & kPhysDebrisSwim) && !targetactor->vel.X && !targetactor->vel.Y && !targetactor->zvel)
targetactor->xspr.goalAng = (targetactor->spr.ang + Random3(kAng45)) & 2047;
if (targetactor->xspr.physAttr & kPhysDebrisVector)
@ -2743,7 +2743,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
{
targetactor->xspr.physAttr = flags;
targetactor->vel.X = targetactor->yvel = targetactor->zvel = 0;
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
if (targetactor->spr.lotag >= kThingBase && targetactor->spr.lotag < kThingMax)
ChangeActorStat(targetactor, kStatThing); // if it was a thing - restore statnum
}
@ -3037,7 +3037,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
}
if (sourceactor->xspr.data3 == 1)
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
viewBackupSpriteLoc(actor);
@ -4329,9 +4329,9 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
case 25:
switch (arg1)
{
case 0: return (objActor->vel.X || objActor->yvel || objActor->zvel);
case 0: return (objActor->vel.X || objActor->vel.Y || objActor->zvel);
case 1: return (objActor->vel.X);
case 2: return (objActor->yvel);
case 2: return (objActor->vel.Y);
case 3: return (objActor->zvel);
}
break;
@ -6215,7 +6215,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor)
{
int velocity = sourceactor->xspr.data2 << 12;
missileactor->vel.X = MulScale(velocity, dx, 14);
missileactor->yvel = MulScale(velocity, dy, 14);
missileactor->vel.Y = MulScale(velocity, dy, 14);
missileactor->zvel = MulScale(velocity, dz, 14);
}
@ -7344,7 +7344,7 @@ void nnExtAiSetDirection(DBloodActor* actor, int a3)
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
int vc = ((a3 + 1024 - actor->spr.ang) & 2047) - 1024;
int t1 = DMulScale(actor->vel.X, Cos(actor->spr.ang), actor->yvel, Sin(actor->spr.ang), 30);
int t1 = DMulScale(actor->vel.X, Cos(actor->spr.ang), actor->vel.Y, Sin(actor->spr.ang), 30);
int vsi = ((t1 * 15) >> 12) / 2;
int v8 = 341;
@ -7811,7 +7811,7 @@ void aiPatrolMove(DBloodActor* actor)
if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor)))
{
actor->vel.X = 0;
actor->yvel = 0;
actor->vel.Y = 0;
return;
}
@ -7826,12 +7826,12 @@ void aiPatrolMove(DBloodActor* actor)
{
int frontSpeed = aiPatrolGetVelocity(pDudeInfo->frontSpeed, targetactor->xspr.busyTime);
actor->vel.X += MulScale(frontSpeed, Cos(actor->spr.ang), 30);
actor->yvel += MulScale(frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.Y += MulScale(frontSpeed, Sin(actor->spr.ang), 30);
}
vel = MulScale(vel, approxDist(dx, dy) << 6, 16);
actor->vel.X = ClipRange(actor->vel.X, -vel, vel);
actor->yvel = ClipRange(actor->yvel, -vel, vel);
actor->vel.Y = ClipRange(actor->vel.Y, -vel, vel);
}
//---------------------------------------------------------------------------
@ -8176,8 +8176,8 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
{
DBloodActor* act = pPlayer->actor;
itCanHear = (!deaf && (nDist < hearDist || hearChance > 0));
if (act && itCanHear && nDist < feelDist && (act->vel.X || act->yvel || act->zvel))
hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->vel.X) + abs(act->yvel) + abs(act->zvel))) >> 6, 0)), 0);
if (act && itCanHear && nDist < feelDist && (act->vel.X || act->vel.Y || act->zvel))
hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->vel.X) + abs(act->vel.Y) + abs(act->zvel))) >> 6, 0)), 0);
}
if (seeDist)
@ -8790,7 +8790,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
{
if (!actor) return;
if (actor->spr.statnum != kStatProjectile) return;
int nAngle = getangle(actor->vel.X, actor->yvel);
int nAngle = getangle(actor->vel.X, actor->vel.Y);
int nRadius = 0x55555;
for (int i = 0; i < 8; i++)
@ -8831,7 +8831,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
}
RotateVector(&dx, &dy, nAngle);
burstactor->vel.X += dx;
burstactor->yvel += dy;
burstactor->vel.Y += dy;
burstactor->zvel += dz;
evPostActor(burstactor, 960, kCallbackRemove);
}

View file

@ -846,7 +846,7 @@ void playerStart(int nPlayer, int bNewLevel)
pPlayer->throwPower = 0;
pPlayer->deathTime = 0;
pPlayer->nextWeapon = kWeapNone;
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
pInput->avel = 0;
pInput->actions = 0;
pInput->fvel = 0;
@ -1445,7 +1445,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
{
int t2 = DivScale(0xccccc, nMass, 8);
hitactor->vel.X += MulScale(x, t2, 16);
hitactor->yvel += MulScale(y, t2, 16);
hitactor->vel.Y += MulScale(y, t2, 16);
hitactor->zvel += MulScale(z, t2, 16);
}
if (hitactor->xspr.Push && !hitactor->xspr.state && !hitactor->xspr.isTriggered)
@ -1594,14 +1594,14 @@ void ProcessInput(PLAYER* pPlayer)
else
forward = MulScale(pPosture->backAccel, forward, 8);
actor->vel.X += MulScale(forward, x, 30);
actor->yvel += MulScale(forward, y, 30);
actor->vel.Y += MulScale(forward, y, 30);
}
if (pInput->svel)
{
int strafe = pInput->svel;
strafe = MulScale(pPosture->sideAccel, strafe, 8);
actor->vel.X += MulScale(strafe, y, 30);
actor->yvel -= MulScale(strafe, x, 30);
actor->vel.Y -= MulScale(strafe, x, 30);
}
}
else if (actor->xspr.height < 256)
@ -1621,7 +1621,7 @@ void ProcessInput(PLAYER* pPlayer)
if (actor->xspr.height)
forward = MulScale(forward, speed, 16);
actor->vel.X += MulScale(forward, x, 30);
actor->yvel += MulScale(forward, y, 30);
actor->vel.Y += MulScale(forward, y, 30);
}
if (pInput->svel)
{
@ -1630,7 +1630,7 @@ void ProcessInput(PLAYER* pPlayer)
if (actor->xspr.height)
strafe = MulScale(strafe, speed, 16);
actor->vel.X += MulScale(strafe, y, 30);
actor->yvel -= MulScale(strafe, x, 30);
actor->vel.Y -= MulScale(strafe, x, 30);
}
}
@ -1758,7 +1758,7 @@ void ProcessInput(PLAYER* pPlayer)
int x = bcos(pPlayer->actor->spr.ang);
int y = bsin(pPlayer->actor->spr.ang);
spawned->vel.X = pPlayer->actor->vel.X + MulScale(0x155555, x, 14);
spawned->yvel = pPlayer->actor->yvel + MulScale(0x155555, y, 14);
spawned->vel.Y = pPlayer->actor->vel.Y + MulScale(0x155555, y, 14);
spawned->zvel = pPlayer->actor->zvel;
}
pPlayer->hand = 0;
@ -1857,7 +1857,7 @@ void playerProcess(PLAYER* pPlayer)
}
}
ProcessInput(pPlayer);
int nSpeed = approxDist(actor->vel.X, actor->yvel);
int nSpeed = approxDist(actor->vel.X, actor->vel.Y);
pPlayer->zViewVel = interpolatedvalue(pPlayer->zViewVel, actor->zvel, 0x7000);
int dz = pPlayer->actor->spr.pos.Z - pPosture->eyeAboveZ - pPlayer->zView;
if (dz > 0)
@ -2168,7 +2168,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER* pPlayer, DAMAGE_TYPE nDamage
int top, bottom;
GetActorExtents(pActor, &top, &bottom);
CGibPosition gibPos(pActor->spr.pos.X, pActor->spr.pos.Y, top);
CGibVelocity gibVel(pActor->vel.X >> 1, pActor->yvel >> 1, -0xccccc);
CGibVelocity gibVel(pActor->vel.X >> 1, pActor->vel.Y >> 1, -0xccccc);
GibSprite(pActor, GIBTYPE_27, &gibPos, &gibVel);
GibSprite(pActor, GIBTYPE_7, NULL, NULL);
fxSpawnBlood(pActor, nDamage << 4);

View file

@ -92,7 +92,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
auto actor = (DBloodActor*)source;
// Engine expects velocity in units per second, not units per tic.
if (vel) *vel = { actor->vel.X * (30 / 65536.f), actor->zvel * (-30 / 65536.f), actor->yvel * (-30 / 65536.f) };
if (vel) *vel = { actor->vel.X * (30 / 65536.f), actor->zvel * (-30 / 65536.f), actor->vel.Y * (-30 / 65536.f) };
*pos = GetSoundPos(&actor->spr.pos);
}
else if (type == SOURCE_Ambient)

View file

@ -273,7 +273,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
{
int t = DivScale(nDist, 0x1aaaaa, 12);
x += (target->vel.X * t) >> 12;
y += (target->yvel * t) >> 12;
y += (target->vel.Y * t) >> 12;
int angBak = actor->spr.ang;
actor->spr.ang = getangle(x - actor->spr.pos.X, y - actor->spr.pos.Y);
int dx = bcos(actor->spr.ang);
@ -1547,7 +1547,7 @@ void OperateTeleport(sectortype* pSector)
actor->spr.ang = destactor->spr.ang;
ChangeActorSect(actor, destactor->spr.sector());
sfxPlay3DSound(destactor, 201, -1, 0);
actor->vel.X = actor->yvel = actor->zvel = 0;
actor->vel.X = actor->vel.Y = actor->zvel = 0;
actor->interpolated = false;
viewBackupSpriteLoc(actor);
if (pPlayer)

View file

@ -458,7 +458,7 @@ void UpdateAimVector(PLAYER* pPlayer)
{
int t = DivScale(nDist, pWeaponTrack->seeker, 12);
x2 += (actor->vel.X * t) >> 12;
y2 += (actor->yvel * t) >> 12;
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->zvel * t) >> 8;
}
int lx = x + MulScale(Cos(plActor->spr.ang), nDist, 30);