From e3758d6adc566a5fb90488a0b9adee0bc099e6a2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Sep 2022 20:43:35 +0200 Subject: [PATCH] - started wrapping vel --- source/core/coreactor.h | 2 +- source/core/savegamehelp.cpp | 6 +-- source/games/blood/src/actor.cpp | 40 ++++++++--------- source/games/blood/src/callback.cpp | 68 ++++++++++++++--------------- source/games/blood/src/fx.cpp | 8 ++-- source/games/blood/src/nnexts.cpp | 36 +++++++-------- source/games/blood/src/player.cpp | 6 +-- 7 files changed, 83 insertions(+), 83 deletions(-) diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 56909de60..fb9c74839 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -213,7 +213,7 @@ public: DVector3 fVel() const { - return { FixedToFloat(__int_vel.X), FixedToFloat(__int_vel.Y), FixedToFloat(__int_vel.Z) }; + return { FixedToFloat(__int_vel.X), FixedToFloat(__int_vel.Y), FixedToFloat(int_vel().Z) }; } vec3_t int_vel() const diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index 68a591194..fc6831fc5 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -678,9 +678,9 @@ void DCoreActor::Serialize(FSerializer& arc) ("time", time) ("spritesetindex", spritesetindex) ("spriteext", sprext) - ("xvel", __int_vel.X) - ("yvel", __int_vel.Y) - ("zvel", __int_vel.Z); + ("xvel", __int_vel .X) + ("yvel", __int_vel .Y) + ("zvel", __int_vel .Z); if (arc.isReading()) spsmooth = {}; } diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 21a73b2cf..d31b9b242 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2977,7 +2977,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType) double top, bottom; GetActorExtents(actor, &top, &bottom); DVector3 gibPos(actor->spr.pos.XY(), top); - CGibVelocity gibVel(actor->__int_vel.X >> 1, actor->__int_vel.Y >> 1, -0xccccc); + CGibVelocity gibVel(actor->int_vel().X >> 1, actor->int_vel().Y >> 1, -0xccccc); GibSprite(actor, nGibType, &gibPos, &gibVel); } } @@ -3215,7 +3215,7 @@ static void spawnGibs(DBloodActor* actor, int type, int velz) double top, bottom; GetActorExtents(actor, &top, &bottom); DVector3 gibPos(actor->spr.pos.XY(), top); - CGibVelocity gibVel(actor->__int_vel.X >> 1, actor->__int_vel.Y >> 1, velz); + CGibVelocity gibVel(actor->int_vel().X >> 1, actor->int_vel().Y >> 1, velz); GibSprite(actor, GIBTYPE_27, &gibPos, &gibVel); } @@ -4531,7 +4531,7 @@ static Collision MoveThing(DBloodActor* actor) 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->__int_vel.X >> 12, actor->__int_vel.Y >> 12, actor->spr.clipdist << 2, (actor->int_pos().Z - top) / 4, (bottom - actor->int_pos().Z) / 4, CLIPMASK0, lhit); + ClipMove(actor->spr.pos, &pSector, actor->int_vel().X >> 12, actor->int_vel().Y >> 12, actor->spr.clipdist << 2, (actor->int_pos().Z - top) / 4, (bottom - actor->int_pos().Z) / 4, CLIPMASK0, lhit); actor->hit.hit = lhit; enginecompatibility_mode = bakCompat; // restore actor->spr.cstat = bakCstat; @@ -4567,7 +4567,7 @@ static Collision MoveThing(DBloodActor* actor) if (pSector2) pSector = pSector2; } - actor->add_int_z(actor->__int_vel.Z >> 8); + actor->add_int_z(actor->int_vel().Z >> 8); int ceilZ, floorZ; Collision ceilColl, floorColl; @@ -4592,9 +4592,9 @@ static Collision MoveThing(DBloodActor* actor) RotateVector(&v2c, &v28, vbx); RotateVector(&v2c, &v24, v30); RotateVector(&v28, &v24, v34); - fxActor->__int_vel.X = actor->__int_vel.X + v2c; - fxActor->__int_vel.Y = actor->__int_vel.Y + v28; - fxActor->__int_vel.Z = actor->__int_vel.Z + v24; + fxActor->__int_vel.X = actor->int_vel().X + v2c; + fxActor->__int_vel.Y = actor->int_vel().Y + v28; + fxActor->__int_vel.Z = actor->int_vel().Z + v24; } } } @@ -4607,7 +4607,7 @@ static Collision MoveThing(DBloodActor* actor) actor->hit.florhit = floorColl; actor->add_int_z(floorZ - bottom); - int v20 = actor->__int_vel.Z - actor->sector()->velFloor; + int v20 = actor->int_vel().Z - actor->sector()->velFloor; if (v20 > 0) { @@ -4617,7 +4617,7 @@ static Collision MoveThing(DBloodActor* actor) if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage); actor->__int_vel.Z = v20; - if (actor->sector()->velFloor == 0 && abs(actor->__int_vel.Z) < 0x10000) + if (actor->sector()->velFloor == 0 && abs(actor->int_vel().Z) < 0x10000) { actor->__int_vel.Z = 0; actor->spr.flags &= ~4; @@ -4630,7 +4630,7 @@ static Collision MoveThing(DBloodActor* actor) break; case kThingZombieHead: - if (abs(actor->__int_vel.Z) > 0x80000) + if (abs(actor->int_vel().Z) > 0x80000) { sfxPlay3DSound(actor, 607, 0, 0); actDamageSprite(nullptr, actor, kDamageFall, 80); @@ -4638,7 +4638,7 @@ static Collision MoveThing(DBloodActor* actor) break; case kThingKickablePail: - if (abs(actor->__int_vel.Z) > 0x80000) + if (abs(actor->int_vel().Z) > 0x80000) sfxPlay3DSound(actor, 374, 0, 0); break; } @@ -4670,7 +4670,7 @@ static Collision MoveThing(DBloodActor* actor) switch (actor->spr.type) { case kThingZombieHead: - if (abs(actor->__int_vel.Z) > 0x80000) + if (abs(actor->int_vel().Z) > 0x80000) { sfxPlay3DSound(actor, 607, 0, 0); actDamageSprite(nullptr, actor, kDamageFall, 80); @@ -4678,7 +4678,7 @@ static Collision MoveThing(DBloodActor* actor) break; case kThingKickablePail: - if (abs(actor->__int_vel.Z) > 0x80000) + if (abs(actor->int_vel().Z) > 0x80000) sfxPlay3DSound(actor, 374, 0, 0); break; } @@ -4745,7 +4745,7 @@ void MoveDude(DBloodActor* actor) { if (pPlayer && gNoClip) { - actor->add_int_pos({ actor->__int_vel.X >> 12, actor->__int_vel.Y >> 12, 0 }); + actor->add_int_pos({ actor->int_vel().X >> 12, actor->int_vel().Y >> 12, 0 }); updatesector(actor->spr.pos, &pSector); if (!pSector) pSector = actor->sector(); } @@ -4753,7 +4753,7 @@ void MoveDude(DBloodActor* actor) { auto bakCstat = actor->spr.cstat; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; - ClipMove(actor->spr.pos, &pSector, actor->__int_vel.X >> 12, actor->__int_vel.Y >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit); + ClipMove(actor->spr.pos, &pSector, actor->int_vel().X >> 12, actor->int_vel().Y >> 12, wd, tz, bz, CLIPMASK0, actor->hit.hit); if (pSector == nullptr) { pSector = actor->sector(); @@ -4868,7 +4868,7 @@ void MoveDude(DBloodActor* actor) if (pUpperLink && (pUpperLink->spr.type == kMarkerUpWater || pUpperLink->spr.type == kMarkerUpGoo)) bDepth = 1; if (pLowerLink && (pLowerLink->spr.type == kMarkerLowWater || pLowerLink->spr.type == kMarkerLowGoo)) bDepth = 1; if (pPlayer) wd += 16; - if (actor->__int_vel.Z) actor->add_int_z(actor->__int_vel.Z >> 8); + if (actor->int_vel().Z) actor->add_int_z(actor->int_vel().Z >> 8); int ceilZ, floorZ; Collision ceilColl, floorColl; @@ -4996,7 +4996,7 @@ void MoveDude(DBloodActor* actor) pPlayer->posture = 1; actor->xspr.burnTime = 0; - pPlayer->bubbleTime = abs(actor->__int_vel.Z) >> 12; + pPlayer->bubbleTime = abs(actor->int_vel().Z) >> 12; evPostActor(actor, 0, kCallbackPlayerBubble); sfxPlay3DSound(actor, 720, -1, 0); } @@ -5096,7 +5096,7 @@ void MoveDude(DBloodActor* actor) { actor->hit.florhit = floorColl; actor->add_int_z(floorZ - bottom); - int v30 = actor->__int_vel.Z - actor->sector()->velFloor; + int v30 = actor->int_vel().Z - actor->sector()->velFloor; if (v30 > 0) { int vax = actFloorBounceVector((int*)&actor->__int_vel.X, (int*)&actor->__int_vel.Y, (int*)&v30, actor->sector(), 0); @@ -5114,7 +5114,7 @@ void MoveDude(DBloodActor* actor) if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage); actor->__int_vel.Z = v30; - if (abs(actor->__int_vel.Z) < 0x10000) + if (abs(actor->int_vel().Z) < 0x10000) { actor->__int_vel.Z = actor->sector()->velFloor; actor->spr.flags &= ~4; @@ -5222,7 +5222,7 @@ int MoveMissile(DBloodActor* actor) gHitInfo.clearObj(); if (actor->spr.type == kMissileFlameSpray) actAirDrag(actor, 0x1000); - if (actor->GetTarget() != nullptr && (actor->__int_vel.X || actor->__int_vel.Y || actor->__int_vel.Z)) + if (actor->GetTarget() != nullptr && (actor->__int_vel.X || actor->__int_vel.Y || actor->int_vel().Z)) { auto target = actor->GetTarget(); diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index b8821f591..5147f70c9 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -53,9 +53,9 @@ void fxFlameLick(DBloodActor* actor, sectortype*) // 0 auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), x, y, z, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(-dx); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(-dy); - pFX->__int_vel.Z = actor->__int_vel.Z - Random(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(-dx); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(-dy); + pFX->__int_vel.Z = actor->int_vel().Z - Random(0x1aaaa); } } if (actor->xspr.burnTime > 0) @@ -128,9 +128,9 @@ void fxFlareSpark(DBloodActor* actor, sectortype*) // 3 auto pFX = gFX.fxSpawnActor(FX_28, actor->sector(), actor->spr.pos, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z - Random(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z - Random(0x1aaaa); } evPostActor(actor, 4, kCallbackFXFlareSpark); } @@ -147,9 +147,9 @@ void fxFlareSparkLite(DBloodActor* actor, sectortype*) // 4 auto pFX = gFX.fxSpawnActor(FX_28, actor->sector(), actor->spr.pos, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z - Random(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z - Random(0x1aaaa); } evPostActor(actor, 12, kCallbackFXFlareSparkLite); } @@ -169,9 +169,9 @@ void fxZombieBloodSpurt(DBloodActor* actor, sectortype*) // 5 auto pFX = gFX.fxSpawnActor(FX_27, actor->sector(), DVector3(actor->spr.pos.XY(), top), 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x11111); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x11111); - pFX->__int_vel.Z = actor->__int_vel.Z - 0x6aaaa; + pFX->__int_vel.X = actor->int_vel().X + Random2(0x11111); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x11111); + pFX->__int_vel.Z = actor->int_vel().Z - 0x6aaaa; } if (actor->xspr.data1 > 0) { @@ -199,9 +199,9 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6 if (pFX) { pFX->set_int_ang(0); - pFX->__int_vel.X = actor->__int_vel.X >> 8; - pFX->__int_vel.Y = actor->__int_vel.Y >> 8; - pFX->__int_vel.Z = actor->__int_vel.Z >> 8; + pFX->__int_vel.X = actor->int_vel().X >> 8; + pFX->__int_vel.Y = actor->int_vel().Y >> 8; + pFX->__int_vel.Z = actor->int_vel().Z >> 8; } evPostActor(actor, 6, kCallbackFXBloodSpurt); } @@ -218,9 +218,9 @@ void fxArcSpark(DBloodActor* actor, sectortype*) // 7 auto pFX = gFX.fxSpawnActor(FX_15, actor->sector(), actor->spr.pos, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x10000); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x10000); - pFX->__int_vel.Z = actor->__int_vel.Z - Random(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x10000); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x10000); + pFX->__int_vel.Z = actor->int_vel().Z - Random(0x1aaaa); } evPostActor(actor, 3, kCallbackFXArcSpark); } @@ -234,7 +234,7 @@ void fxArcSpark(DBloodActor* actor, sectortype*) // 7 void fxDynPuff(DBloodActor* actor, sectortype*) // 8 { if (!actor) return; - if (actor->__int_vel.Z) + if (actor->int_vel().Z) { int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2; int x = actor->int_pos().X + MulScale(nDist, Cos(actor->int_ang() - 512), 30); @@ -367,9 +367,9 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10 auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), x, y, z, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z + Random2(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z + Random2(0x1aaaa); } } evPostActor(actor, 4, kCallbackPlayerBubble); @@ -387,7 +387,7 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11 if (!actor) return; int top, bottom; GetActorExtents(actor, &top, &bottom); - for (int i = 0; i < (abs(actor->__int_vel.Z) >> 18); i++) + for (int i = 0; i < (abs(actor->int_vel().Z) >> 18); i++) { int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2; int nAngle = Random(2048); @@ -397,9 +397,9 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11 auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), x, y, z, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z + Random2(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z + Random2(0x1aaaa); } } evPostActor(actor, 4, kCallbackEnemeyBubble); @@ -494,9 +494,9 @@ void fxTeslaAlt(DBloodActor* actor, sectortype*) // 15 auto pFX = gFX.fxSpawnActor(FX_49, actor->sector(), actor->spr.pos, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z - Random(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z - Random(0x1aaaa); } evPostActor(actor, 3, kCallbackFXTeslaAlt); } @@ -521,13 +521,13 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16 int top, bottom; GetActorExtents(actor, &top, &bottom); actor->add_int_z(floorZ - bottom); - int zv = actor->__int_vel.Z - actor->sector()->velFloor; + int zv = actor->int_vel().Z - actor->sector()->velFloor; if (actor->__int_vel.Z == 0) sleeveStopBouncing(actor); else if (zv > 0) { actFloorBounceVector((int*)&actor->__int_vel.X, (int*)&actor->__int_vel.Y, &zv, actor->sector(), 0x9000); actor->__int_vel.Z = zv; - if (actor->sector()->velFloor == 0 && abs(actor->__int_vel.Z) < 0x20000) { + if (actor->sector()->velFloor == 0 && abs(actor->int_vel().Z) < 0x20000) { sleeveStopBouncing(actor); return; } @@ -626,9 +626,9 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18 if (pFX) { pFX->set_int_ang(0); - pFX->__int_vel.X = actor->__int_vel.X >> 8; - pFX->__int_vel.Y = actor->__int_vel.Y >> 8; - pFX->__int_vel.Z = actor->__int_vel.Z >> 8; + pFX->__int_vel.X = actor->int_vel().X >> 8; + pFX->__int_vel.Y = actor->int_vel().Y >> 8; + pFX->__int_vel.Z = actor->int_vel().Z >> 8; } evPostActor(actor, 6, kCallbackFXPodBloodSpray); } diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index dc98a0a7f..066e59d87 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -214,7 +214,7 @@ void CFX::fxProcess(void) assert(actor->spr.type < kFXMax); FXDATA* pFXData = &gFXData[actor->spr.type]; actAirDrag(actor, pFXData->drag); - actor->add_int_pos({ actor->__int_vel.X >> 12, actor->__int_vel.Y >> 12, actor->__int_vel.Z >> 8 }); + actor->add_int_pos({ actor->int_vel().X >> 12, actor->int_vel().Y >> 12, actor->int_vel().Z >> 8 }); // Weird... if (actor->__int_vel.X || (actor->__int_vel.Y && actor->spr.pos.Z >= actor->sector()->floorz)) { @@ -240,7 +240,7 @@ void CFX::fxProcess(void) ChangeActorSect(actor, pSector); } } - if (actor->__int_vel.X || actor->__int_vel.Y || actor->__int_vel.Z) + if (actor->__int_vel.X || actor->__int_vel.Y || actor->int_vel().Z) { int32_t floorZ, ceilZ; getzsofslopeptr(pSector, actor->spr.pos, &ceilZ, &floorZ); @@ -341,7 +341,7 @@ void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4) int nAngle = actor->int_ang() + Random2(56) + 512; pBrass->__int_vel.X = MulScale(nDist, Cos(nAngle), 30); pBrass->__int_vel.Y = MulScale(nDist, Sin(nAngle), 30); - pBrass->__int_vel.Z = actor->__int_vel.Z - (0x20000 + (Random2(40) << 18) / 120); + pBrass->__int_vel.Z = actor->int_vel().Z - (0x20000 + (Random2(40) << 18) / 120); } } @@ -366,7 +366,7 @@ void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4) int nAngle = actor->int_ang() + Random2(56) + 512; pShell->__int_vel.X = MulScale(nDist, Cos(nAngle), 30); pShell->__int_vel.Y = MulScale(nDist, Sin(nAngle), 30); - pShell->__int_vel.Z = actor->__int_vel.Z - (0x20000 + (Random2(20) << 18) / 120); + pShell->__int_vel.Z = actor->int_vel().Z - (0x20000 + (Random2(20) << 18) / 120); } } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 6053e2b48..0e6b09085 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1040,7 +1040,7 @@ static void windGenDoVerticalWind(int factor, sectortype* pSector) case kStatFree: continue; case kStatFX: - if (actor->__int_vel.Z) break; + if (actor->int_vel().Z) break; continue; case kStatThing: case kStatDude: @@ -1054,7 +1054,7 @@ 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->__int_vel.Z += MulScale(actor->int_vel().Z >> 4, zdiff, 16); continue; } @@ -1063,7 +1063,7 @@ static void windGenDoVerticalWind(int factor, sectortype* pSector) if (actor->__int_vel.Z >= 0) actor->__int_vel.Z += val; else actor->__int_vel.Z = val; - actor->add_int_z(actor->__int_vel.Z >> 12); + actor->add_int_z(actor->int_vel().Z >> 12); } @@ -1616,9 +1616,9 @@ void debrisBubble(DBloodActor* actor) int z = bottom - Random(bottom - top); auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), x, y, z, 0); if (pFX) { - pFX->__int_vel.X = actor->__int_vel.X + Random2(0x1aaaa); - pFX->__int_vel.Y = actor->__int_vel.Y + Random2(0x1aaaa); - pFX->__int_vel.Z = actor->__int_vel.Z + Random2(0x1aaaa); + pFX->__int_vel.X = actor->int_vel().X + Random2(0x1aaaa); + pFX->__int_vel.Y = actor->int_vel().Y + Random2(0x1aaaa); + pFX->__int_vel.Z = actor->int_vel().Z + Random2(0x1aaaa); } } @@ -1668,8 +1668,8 @@ void debrisMove(int listIndex) auto oldcstat = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); - ClipMove(actor->spr.pos, &pSector, actor->__int_vel.X >> 12, - actor->__int_vel.Y >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit); + ClipMove(actor->spr.pos, &pSector, actor->int_vel().X >> 12, + actor->int_vel().Y >> 12, clipDist, ceilDist, floorDist, CLIPMASK0, moveHit); actor->hit.hit = moveHit; actor->spr.cstat = oldcstat; @@ -1709,8 +1709,8 @@ void debrisMove(int listIndex) if (pSector->hasX()) uwater = pSector->xs().Underwater; - if (actor->__int_vel.Z) - actor->add_int_z(actor->__int_vel.Z >> 8); + if (actor->int_vel().Z) + actor->add_int_z(actor->int_vel().Z >> 8); int ceilZ, floorZ; Collision ceilColl, floorColl; @@ -1780,7 +1780,7 @@ void debrisMove(int listIndex) if (floorZ <= bottom) { actor->hit.florhit = floorColl; - int v30 = actor->__int_vel.Z - actor->sector()->velFloor; + int v30 = actor->int_vel().Z - actor->sector()->velFloor; if (v30 > 0) { @@ -1788,7 +1788,7 @@ void debrisMove(int listIndex) actFloorBounceVector(&actor->__int_vel.X, &actor->__int_vel.Y, &v30, actor->sector(), tmpFraction); actor->__int_vel.Z = v30; - if (abs(actor->__int_vel.Z) < 0x10000) + if (abs(actor->int_vel().Z) < 0x10000) { actor->__int_vel.Z = actor->sector()->velFloor; actor->xspr.physAttr &= ~kPhysFalling; @@ -2782,7 +2782,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->__int_vel.X && !targetactor->__int_vel.Y && !targetactor->__int_vel.Z) + if ((flags & kPhysDebrisSwim) && !targetactor->__int_vel.X && !targetactor->__int_vel.Y && !targetactor->int_vel().Z) targetactor->xspr.goalAng = (targetactor->int_ang() + Random3(kAng45)) & 2047; if (targetactor->xspr.physAttr & kPhysDebrisVector) @@ -4617,10 +4617,10 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) else if (arg1 == 2) return condCmp(objActor->__int_vel.Y, arg1, arg2, cmpOp); else if (arg1 == 3) return condCmp(objActor->__int_vel.Z, arg1, arg2, cmpOp); } - else if (arg1 == 0) return (objActor->__int_vel.X || objActor->__int_vel.Y || objActor->__int_vel.Z); + else if (arg1 == 0) return (objActor->__int_vel.X || objActor->__int_vel.Y || objActor->int_vel().Z); else if (arg1 == 1) return (objActor->__int_vel.X); else if (arg1 == 2) return (objActor->__int_vel.Y); - else if (arg1 == 3) return (objActor->__int_vel.Z); + else if (arg1 == 3) return (objActor->int_vel().Z); break; case 30: if (!spriteIsUnderwater(objActor) && !spriteIsUnderwater(objActor, true)) return false; @@ -8575,8 +8575,8 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor) { DBloodActor* act = pPlayer->actor; itCanHear = (!deaf && (nDist < hearDist || hearChance > 0)); - if (act && itCanHear && nDist < feelDist && (act->__int_vel.X || act->__int_vel.Y || act->__int_vel.Z)) - hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->__int_vel.X) + abs(act->__int_vel.Y) + abs(act->__int_vel.Z))) >> 6, 0)), 0); + if (act && itCanHear && nDist < feelDist && (act->__int_vel.X || act->__int_vel.Y || act->int_vel().Z)) + hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->__int_vel.X) + abs(act->__int_vel.Y) + abs(act->int_vel().Z))) >> 6, 0)), 0); } if (seeDist) @@ -9333,7 +9333,7 @@ void changeSpriteAngle(DBloodActor* pSpr, int nAng) int getVelocityAngle(DBloodActor* pSpr) { - return getangle(pSpr->__int_vel.X >> 12, pSpr->__int_vel.Y >> 12); + return getangle(pSpr->int_vel().X >> 12, pSpr->int_vel().Y >> 12); } #if 0 diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 59360e4e2..05bb7d7ad 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1764,8 +1764,8 @@ void ProcessInput(PLAYER* pPlayer) spawned->set_int_ang((pPlayer->actor->int_ang() + 1024) & 2047); int x = bcos(pPlayer->actor->int_ang()); int y = bsin(pPlayer->actor->int_ang()); - spawned->__int_vel.X = pPlayer->actor->__int_vel.X + MulScale(0x155555, x, 14); - spawned->__int_vel.Y = pPlayer->actor->__int_vel.Y + MulScale(0x155555, y, 14); + spawned->__int_vel.X = pPlayer->actor->int_vel().X + MulScale(0x155555, x, 14); + spawned->__int_vel.Y = pPlayer->actor->int_vel().Y + MulScale(0x155555, y, 14); spawned->__int_vel.Z = pPlayer->actor->__int_vel.Z; } pPlayer->hand = 0; @@ -2173,7 +2173,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER* pPlayer, DAMAGE_TYPE nDamage double top, bottom; GetActorExtents(pActor, &top, &bottom); DVector3 gibPos(pActor->spr.pos.XY(), top); - CGibVelocity gibVel(pActor->__int_vel.X >> 1, pActor->__int_vel.Y >> 1, -0xccccc); + CGibVelocity gibVel(pActor->int_vel().X >> 1, pActor->int_vel().Y >> 1, -0xccccc); GibSprite(pActor, GIBTYPE_27, &gibPos, &gibVel); GibSprite(pActor, GIBTYPE_7, NULL, NULL); fxSpawnBlood(pActor, nDamage << 4);