From fb1a9881e349c13c04ec76a89c523805bfd138e1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Sep 2022 16:54:28 +0200 Subject: [PATCH] - half done with xvel --- source/games/duke/src/actors.cpp | 16 ++++++++-------- source/games/duke/src/actors_d.cpp | 2 +- source/games/duke/src/actors_r.cpp | 6 +++--- source/games/exhumed/src/fish.cpp | 4 ++-- source/games/exhumed/src/lavadude.cpp | 4 ++-- source/games/exhumed/src/move.cpp | 4 ++-- source/games/exhumed/src/object.cpp | 4 ++-- source/games/exhumed/src/spider.cpp | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index d4d80c70e..edb4b3c39 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1000,7 +1000,7 @@ void movemasterswitch(DDukeActor *actor) void movetrash(DDukeActor *actor) { - if (actor->spr.xvel == 0) actor->spr.xvel = 1; + if (actor->int_xvel() == 0) actor->spr.xvel = 1; if (ssp(actor, CLIPMASK0)) { makeitfall(actor); @@ -1480,12 +1480,12 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) fi.checkhitsprite(actor, coll.actor()); } - actor->spr.xvel--; + actor->add_int_xvel(-1); if(actor->float_xvel() < 0) actor->clear_xvel(); if (actor->spr.picnum == stripeball) { actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; - actor->spr.cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP) & ESpriteFlags::FromInt(actor->spr.xvel); + actor->spr.cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP) & ESpriteFlags::FromInt(int(actor->float_xvel() / 16.)); // special hack edition... } } else @@ -2152,7 +2152,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f { auto sectp = actor->sector(); - if(actor->float_xvel() > 0) actor->spr.xvel--; + if(actor->float_xvel() > 0) actor->add_int_xvel(-1); else actor->clear_xvel(); if (timeout) @@ -2398,7 +2398,7 @@ void shell(DDukeActor* actor, bool morecheck) } if (actor->float_zvel() < 2) actor->add_int_zvel( (gs.gravity / 3)); // 52; if(actor->float_xvel() > 0) - actor->spr.xvel--; + actor->add_int_xvel(-1); else { deletesprite(actor); @@ -2464,7 +2464,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6) auto sectp = actor->sector(); if(actor->float_xvel() > 0) - actor->spr.xvel--; + actor->add_int_xvel(-1); else actor->clear_xvel(); if (actor->float_zvel() > 4 && actor->float_zvel() < 5) @@ -2779,7 +2779,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) actor->add_int_ang(q); bool statstate = (!checkstat || ((sc->floorstat & CSTAT_SECTOR_SKY) == 0 && (sc->ceilingstat & CSTAT_SECTOR_SKY) == 0)); - if (actor->spr.xvel == sc->extra) + if (actor->int_xvel() == sc->extra) { if (statstate) { @@ -2954,7 +2954,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) actor->temp_data[4] = 2; else { - if (actor->spr.xvel == 0) + if (actor->int_xvel() == 0) operateactivators(actor->spr.hitag + (!actor->temp_data[3]), -1); if (actor->int_xvel() < 256) actor->spr.xvel += 16; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 56c5805b1..526607695 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2705,7 +2705,7 @@ DETONATEB: } } } - else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0) + else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0) if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector)) if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON]) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index cfc7fba15..0da647725 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -2493,7 +2493,7 @@ DETONATEB: return; } } - else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0) + else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0) if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector)) if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON]) if (actor->spr.pal == 0) @@ -2590,7 +2590,7 @@ static int henstand(DDukeActor *actor) } } } - actor->spr.xvel--; + actor->add_int_xvel(-1); if(actor->float_xvel() < 0) actor->clear_xvel(); actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; if (actor->spr.picnum == BOWLINGPIN) @@ -2853,7 +2853,7 @@ void moveactors_r(void) MulScale(act->int_xvel(), bcos(act->int_ang()), 14), MulScale(act->int_xvel(), bsin(act->int_ang()), 14), act->int_zvel(),CLIPMASK0, coll); - act->spr.xvel--; + act->add_int_xvel(-1); } break; diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index e0fd88705..2c558daa1 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -119,7 +119,7 @@ void AIFishLimb::Tick(RunListEvent* ev) } else { - auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 2560, -2560, CLIPMASK1); + auto coll = movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 2560, -2560, CLIPMASK1); if (coll.type != kHitNone) { pActor->clear_xvel(); @@ -415,7 +415,7 @@ void AIFish::Tick(RunListEvent* ev) auto pSector =pActor->sector(); // loc_2EF54 - Collision coll = movesprite(pActor, pActor->spr.xvel << 13, pActor->spr.yvel << 13, pActor->int_zvel() << 2, 0, 0, CLIPMASK0); + Collision coll = movesprite(pActor, pActor->int_xvel() << 13, pActor->spr.yvel << 13, pActor->int_zvel() << 2, 0, 0, CLIPMASK0); if (!(pActor->sector()->Flag & kSectUnderwater)) { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 9b473aecc..6c5625b2e 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -73,7 +73,7 @@ void AILavaDudeLimb::Tick(RunListEvent* ev) pActor->spr.shade += 3; - auto coll = movesprite(pActor, pActor->spr.xvel << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1); + auto coll = movesprite(pActor, pActor->int_xvel() << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1); if (coll.type || pActor->spr.shade > 100) { @@ -280,7 +280,7 @@ void AILavaDude::Tick(RunListEvent* ev) auto pos = pActor->spr.pos; auto pSector =pActor->sector(); - auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0); + auto coll = movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0); if (pSector != pActor->sector()) { diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 851c6de6f..fd7baf260 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -612,7 +612,7 @@ void Gravity(DExhumedActor* pActor) Collision MoveCreature(DExhumedActor* pActor) { - return movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 15360, -5120, CLIPMASK0); + return movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 15360, -5120, CLIPMASK0); } Collision MoveCreatureWithCaution(DExhumedActor* pActor) @@ -1352,7 +1352,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) auto pSector = pActor->sector(); pActor->spr.pal = pSector->ceilingpal; - auto nVal = movesprite(pActor, pActor->spr.xvel << 10, pActor->spr.yvel << 10, pActor->int_zvel(), 2560, -2560, CLIPMASK1); + auto nVal = movesprite(pActor, pActor->int_xvel() << 10, pActor->spr.yvel << 10, pActor->int_zvel(), 2560, -2560, CLIPMASK1); if (pActor->spr.pos.Z >= pSector->floorz) { diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 5d1a4432f..288ba3ed6 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1436,7 +1436,7 @@ void AISpark::Tick(RunListEvent* ev) pActor->add_int_zvel( 128); - auto nMov = movesprite(pActor, pActor->spr.xvel << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1); + auto nMov = movesprite(pActor, pActor->int_xvel() << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1); if (!nMov.type && !nMov.exbits) { return; } @@ -1888,7 +1888,7 @@ void AIObject::Tick(RunListEvent* ev) FUNCOBJECT_GOTO: if (nStat != kStatExplodeTarget) { - auto nMov = movesprite(pActor, pActor->spr.xvel << 6, pActor->spr.yvel << 6, pActor->int_zvel(), 0, 0, CLIPMASK0); + auto nMov = movesprite(pActor, pActor->int_xvel() << 6, pActor->spr.yvel << 6, pActor->int_zvel(), 0, 0, CLIPMASK0); if (pActor->spr.statnum == kStatExplodeTrigger) { pActor->spr.pal = 1; diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 6c2fb9bf3..aece31580 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -275,7 +275,7 @@ void AISpider::Tick(RunListEvent* ev) spp->spr.yvel = 0; } - auto nMov = movesprite(spp, spp->spr.xvel << nVel, spp->spr.yvel << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0); + auto nMov = movesprite(spp, spp->int_xvel() << nVel, spp->spr.yvel << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0); if (nMov.type == kHitNone && nMov.exbits == 0) return;