From 9ba03ac53fcafbe43da2eead6cfae367c7bd3af2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Sep 2022 18:15:52 +0200 Subject: [PATCH] - renamed yvel to yint in Duke. It's never used as velocity, but as an auxiliary parameter so name it appropriately. --- source/core/maptypes.h | 4 +- source/games/duke/src/actors.cpp | 82 +++++++++++----------- source/games/duke/src/actors_d.cpp | 32 ++++----- source/games/duke/src/actors_r.cpp | 20 +++--- source/games/duke/src/animatesprites_d.cpp | 4 +- source/games/duke/src/animatesprites_r.cpp | 4 +- source/games/duke/src/gameexec.cpp | 14 ++-- source/games/duke/src/input.cpp | 2 +- source/games/duke/src/player.cpp | 4 +- source/games/duke/src/player_d.cpp | 8 +-- source/games/duke/src/player_r.cpp | 4 +- source/games/duke/src/player_w.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/duke/src/render.cpp | 6 +- source/games/duke/src/sectors.cpp | 6 +- source/games/duke/src/sectors_d.cpp | 12 ++-- source/games/duke/src/sectors_r.cpp | 2 +- source/games/duke/src/spawn.cpp | 6 +- source/games/duke/src/spawn_d.cpp | 8 +-- source/games/duke/src/spawn_r.cpp | 10 +-- source/games/duke/src/types.h | 2 +- 21 files changed, 117 insertions(+), 117 deletions(-) diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 50c52efa9..00e13b137 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -464,8 +464,8 @@ struct spritetypebase int16_t picnum; int16_t statnum; int16_t intangle; // needs to be kept for SW's SP_TAG4 - int16_t xint; - union { int16_t yvel, yint; }; // alternative names are for refactoring and later use where repurposed. + int16_t xint; // formerly known as xvel and yvel + int16_t yint; int16_t inittype; // was zvel. All accesses for that have been wrapped. inittype, type and flags are for Blood. union { int16_t lotag, type; }; union { int16_t hitag, flags; }; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 675faee63..5eb4f5ed4 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -210,7 +210,7 @@ void clearcamera(player_struct* ps) while (auto k = it.Next()) { if (actorflag(k, SFLAG2_CAMERA)) - k->spr.yvel = 0; + k->spr.yint = 0; } } @@ -947,7 +947,7 @@ void detonate(DDukeActor *actor, int explosion) void movemasterswitch(DDukeActor *actor) { - if (actor->spr.yvel == 1) + if (actor->spr.yint == 1) { actor->spr.hitag--; if (actor->spr.hitag <= 0) @@ -1545,9 +1545,9 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) void forcesphere(DDukeActor* actor, int forcesphere) { auto sectp = actor->sector(); - if (actor->spr.yvel == 0) + if (actor->spr.yint == 0) { - actor->spr.yvel = 1; + actor->spr.yint = 1; for (int l = 512; l < (2048 - 512); l += 128) for (int j = 0; j < 2048; j += 128) @@ -1897,8 +1897,8 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN { if (a2->spr.picnum == MASTERSWITCH) if (a2->spr.hitag == actor->spr.hitag) - if (a2->spr.yvel == 0) - a2->spr.yvel = 1; + if (a2->spr.yint == 0) + a2->spr.yint = 1; } break; } @@ -2498,9 +2498,9 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6) } else { - if (actor->spr.picnum == SCRAP1 && actor->spr.yvel > 0) + if (actor->spr.picnum == SCRAP1 && actor->spr.yint > 0) { - auto spawned = spawn(actor, actor->spr.yvel); + auto spawned = spawn(actor, actor->spr.yint); if (spawned) { SetActor(spawned, actor->spr.pos); @@ -3514,7 +3514,7 @@ void handle_se11(DDukeActor *actor) } } - int k = (actor->spr.yvel >> 3) * actor->temp_data[3]; + int k = (actor->spr.yint >> 3) * actor->temp_data[3]; actor->temp_data[2] += k; actor->temp_data[4] += k; ms(actor); @@ -3637,7 +3637,7 @@ void handle_se13(DDukeActor* actor) auto sc = actor->sector(); if (actor->temp_data[2]) { - int j = (actor->spr.yvel << 5) | 1; + int j = (actor->spr.yint << 5) | 1; if (actor->int_ang() == 512) { @@ -3712,7 +3712,7 @@ void handle_se15(DDukeActor* actor) if (actor->temp_data[4] == 1) //Opening { - if (actor->temp_data[3] >= (actor->spr.yvel >> 3)) + if (actor->temp_data[3] >= (actor->spr.yint >> 3)) { actor->temp_data[4] = 0; //Turn off the sliders callsound(actor->sector(), actor); @@ -3790,7 +3790,7 @@ void handle_se17(DDukeActor* actor) auto sc = actor->sector(); int sh = actor->spr.hitag; - double q = actor->temp_data[0] * actor->spr.yvel * (1 / 64.); + double q = actor->temp_data[0] * actor->spr.yint * (1 / 64.); sc->addceilingz(q); sc->addfloorz(q); @@ -3800,7 +3800,7 @@ void handle_se17(DDukeActor* actor) { if (act1->spr.statnum == STAT_PLAYER && act1->GetOwner()) { - int p = act1->spr.yvel; + int p = act1->spr.yint; if (numplayers < 2) ps[p].backupz(); ps[p].pos.Z += q; ps[p].truefz += q; @@ -3819,7 +3819,7 @@ void handle_se17(DDukeActor* actor) if (actor->temp_data[0]) //If in motion { - if (abs(sc->int_floorz() - actor->temp_data[2]) <= actor->spr.yvel) + if (abs(sc->int_floorz() - actor->temp_data[2]) <= actor->spr.yint) { activatewarpelevators(actor, 0); return; @@ -4040,7 +4040,7 @@ void handle_se19(DDukeActor *actor, int BIGFORCE) } if (sc->ceilingz < sc->floorz) - sc->add_int_ceilingz(actor->spr.yvel); + sc->add_int_ceilingz(actor->spr.yint); else { sc->setceilingz(sc->floorz); @@ -4125,7 +4125,7 @@ void handle_se20(DDukeActor* actor) actor->add_int_pos({ x, l, 0 }); - if (actor->temp_data[3] <= 0 || (actor->temp_data[3] >> 6) >= (actor->spr.yvel >> 6)) + if (actor->temp_data[3] <= 0 || (actor->temp_data[3] >> 6) >= (actor->spr.yint >> 6)) { actor->add_int_pos({ -x, -l, 0 }); actor->temp_data[0] = 0; @@ -4186,7 +4186,7 @@ void handle_se21(DDukeActor* actor) if (actor->temp_data[0] == 1) //Decide if the sector should go up or down { - actor->set_int_zvel(Sgn(actor->int_pos().Z - lp) * (actor->spr.yvel << 4)); + actor->set_int_zvel(Sgn(actor->int_pos().Z - lp) * (actor->spr.yint << 4)); actor->temp_data[0]++; } @@ -4304,7 +4304,7 @@ void handle_se27(DDukeActor* actor) ud.cameraactor = actor; actor->temp_data[0] = 999; actor->add_int_ang(getincangle(actor->int_ang(), getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 3); - actor->spr.yvel = 100 + int((actor->spr.pos.Z - ps[p].pos.Z) * (256. / 257.)); + actor->spr.yint = 100 + int((actor->spr.pos.Z - ps[p].pos.Z) * (256. / 257.)); } else if (actor->temp_data[0] == 999) @@ -4342,8 +4342,8 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift) { if (actor->temp_data[4]) return; - int x = MulScale(actor->spr.yvel, bcos(actor->int_ang()), 18); - int y = MulScale(actor->spr.yvel, bsin(actor->int_ang()), 18); + int x = MulScale(actor->spr.yint, bcos(actor->int_ang()), 18); + int y = MulScale(actor->spr.yint, bsin(actor->int_ang()), 18); DukeSectIterator it(actor->sector()); while (auto a2 = it.Next()) @@ -4392,7 +4392,7 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift) } } } - if (scroll) actor->sector()->addfloorxpan(actor->spr.yvel / 128.f); + if (scroll) actor->sector()->addfloorxpan(actor->spr.yint / 128.f); } //--------------------------------------------------------------------------- @@ -4412,7 +4412,7 @@ void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2) if (actor->spr.shade) { - sec->addceilingz(actor->spr.yvel); + sec->addceilingz(actor->spr.yint); if (sec->ceilingz > sec->floorz) { sec->setceilingz(sec->floorz); @@ -4422,7 +4422,7 @@ void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2) } else { - sec->addceilingz(-actor->spr.yvel); + sec->addceilingz(-actor->spr.yint); if (sec->int_ceilingz() < actor->temp_data[t_index]) { sec->set_int_ceilingz(actor->temp_data[t_index]); @@ -4450,49 +4450,49 @@ void handle_se32(DDukeActor *actor) { if (actor->int_ang() != 1536) { - if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yvel << 1)) + if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yint << 1)) { sc->setceilingz(actor->spr.pos.Z); callsound(actor->sector(), actor); actor->temp_data[2] = 0; actor->temp_data[0] = 0; } - else sc->add_int_ceilingz(Sgn(actor->spr.pos.Z - sc->ceilingz) * actor->spr.yvel); + else sc->add_int_ceilingz(Sgn(actor->spr.pos.Z - sc->ceilingz) * actor->spr.yint); } else { - if (abs(sc->int_ceilingz() - actor->temp_data[1]) < (actor->spr.yvel << 1)) + if (abs(sc->int_ceilingz() - actor->temp_data[1]) < (actor->spr.yint << 1)) { sc->set_int_ceilingz(actor->temp_data[1]); callsound(actor->sector(), actor); actor->temp_data[2] = 0; actor->temp_data[0] = 0; } - else sc->add_int_ceilingz(Sgn(actor->temp_data[1] - sc->int_ceilingz()) * actor->spr.yvel); + else sc->add_int_ceilingz(Sgn(actor->temp_data[1] - sc->int_ceilingz()) * actor->spr.yint); } return; } if ((actor->int_ang() & 2047) == 1536) { - if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yvel << 1)) + if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yint << 1)) { actor->temp_data[0] = 0; actor->temp_data[2] = !actor->temp_data[2]; callsound(actor->sector(), actor); sc->setceilingz(actor->spr.pos.Z); } - else sc->add_int_ceilingz(Sgn(actor->spr.pos.Z - sc->ceilingz) * actor->spr.yvel); + else sc->add_int_ceilingz(Sgn(actor->spr.pos.Z - sc->ceilingz) * actor->spr.yint); } else { - if (abs(sc->int_ceilingz() - actor->temp_data[1]) < (actor->spr.yvel << 1)) + if (abs(sc->int_ceilingz() - actor->temp_data[1]) < (actor->spr.yint << 1)) { actor->temp_data[0] = 0; actor->temp_data[2] = !actor->temp_data[2]; callsound(actor->sector(), actor); } - else sc->add_int_ceilingz(-Sgn(actor->int_pos().Z - actor->temp_data[1]) * actor->spr.yvel); + else sc->add_int_ceilingz(-Sgn(actor->int_pos().Z - actor->temp_data[1]) * actor->spr.yint); } } @@ -4526,14 +4526,14 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2) switch (actor->temp_data[0]) { case 0: - sc->add_int_ceilingz(actor->spr.yvel); + sc->add_int_ceilingz(actor->spr.yint); if (sc->ceilingz > sc->floorz) sc->setfloorz(sc->ceilingz); if (sc->ceilingz > actor->spr.pos.Z + 32) actor->temp_data[0]++; break; case 1: - sc->add_int_ceilingz(-(actor->spr.yvel << 2)); + sc->add_int_ceilingz(-(actor->spr.yint << 2)); if (sc->int_ceilingz() < actor->temp_data[4]) { sc->set_int_ceilingz(actor->temp_data[4]); @@ -4638,7 +4638,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) { if (actor->int_ang() != 1536) { - if (abs(sec->int_floorz() - actor->int_pos().Z) < actor->spr.yvel) + if (abs(sec->int_floorz() - actor->int_pos().Z) < actor->spr.yint) { sec->setfloorz(actor->spr.pos.Z); actor->temp_data[2] = 0; @@ -4648,7 +4648,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = Sgn(actor->spr.pos.Z - sec->floorz) * actor->spr.yvel; + int l = Sgn(actor->spr.pos.Z - sec->floorz) * actor->spr.yint; sec->add_int_floorz(l); DukeSectIterator it(actor->sector()); @@ -4667,7 +4667,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - if (abs(sec->int_floorz() - actor->temp_data[1]) < actor->spr.yvel) + if (abs(sec->int_floorz() - actor->temp_data[1]) < actor->spr.yint) { sec->set_int_floorz(actor->temp_data[1]); callsound(actor->sector(), actor); @@ -4677,7 +4677,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = Sgn(actor->temp_data[1] - sec->int_floorz()) * actor->spr.yvel; + int l = Sgn(actor->temp_data[1] - sec->int_floorz()) * actor->spr.yint; sec->add_int_floorz(l); DukeSectIterator it(actor->sector()); @@ -4699,7 +4699,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) if ((actor->int_ang() & 2047) == 1536) { - if (abs(actor->int_pos().Z - sec->int_floorz()) < actor->spr.yvel) + if (abs(actor->int_pos().Z - sec->int_floorz()) < actor->spr.yint) { callsound(actor->sector(), actor); actor->temp_data[0] = 0; @@ -4708,7 +4708,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = Sgn(actor->int_pos().Z - sec->int_floorz()) * actor->spr.yvel; + int l = Sgn(actor->int_pos().Z - sec->int_floorz()) * actor->spr.yint; sec->add_int_floorz(l); DukeSectIterator it(actor->sector()); @@ -4727,7 +4727,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - if (abs(sec->int_floorz() - actor->temp_data[1]) < actor->spr.yvel) + if (abs(sec->int_floorz() - actor->temp_data[1]) < actor->spr.yint) { actor->temp_data[0] = 0; callsound(actor->sector(), actor); @@ -4736,7 +4736,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = Sgn(actor->int_pos().Z - actor->temp_data[1]) * actor->spr.yvel; + int l = Sgn(actor->int_pos().Z - actor->temp_data[1]) * actor->spr.yint; sec->add_int_floorz(-l); DukeSectIterator it(actor->sector()); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index c8aacef22..df69fca13 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -407,11 +407,11 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h { if (act2->spr.picnum == APLAYER) { - int p = act2->spr.yvel; + int p = act2->spr.yint; if (isWorldTour() && act2->attackertype == FLAMETHROWERFLAME && Owner->spr.picnum == APLAYER) { - ps[p].numloogs = -1 - actor->spr.yvel; + ps[p].numloogs = -1 - actor->spr.yint; } if (ps[p].newOwner != nullptr) @@ -1054,7 +1054,7 @@ static void moveviewscreen(DDukeActor* actor) if (x >= VIEWSCR_DIST && camsprite == actor) { camsprite = nullptr; - actor->spr.yvel = 0; + actor->spr.yint = 0; actor->temp_data[0] = 0; } } @@ -1370,12 +1370,12 @@ static bool weaponhitsprite(DDukeActor* proj, DDukeActor *targ, bool fireball) if (targ->spr.picnum == APLAYER) { - int p = targ->spr.yvel; + int p = targ->spr.yint; auto Owner = proj->GetOwner(); if (ud.multimode >= 2 && fireball && Owner && Owner->spr.picnum == APLAYER) { - ps[p].numloogs = -1 - proj->spr.yvel; + ps[p].numloogs = -1 - proj->spr.yint; } S_PlayActorSound(PISTOL_BODYHIT, targ); @@ -1432,7 +1432,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo if (wal->overpicnum != MIRROR && wal->picnum != MIRROR) { proj->spr.extra >>= 1; - proj->spr.yvel--; + proj->spr.yint--; } int k = getangle(wal->delta()); @@ -1471,7 +1471,7 @@ static bool weaponhitsector(DDukeActor* proj, const DVector3& oldpos, bool fireb { spawned->SetOwner(proj); spawned->SetHitOwner(proj); - spawned->spr.yvel = proj->spr.yvel; + spawned->spr.yint = proj->spr.yint; } deletesprite(proj); return true; @@ -1486,7 +1486,7 @@ static bool weaponhitsector(DDukeActor* proj, const DVector3& oldpos, bool fireb proj->spr.xrepeat -= 2; if (proj->spr.yrepeat > 8) proj->spr.yrepeat -= 2; - proj->spr.yvel--; + proj->spr.yint--; return true; } return false; @@ -1704,7 +1704,7 @@ void moveweapons_d(void) continue; case FREEZEBLAST: - if (act->spr.yvel < 1 || act->spr.extra < 2 || (act->float_xvel() == 0 && act->float_zvel() == 0)) + if (act->spr.yint < 1 || act->spr.extra < 2 || (act->float_xvel() == 0 && act->float_zvel() == 0)) { auto spawned = spawn(act,TRANSPORTERSTAR); if (spawned) @@ -2190,7 +2190,7 @@ static void greenslime(DDukeActor *actor) DukeStatIterator it(STAT_ACTOR); while (auto ac = it.Next()) { - if (actorflag(ac, SFLAG2_CAMERA)) ac->spr.yvel = 0; + if (actorflag(ac, SFLAG2_CAMERA)) ac->spr.yint = 0; } } @@ -2578,14 +2578,14 @@ static void heavyhbomb(DDukeActor *actor) { makeitfall(actor); - if (sectp->lotag != 1 && actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F && actor->spr.yvel < 3) + if (sectp->lotag != 1 && actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F && actor->spr.yint < 3) { - if (actor->spr.yvel > 0 || (actor->spr.yvel == 0 && actor->floorz == sectp->floorz)) + if (actor->spr.yint > 0 || (actor->spr.yint == 0 && actor->floorz == sectp->floorz)) S_PlayActorSound(PIPEBOMB_BOUNCE, actor); - actor->set_int_zvel(-((4 - actor->spr.yvel) << 8)); + actor->set_int_zvel(-((4 - actor->spr.yint) << 8)); if (actor->sector()->lotag == 2) actor->mul_int_zvel(0.25); - actor->spr.yvel++; + actor->spr.yint++; } if (actor->spr.pos.Z < actor->ceilingz) // && sectp->lotag != 2 ) { @@ -3424,7 +3424,7 @@ void moveeffectors_d(void) //STATNUM 3 case SE_29_WAVES: act->spr.hitag += 64; - l = MulScale(act->spr.yvel, bsin(act->spr.hitag), 12); + l = MulScale(act->spr.yint, bsin(act->spr.hitag), 12); sc->set_int_floorz(act->int_pos().Z + l); break; case SE_31_FLOOR_RISE_FALL: // True Drop Floor @@ -3718,7 +3718,7 @@ void respawnhitag_d(DDukeActor* actor) case PODFEM1: case NAKED1: case STATUE: - if (actor->spr.yvel) fi.operaterespawns(actor->spr.yvel); + if (actor->spr.yint) fi.operaterespawns(actor->spr.yint); break; default: if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag); diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 480443521..6e46f7351 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1071,7 +1071,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo proj->spr.xrepeat -= 2; if (proj->spr.yrepeat > 8) proj->spr.yrepeat -= 2; - proj->spr.yvel--; + proj->spr.yint--; } int k = getangle(wal->delta()); @@ -1106,7 +1106,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo if (wal->overpicnum != MIRROR && wal->picnum != MIRROR) { proj->spr.extra -= 20; - proj->spr.yvel--; + proj->spr.yint--; } int k = getangle(wal->delta()); @@ -1156,7 +1156,7 @@ bool weaponhitsector(DDukeActor *proj, const DVector3& oldpos) proj->spr.xrepeat -= 2; if (proj->spr.yrepeat > 8) proj->spr.yrepeat -= 2; - proj->spr.yvel--; + proj->spr.yint--; return true; } return false; @@ -1349,7 +1349,7 @@ void moveweapons_r(void) continue; case FREEZEBLAST: - if (proj->spr.yvel < 1 || proj->spr.extra < 2 || (proj->int_xvel() == 0 && proj->int_zvel() == 0)) + if (proj->spr.yint < 1 || proj->spr.extra < 2 || (proj->int_xvel() == 0 && proj->int_zvel() == 0)) { auto star = spawn(proj, TRANSPORTERSTAR); if (star) @@ -2348,9 +2348,9 @@ static void heavyhbomb(DDukeActor *actor) makeitfall(actor); - if (sectp->lotag != 1 && (!isRRRA() || sectp->lotag != 160) && actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F && actor->spr.yvel < 3) + if (sectp->lotag != 1 && (!isRRRA() || sectp->lotag != 160) && actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F && actor->spr.yint < 3) { - if (actor->spr.yvel > 0 || (actor->spr.yvel == 0 && actor->floorz == sectp->floorz)) + if (actor->spr.yint > 0 || (actor->spr.yint == 0 && actor->floorz == sectp->floorz)) { if (actor->spr.picnum != CHEERBOMB) S_PlayActorSound(PIPEBOMB_BOUNCE, actor); @@ -2362,10 +2362,10 @@ static void heavyhbomb(DDukeActor *actor) goto DETONATEB; } } - actor->set_int_zvel(-((4 - actor->spr.yvel) << 8)); + actor->set_int_zvel(-((4 - actor->spr.yint) << 8)); if (actor->sector()->lotag == 2) actor->mul_int_zvel(0.25); - actor->spr.yvel++; + actor->spr.yint++; } if (actor->spr.picnum != CHEERBOMB && actor->spr.pos.Z < actor->ceilingz + 16 && sectp->lotag != 2) { @@ -3399,7 +3399,7 @@ void moveeffectors_r(void) //STATNUM 3 case SE_29_WAVES: act->spr.hitag += 64; - l = MulScale(act->spr.yvel, bsin(act->spr.hitag), 12); + l = MulScale(act->spr.yint, bsin(act->spr.hitag), 12); sc->set_int_floorz(act->int_pos().Z + l); break; @@ -4008,7 +4008,7 @@ void respawnhitag_r(DDukeActor *actor) case FEM10: case NAKED1: case STATUE: - if (actor->spr.yvel) fi.operaterespawns(actor->spr.yvel); + if (actor->spr.yint) fi.operaterespawns(actor->spr.yint); break; default: if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag); diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index b7de26d28..fe830d7c2 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -458,8 +458,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat case SCRAP6 + 6: case SCRAP6 + 7: - if (h->attackertype == BLIMP && t->picnum == SCRAP1 && h->spr.yvel >= 0) - t->picnum = h->spr.yvel; + if (h->attackertype == BLIMP && t->picnum == SCRAP1 && h->spr.yint >= 0) + t->picnum = h->spr.yint; else t->picnum += h->temp_data[0]; t->shade -= 6; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index f941f08c2..8b42c9518 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -590,8 +590,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat case SCRAP6 + 6: case SCRAP6 + 7: - if (t->picnum == SCRAP1 && h->spr.yvel >= 0) - t->picnum = h->spr.yvel; + if (t->picnum == SCRAP1 && h->spr.yint >= 0) + t->picnum = h->spr.yint; else t->picnum += h->temp_data[0]; if (sectp->floorpal) diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 990ed7754..eb0c0339d 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -1241,8 +1241,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, else SetGameVarID(lVar2, act->int_xvel(), sActor, sPlayer); break; case ACTOR_YVEL: - if (bSet) act->spr.yvel = lValue; - else SetGameVarID(lVar2, act->spr.yvel, sActor, sPlayer); + if (bSet) act->spr.yint = lValue; + else SetGameVarID(lVar2, act->spr.yint, sActor, sPlayer); break; case ACTOR_ZVEL: if (bSet) act->set_int_zvel(lValue); @@ -1707,8 +1707,8 @@ int ParseState::parse(void) break; case concmd_mikesnd: insptr++; - if (!S_CheckActorSoundPlaying(g_ac, g_ac->spr.yvel)) - S_PlayActorSound(g_ac->spr.yvel, g_ac, CHAN_VOICE); + if (!S_CheckActorSoundPlaying(g_ac, g_ac->spr.yint)) + S_PlayActorSound(g_ac->spr.yint, g_ac, CHAN_VOICE); break; case concmd_pkick: insptr++; @@ -2050,7 +2050,7 @@ int ParseState::parse(void) while (auto actj = it.Next()) { if (actorflag(actj, SFLAG2_CAMERA)) - actj->spr.yvel = 0; + actj->spr.yint = 0; } } @@ -2170,8 +2170,8 @@ int ParseState::parse(void) if (spawned) { if (weap) - spawned->spr.yvel = gs.weaponsandammosprites[j % 14]; - else spawned->spr.yvel = -1; + spawned->spr.yint = gs.weaponsandammosprites[j % 14]; + else spawned->spr.yint = -1; spawned->spr.pal = g_ac->spr.pal; } } diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 13857158f..ab10ac81c 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -290,7 +290,7 @@ void hud_input(int plnum) p->player_int_pos().Z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.Buildang(), 0, 0, nullptr, 10); pactor->temp_data[3] = pactor->temp_data[4] = 0; p->holoduke_on = pactor; - pactor->spr.yvel = plnum; + pactor->spr.yint = plnum; pactor->spr.extra = 0; FTA(QUOTE_HOLODUKE_ON, p); S_PlayActorSound(TELEPORTER, p->holoduke_on); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 1b0bc4931..c73ac6052 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -397,8 +397,8 @@ void dokneeattack(int snum, const std::initializer_list & respawnlist) S_PlayActorSound(SQUISHED, p->actorsqu); if (isIn(p->actorsqu->spr.picnum, respawnlist)) { - if (p->actorsqu->spr.yvel) - fi.operaterespawns(p->actorsqu->spr.yvel); + if (p->actorsqu->spr.yint) + fi.operaterespawns(p->actorsqu->spr.yint); } if (p->actorsqu->isPlayer()) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index d55fa69c1..3c951e729 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -134,7 +134,7 @@ static void shootfireball(DDukeActor *actor, int p, int sx, int sy, int sz, int spawned->spr.xrepeat = 40; spawned->spr.yrepeat = 40; } - spawned->spr.yvel = p; + spawned->spr.yint = p; spawned->spr.cstat = CSTAT_SPRITE_YCENTER; spawned->spr.clipdist = 4; } @@ -207,7 +207,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng spawned->spr.xrepeat = 2; spawned->spr.yrepeat = 2; spawned->spr.clipdist = 40; - spawned->spr.yvel = p; + spawned->spr.yint = p; spawned->SetOwner(actor); if (p == -1) @@ -740,7 +740,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i spawned->temp_actor = aimed; else { - spawned->spr.yvel = gs.numfreezebounces; + spawned->spr.yint = gs.numfreezebounces; spawned->spr.xrepeat >>= 1; spawned->spr.yrepeat >>= 1; spawned->add_int_zvel(- (2 << 4)); @@ -2218,7 +2218,7 @@ static void operateweapon(int snum, ESyncBits actions) if (k == 15) { - spawned->spr.yvel = 3; + spawned->spr.yint = 3; spawned->spr.pos.Z += 8; } diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index a4f355f2d..e919fb00b 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -692,7 +692,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i spawned->temp_actor = aimed; else { - spawned->spr.yvel = gs.numfreezebounces; + spawned->spr.yint = gs.numfreezebounces; spawned->spr.xrepeat >>= 1; spawned->spr.yrepeat >>= 1; spawned->add_int_zvel(- (2 << 4)); @@ -2755,7 +2755,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) { if (k == 15) { - spawned->spr.yvel = 3; + spawned->spr.yint = 3; spawned->spr.pos.Z += 8; } diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index 5ba1581ed..fdfcd136a 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -359,7 +359,7 @@ void operateweapon_ww(int snum, ESyncBits actions) if (k == 15) { - j->spr.yvel = 3; + j->spr.yint = 3; j->spr.pos.Z += 8; } diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 93140c99b..695af7dff 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -637,7 +637,7 @@ void resetpspritevars(int g) } else act->spr.extra = ps[j].last_extra; - act->spr.yvel = j; + act->spr.yint = j; if (ud.last_level == -1) { diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index f6728281f..53494d403 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -255,12 +255,12 @@ void displayrooms(int snum, double smoothratio, bool sceneonly) { auto act = ud.cameraactor; - if (act->spr.yvel < 0) act->spr.yvel = -100; - else if (act->spr.yvel > 199) act->spr.yvel = 300; + if (act->spr.yint < 0) act->spr.yint = -100; + else if (act->spr.yint > 199) act->spr.yint = 300; cang = interpolatedangle(DAngle::fromBuild(ud.cameraactor->tempang), act->spr.angle, smoothratio); - auto bh = buildhoriz(act->spr.yvel); + auto bh = buildhoriz(act->spr.yint); auto cstat = act->spr.cstat; act->spr.cstat = CSTAT_SPRITE_INVISIBLE; renderView(act, act->sector(), act->int_pos().X, act->int_pos().Y, act->int_pos().Z - (4 << 8), cang, bh, nullAngle, smoothratio, sceneonly, fov); diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index a6ae99020..de98ed159 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -498,7 +498,7 @@ bool activatewarpelevators(DDukeActor* actor, int d) //Parm = sectoreffectornum { if (act2->spr.lotag == SE_17_WARP_ELEVATOR || (isRRRA() && act2->spr.lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL)) if (act2->spr.hitag == actor->spr.hitag) - if ((abs(sect->int_floorz() - actor->temp_data[2]) > act2->spr.yvel) || + if ((abs(sect->int_floorz() - actor->temp_data[2]) > act2->spr.yint) || (act2->sector()->hitag == (sect->hitag - d))) break; } @@ -1216,8 +1216,8 @@ void operatemasterswitches(int low) DukeStatIterator it(STAT_STANDABLE); while (auto act2 = it.Next()) { - if (act2->spr.picnum == MASTERSWITCH && act2->spr.lotag == low && act2->spr.yvel == 0) - act2->spr.yvel = 1; + if (act2->spr.picnum == MASTERSWITCH && act2->spr.lotag == low && act2->spr.yint == 0) + act2->spr.yint = 1; } } diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index f57ca99cf..95f2a8836 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1429,7 +1429,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) if (targ->spr.statnum == 10) { - p = targ->spr.yvel; + p = targ->spr.yint; if (ps[p].newOwner != nullptr) { ps[p].newOwner = nullptr; @@ -1441,7 +1441,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) DukeStatIterator it(STAT_ACTOR); while (auto itActor = it.Next()) { - if (actorflag(itActor, SFLAG2_CAMERA)) itActor->spr.yvel = 0; + if (actorflag(itActor, SFLAG2_CAMERA)) itActor->spr.yint = 0; } } @@ -1477,7 +1477,7 @@ void clearcameras(int i, player_struct* p) DukeStatIterator it(STAT_ACTOR); while (auto act = it.Next()) { - if (actorflag(act, SFLAG2_CAMERA)) act->spr.yvel = 0; + if (actorflag(act, SFLAG2_CAMERA)) act->spr.yint = 0; } } else if (p->newOwner != nullptr) @@ -1707,13 +1707,13 @@ void checksectors_d(int snum) DukeStatIterator it(STAT_ACTOR); while (auto acti = it.Next()) { - if (actorflag(acti, SFLAG2_CAMERA) && acti->spr.yvel == 0 && neartagsprite->spr.hitag == acti->spr.lotag) + if (actorflag(acti, SFLAG2_CAMERA) && acti->spr.yint == 0 && neartagsprite->spr.hitag == acti->spr.lotag) { - acti->spr.yvel = 1; //Using this camera + acti->spr.yint = 1; //Using this camera if (snum == screenpeek) S_PlaySound(MONITOR_ACTIVE); neartagsprite->SetOwner(acti); - neartagsprite->spr.yvel = 1; + neartagsprite->spr.yint = 1; camsprite = neartagsprite; p->newOwner = acti; diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index d5c6f77f8..1abd04722 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2381,7 +2381,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) DukeStatIterator it(STAT_EFFECTOR); while (auto act = it.Next()) { - if (actorflag(act, SFLAG2_CAMERA)) act->spr.yvel = 0; + if (actorflag(act, SFLAG2_CAMERA)) act->spr.yint = 0; } } auto Owner = targ->GetHitOwner(); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 92aab2497..dae89de67 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -75,7 +75,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, int s_pn, in act->set_int_zvel(s_zv); act->spr.xoffset = 0; act->spr.yoffset = 0; - act->spr.yvel = 0; + act->spr.yint = 0; act->spr.clipdist = 0; act->spr.pal = 0; act->spr.lotag = 0; @@ -605,7 +605,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) auto sectp = actor->sector(); int d, clostest = 0; - actor->spr.yvel = sectp->extra; + actor->spr.yint = sectp->extra; actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; actor->spr.xrepeat = actor->spr.yrepeat = 0; @@ -770,7 +770,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) case SE_24_CONVEYOR: StartInterpolation(sectp, Interp_Sect_FloorPanX); - actor->spr.yvel <<= 1; + actor->spr.yint <<= 1; case SE_36_PROJ_SHOOTER: break; diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index fc476567c..13414d6b9 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -480,7 +480,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case NAKED1: case STATUE: case TOUGHGAL: - act->spr.yvel = act->spr.hitag; + act->spr.yint = act->spr.hitag; act->spr.hitag = -1; if (act->spr.picnum == PODFEM1) act->spr.extra <<= 1; [[fallthrough]]; @@ -536,7 +536,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* [[fallthrough]]; case MIKE: if (act->spr.picnum == MIKE) - act->spr.yvel = act->spr.hitag; + act->spr.yint = act->spr.hitag; [[fallthrough]]; case WEATHERWARN: ChangeActorStat(act, 1); @@ -763,7 +763,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case MASTERSWITCH: if (act->spr.picnum == MASTERSWITCH) act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - act->spr.yvel = 0; + act->spr.yint = 0; ChangeActorStat(act, 6); break; case TARGET: @@ -951,7 +951,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* else act->SetOwner(act); act->spr.xrepeat = act->spr.yrepeat = 9; - act->spr.yvel = 4; + act->spr.yint = 4; [[fallthrough]]; case REACTOR2: case REACTOR: diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 1b7e81dfb..988dc4c5d 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -438,7 +438,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case NAKED1: case STATUE: case TOUGHGAL: - act->spr.yvel = act->spr.hitag; + act->spr.yint = act->spr.hitag; act->spr.hitag = -1; [[fallthrough]]; case QUEBALL: @@ -564,7 +564,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* [[fallthrough]]; case MIKE: if (act->spr.picnum == MIKE) - act->spr.yvel = act->spr.hitag; + act->spr.yint = act->spr.hitag; ChangeActorStat(act, 1); break; @@ -739,7 +739,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case MASTERSWITCH: if (act->spr.picnum == MASTERSWITCH) act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - act->spr.yvel = 0; + act->spr.yint = 0; ChangeActorStat(act, 6); break; @@ -1102,7 +1102,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case HEAVYHBOMB: act->SetOwner(act); act->spr.xrepeat = act->spr.yrepeat = 9; - act->spr.yvel = 4; + act->spr.yint = 4; [[fallthrough]]; case REACTOR2: case REACTOR: @@ -1276,7 +1276,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case POWDERKEG: act->spr.xrepeat = 11; act->spr.yrepeat = 11; - act->spr.yvel = 4; + act->spr.yint = 4; act->set_int_xvel(32); break; case RPGSPRITE: diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 79c0e3563..3069e161f 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -114,7 +114,7 @@ public: int PlayerIndex() const { // only valid for real players - just here to abstract yvel. - return spr.yvel; + return spr.yint; } bool isPlayer() const