From 49d280c665f870c9bf3d29802f4ec797bf4b38ae Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Sep 2022 21:05:25 +0200 Subject: [PATCH] - add_int_bvel_y --- source/games/blood/src/actor.cpp | 30 ++++++++++++++-------------- source/games/blood/src/ai.cpp | 2 +- source/games/blood/src/aibeast.cpp | 2 +- source/games/blood/src/aiunicult.cpp | 2 +- source/games/blood/src/callback.cpp | 2 +- source/games/blood/src/nnexts.cpp | 14 ++++++------- source/games/blood/src/player.cpp | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 4d5fd9838..7b66c7205 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2576,7 +2576,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector int size = (tileWidth(actor->spr.picnum) * actor->spr.xrepeat * tileHeight(actor->spr.picnum) * actor->spr.yrepeat) >> 1; int t = Scale(damage, size, mass); actor->add_int_bvel_x((int)MulScaleF(t, vect.X, 12)); - actor->__int_vel.Y += (int)MulScaleF(t, vect.Y, 12); + actor->add_int_bvel_y((int)MulScaleF(t, vect.Y, 12)); actor->__int_vel.Z += (int)MulScaleF(t, vect.Z, 12); } } @@ -4160,13 +4160,13 @@ static void checkCeilHit(DBloodActor* actor) if (pThingInfo->flags & 2) actor2->spr.flags |= 4; // Inlined ? actor2->add_int_bvel_x(int(adelta.X * 16)); - actor2->__int_vel.Y += int(adelta.Y * 16); + actor2->add_int_bvel_y(int(adelta.Y * 16)); } else { actor2->spr.flags |= 5; actor2->add_int_bvel_x(int(adelta.X * 16)); - actor2->__int_vel.Y += int(adelta.Y * 16); + actor2->add_int_bvel_y(int(adelta.Y * 16)); #ifdef NOONE_EXTENSIONS // add size shroom abilities if ((actor->IsPlayerActor() && isShrinked(actor)) || (actor2->IsPlayerActor() && isGrown(actor2))) { @@ -4502,7 +4502,7 @@ void actAirDrag(DBloodActor* actor, int a2) } } actor->add_int_bvel_x(MulScale(wind_x - actor->int_vel().X, a2, 16)); - actor->__int_vel.Y += MulScale(wind_y - actor->int_vel().Y, a2, 16); + actor->add_int_bvel_y(MulScale(wind_y - actor->int_vel().Y, a2, 16)); actor->__int_vel.Z -= MulScale(actor->int_vel().Z, a2, 16); } @@ -4698,7 +4698,7 @@ static Collision MoveThing(DBloodActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING) { actor->add_int_bvel_x(MulScale(4, actor->int_pos().X - hitActor->int_pos().X, 2)); - actor->__int_vel.Y += MulScale(4, actor->int_pos().Y - hitActor->int_pos().Y, 2); + actor->add_int_bvel_y(MulScale(4, actor->int_pos().Y - hitActor->int_pos().Y, 2)); lhit = actor->hit.hit; } } @@ -5181,7 +5181,7 @@ void MoveDude(DBloodActor* actor) if ((hitAct->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING) { actor->add_int_bvel_x(MulScale(4, actor->int_pos().X - hitAct->int_pos().X, 2)); - actor->__int_vel.Y += MulScale(4, actor->int_pos().Y - hitAct->int_pos().Y, 2); + actor->add_int_bvel_y(MulScale(4, actor->int_pos().Y - hitAct->int_pos().Y, 2)); return; } } @@ -5672,7 +5672,7 @@ static void actCheckThings() if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047; actor->add_int_bvel_x(MulScale(speed, Cos(angle), 30)); - actor->__int_vel.Y += MulScale(speed, Sin(angle), 30); + actor->add_int_bvel_y(MulScale(speed, Sin(angle), 30)); } } actAirDrag(actor, 128); @@ -6100,7 +6100,7 @@ static void actCheckDudes() int dx = MulScale(speed, Cos(angle), 30); int dy = MulScale(speed, Sin(angle), 30); actor->add_int_bvel_x(dx); - actor->__int_vel.Y += dy; + actor->add_int_bvel_y(dy); } } if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376); @@ -6404,7 +6404,7 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT fired->__int_vel.Y = MulScale(a6, Sin(fired->int_ang()), 30); fired->__int_vel.Z = MulScale(a6, a4, 14); fired->add_int_bvel_x(actor->int_vel().X / 2); - fired->__int_vel.Y += actor->int_vel().Y / 2; + fired->add_int_bvel_y(actor->int_vel().Y / 2); fired->__int_vel.Z += actor->int_vel().Z / 2; return fired; } @@ -6449,7 +6449,7 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor) case kMissileFlameHound: seqSpawn(27, spawned, -1); spawned->add_int_bvel_x(actor->int_vel().X / 2 + Random2(0x11111)); - spawned->__int_vel.Y += actor->int_vel().Y / 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); break; case kMissileFireballCerberus: @@ -6459,14 +6459,14 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor) case kMissileFireballTchernobog: seqSpawn(23, spawned, dword_2192D8); spawned->add_int_bvel_x(actor->int_vel().X / 2 + Random2(0x11111)); - spawned->__int_vel.Y += actor->int_vel().Y / 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); 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->__int_vel.Y += actor->int_vel().Y / 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); break; case kMissileFlareAlt: @@ -6770,7 +6770,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->__int_vel.Y += MulScale(a5, t2, 16); + actor->add_int_bvel_y(MulScale(a5, t2, 16)); actor->__int_vel.Z += MulScale(a6, t2, 16); } if (pVectorData->burnTime) @@ -6800,7 +6800,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->__int_vel.Y += MulScale(a5, t2, 16); + actor->add_int_bvel_y(MulScale(a5, t2, 16)); actor->__int_vel.Z += MulScale(a6, t2, 16); } if (pVectorData->burnTime) @@ -6858,7 +6858,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->__int_vel.Y += MulScale(a5, impulse, 16); + actor->add_int_bvel_y(MulScale(a5, impulse, 16)); actor->__int_vel.Z += MulScale(a6, impulse, 16); if (pVectorData->burnTime != 0) { diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 7cb90704c..5f069defb 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -304,7 +304,7 @@ void aiMoveForward(DBloodActor* actor) if (abs(nAng) > DAngle60) return; actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); - actor->__int_vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30); + actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30)); } //--------------------------------------------------------------------------- diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 83b9cb018..dc1184b62 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -403,7 +403,7 @@ static void beastMoveForward(DBloodActor* actor) if (nDist <= 0x400 && Random(64) < 32) return; actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); - actor->__int_vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30); + actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30)); } static void sub_628A0(DBloodActor* actor) diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 4b94f4d48..280d39b12 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -1153,7 +1153,7 @@ void aiGenDudeMoveForward(DBloodActor* actor) int frontSpeed = actor->genDudeExtra.moveSpeed; actor->add_int_bvel_x(MulScale(cos, frontSpeed, 30)); - actor->__int_vel.Y += MulScale(sin, frontSpeed, 30); + actor->add_int_bvel_y(MulScale(sin, frontSpeed, 30)); } } diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 4e15b1421..24189bf69 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -109,7 +109,7 @@ void FlareBurst(DBloodActor* actor, sectortype*) // 2 } RotateVector(&dx, &dy, nAngle); spawnedactor->add_int_bvel_x(dx); - spawnedactor->__int_vel.Y += dy; + spawnedactor->add_int_bvel_y(dy); spawnedactor->__int_vel.Z += dz; evPostActor(spawnedactor, 960, kCallbackRemove); } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 617754dad..8585d72d4 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1315,7 +1315,7 @@ void nnExtProcessSuperSprites() int dx = MulScale(speed, Cos(angle), 30); int dy = MulScale(speed, Sin(angle), 30); debrisactor->add_int_bvel_x(dx); - debrisactor->__int_vel.Y += dy; + debrisactor->add_int_bvel_y(dy); } } @@ -1335,7 +1335,7 @@ void nnExtProcessSuperSprites() nSpeed = ClipLow(nSpeed - MulScale(nSpeed, mass, 6), 0x9000 - (mass << 3)); debrisactor->add_int_bvel_x(MulScale(nSpeed, Cos(pPlayer->actor->int_ang()), 30)); - debrisactor->__int_vel.Y += MulScale(nSpeed, Sin(pPlayer->actor->int_ang()), 30); + debrisactor->add_int_bvel_y(MulScale(nSpeed, Sin(pPlayer->actor->int_ang()), 30)); debrisactor->hit.hit.setSprite(pPlayer->actor); } @@ -1582,7 +1582,7 @@ void debrisConcuss(DBloodActor* owneractor, int listIndex, int x, int y, int z, int t = Scale(dmg, size, actor->spriteMass.mass); actor->add_int_bvel_x(MulScale(t, dx, 16)); - actor->__int_vel.Y += MulScale(t, dy, 16); + actor->add_int_bvel_y(MulScale(t, dy, 16)); actor->__int_vel.Z += MulScale(t, dz, 16); } @@ -1855,7 +1855,7 @@ void debrisMove(int listIndex) if ((floorColl.actor()->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { actor->add_int_bvel_x(MulScale(4, actor->int_pos().X - floorColl.actor()->int_pos().X, 2)); - actor->__int_vel.Y += MulScale(4, actor->int_pos().Y - floorColl.actor()->int_pos().Y, 2); + actor->add_int_bvel_y(MulScale(4, actor->int_pos().Y - floorColl.actor()->int_pos().Y, 2)); return; } } @@ -3119,7 +3119,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi if (relative) { pSprite->add_int_bvel_x(xv); - pSprite->__int_vel.Y += yv; + pSprite->add_int_bvel_y(yv); pSprite->__int_vel.Z += zv; } else @@ -8224,7 +8224,7 @@ void aiPatrolMove(DBloodActor* actor) frontSpeed = aiPatrolGetVelocity(pDudeInfo->frontSpeed, targetactor->xspr.busyTime); actor->add_int_bvel_x(MulScale(frontSpeed, Cos(actor->int_ang()), 30)); - actor->__int_vel.Y += MulScale(frontSpeed, Sin(actor->int_ang()), 30); + actor->add_int_bvel_y(MulScale(frontSpeed, Sin(actor->int_ang()), 30)); } vel = MulScale(vel, approxDist(dx, dy) << 6, 16); @@ -9233,7 +9233,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22 } RotateVector(&dx, &dy, nAngle); burstactor->add_int_bvel_x(dx); - burstactor->__int_vel.Y += dy; + burstactor->add_int_bvel_y(dy); burstactor->__int_vel.Z += dz; evPostActor(burstactor, 960, kCallbackRemove); } diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index e955294cc..29e7d4883 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1452,7 +1452,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out) { int t2 = DivScale(0xccccc, nMass, 8); hitactor->add_int_bvel_x(MulScale(x, t2, 16)); - hitactor->__int_vel.Y += MulScale(y, t2, 16); + hitactor->add_int_bvel_y(MulScale(y, t2, 16)); hitactor->__int_vel.Z += MulScale(z, t2, 16); } if (hitactor->xspr.Push && !hitactor->xspr.state && !hitactor->xspr.isTriggered) @@ -1601,7 +1601,7 @@ void ProcessInput(PLAYER* pPlayer) else forward = MulScale(pPosture->backAccel, forward, 8); actor->add_int_bvel_x(MulScale(forward, x, 30)); - actor->__int_vel.Y += MulScale(forward, y, 30); + actor->add_int_bvel_y(MulScale(forward, y, 30)); } if (pInput->svel) { @@ -1628,7 +1628,7 @@ void ProcessInput(PLAYER* pPlayer) if (actor->xspr.height) forward = MulScale(forward, speed, 16); actor->add_int_bvel_x(MulScale(forward, x, 30)); - actor->__int_vel.Y += MulScale(forward, y, 30); + actor->add_int_bvel_y(MulScale(forward, y, 30)); } if (pInput->svel) {