From f13d9892dc4c0ebd04fcbee93d805409dacd8da3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 20:11:01 +0200 Subject: [PATCH] - trivial wrapper replacements in Duke --- source/games/blood/src/fx.cpp | 4 +-- source/games/blood/src/triggers.cpp | 4 +-- source/games/duke/src/actors.cpp | 14 +++++----- source/games/duke/src/actors_d.cpp | 6 ++--- source/games/duke/src/actors_r.cpp | 30 +++++++++++----------- source/games/duke/src/animatesprites_d.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index 3aad68e45..9a695f1ba 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -210,9 +210,9 @@ void CFX::fxProcess(void) actAirDrag(actor, pFXData->drag); actor->add_int_pos({ actor->vel.X >> 12, actor->vel.Y >> 12, actor->vel.Z >> 8 }); // Weird... - if (actor->vel.X || (actor->vel.Y && actor->int_pos().Z >= actor->sector()->int_floorz())) + if (actor->vel.X || (actor->vel.Y && actor->spr.pos.Z >= actor->sector()->floorz)) { - updatesector(actor->int_pos().X, actor->int_pos().Y, &pSector); + updatesector(actor->spr.pos, &pSector); if (pSector == nullptr) { remove(actor); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 749b0d7f3..c16bf06ea 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1634,8 +1634,8 @@ void OperateTeleport(sectortype* pSector) { TeleFrag(pXSector->actordata, destactor->sector()); } - actor->set_int_xy(destactor->int_pos().X, destactor->int_pos().Y); - actor->add_int_z(destactor->sector()->int_floorz() - pSector->int_floorz()); + actor->spr.pos.XY() = destactor->spr.pos.XY(); + actor->spr.pos.Z += destactor->sector()->floorz - pSector->floorz; actor->spr.angle = destactor->spr.angle; ChangeActorSect(actor, destactor->sector()); sfxPlay3DSound(destactor, 201, -1, 0); diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 7960a172d..50001544a 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -576,7 +576,7 @@ void movefx(void) act->temp_data[0] = 0; } } - else if (act->spr.lotag < 999 && (unsigned)act->sector()->lotag < ST_9_SLIDING_ST_DOOR && snd_ambience && act->sector()->int_floorz() != act->sector()->int_ceilingz()) + else if (act->spr.lotag < 999 && (unsigned)act->sector()->lotag < ST_9_SLIDING_ST_DOOR && snd_ambience && act->sector()->floorz != act->sector()->ceilingz) { int flags = S_GetUserFlags(act->spr.lotag); if (flags & SF_MSFX) @@ -4429,7 +4429,7 @@ void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2) { auto sec = actor->sector(); - if (sec->int_floorz() <= sec->int_ceilingz()) + if (sec->floorz <= sec->ceilingz) actor->spr.shade = 0; else if (sec->int_ceilingz() <= actor->temp_data[t_index]) actor->spr.shade = 1; @@ -4437,9 +4437,9 @@ void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2) if (actor->spr.shade) { sec->add_int_ceilingz(actor->spr.yvel << 4); - if (sec->int_ceilingz() > sec->int_floorz()) + if (sec->ceilingz > sec->floorz) { - sec->set_int_ceilingz(sec->int_floorz()); + sec->ceilingz = sec->floorz; if (pistonsound && snd1 >= 0) S_PlayActorSound(snd1, actor); } @@ -4551,9 +4551,9 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2) { case 0: sc->add_int_ceilingz(actor->spr.yvel); - if (sc->int_ceilingz() > sc->int_floorz()) - sc->set_int_floorz(sc->int_ceilingz()); - if (sc->int_ceilingz() > actor->int_pos().Z + (32 << 8)) + if (sc->ceilingz > sc->floorz) + sc->floorz = sc->ceilingz; + if (sc->ceilingz > actor->spr.pos.Z + 32) actor->temp_data[0]++; break; case 1: diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 830b79694..0a0c13c4b 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -770,14 +770,14 @@ void movefallers_d(void) x = gs.gravity; } - if (act->int_pos().Z < (sectp->int_floorz() - FOURSLEIGHT)) + if (act->spr.pos.Z < sectp->floorz - 1) { act->spr.zvel += x; if (act->spr.zvel > 6144) act->spr.zvel = 6144; act->add_int_z(act->spr.zvel); } - if ((sectp->int_floorz() - act->int_pos().Z) < (16 << 8)) + if ((sectp->floorz - act->spr.pos.Z) < 16) { j = 1 + (krand() & 7); for (x = 0; x < j; x++) RANDOMSCRAP(act); @@ -3133,7 +3133,7 @@ void moveexplosions_d(void) // STATNUM 5 case SHELL: case SHOTGUNSHELL: - shell(act, (sectp->int_floorz() + (24 << 8)) < act->int_pos().Z); + shell(act, sectp->floorz + 24 < act->spr.pos.Z); continue; case GLASSPIECES: diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 462cec981..a02cd75e8 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -689,14 +689,14 @@ void movefallers_r(void) x = gs.gravity; } - if (act->int_pos().Z < (sectp->int_floorz() - FOURSLEIGHT)) + if (act->spr.pos.Z < sectp->floorz - 1) { act->spr.zvel += x; if (act->spr.zvel > 6144) act->spr.zvel = 6144; act->add_int_z(act->spr.zvel); } - if ((sectp->int_floorz() - act->int_pos().Z) < (16 << 8)) + if ((sectp->floorz - act->spr.pos.Z) < 16) { int j = 1 + (krand() & 7); for (x = 0; x < j; x++) RANDOMSCRAP(act); @@ -2137,8 +2137,8 @@ void rr_specialstats() if (act->spr.hitag == 100) { act->spr.pos.Z += 4; - if (act->int_pos().Z >= act->sector()->int_floorz() + 15168) - act->set_int_z(act->sector()->int_floorz() + 15168); + if (act->spr.pos.Z >= act->sector()->floorz + 59.25) + act->spr.pos.Z = act->sector()->floorz + 59.25; } if (act->spr.picnum == LUMBERBLADE) @@ -2147,7 +2147,7 @@ void rr_specialstats() if (act->spr.extra == 192) { act->spr.hitag = 0; - act->set_int_z(act->sector()->int_floorz() - 15168); + act->spr.pos.Z = act->sector()->floorz - 59.25; act->spr.extra = 0; act->spr.picnum = RRTILE3410; DukeStatIterator it2(STAT_DEFAULT); @@ -2692,7 +2692,7 @@ void moveactors_r(void) act->spr.picnum = RRTILE3192; break; case 903: - if (act->int_pos().Z >= sectp->int_floorz() - (8<<8)) + if (act->spr.pos.Z >= sectp->floorz - 8) { deletesprite(act); continue; @@ -2731,7 +2731,7 @@ void moveactors_r(void) } if (sectp->lotag == 903) { - if (act->int_pos().Z >= sectp->int_floorz() - (4<<8)) + if (act->spr.pos.Z >= sectp->floorz - 4) { deletesprite(act); continue; @@ -2755,12 +2755,12 @@ void moveactors_r(void) MulScale(act->spr.xvel, bcos(act->int_ang()), 14), MulScale(act->spr.xvel, bsin(act->int_ang()), 14), act->spr.zvel,CLIPMASK0, coll); - if (act->int_pos().Z >= sectp->int_floorz() - (8<<8)) + if (act->spr.pos.Z >= sectp->floorz - 8) { if (sectp->lotag == 1) { auto j = spawn(act, WATERSPLASH2); - if (j) j->set_int_z(j->sector()->int_floorz()); + if (j) j->spr.pos.Z = j->sector()->floorz; } deletesprite(act); continue; @@ -2929,7 +2929,7 @@ void moveexplosions_r(void) // STATNUM 5 { case SHOTGUNSPRITE: if (act->sector()->lotag == 800) - if (act->int_pos().Z >= act->sector()->int_floorz() - (8 << 8)) + if (act->spr.pos.Z >= act->sector()->floorz - 8) { deletesprite(act); continue; @@ -3084,7 +3084,7 @@ void moveexplosions_r(void) // STATNUM 5 isRRRA() && (act->spr.picnum == RRTILE2465 || act->spr.picnum == RRTILE2560))) continue; if (act->sector()->lotag == 800) - if (act->int_pos().Z >= act->sector()->int_floorz() - (8 << 8)) + if (act->spr.pos.Z >= act->sector()->floorz - 8) { deletesprite(act); continue; @@ -3096,7 +3096,7 @@ void moveexplosions_r(void) // STATNUM 5 if (!bloodpool(act, false)) continue; if (act->sector()->lotag == 800) - if (act->int_pos().Z >= act->sector()->int_floorz() - (8 << 8)) + if (act->spr.pos.Z >= act->sector()->floorz - 8) { deletesprite(act); } @@ -3185,7 +3185,7 @@ void handle_se06_r(DDukeActor *actor) { ns->spr.cstat = 0; ns->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - ns->set_int_z(actor->sector()->int_floorz() - 6144); + ns->spr.pos.Z = actor->sector()->floorz - 24; } deletesprite(actor); return; @@ -3941,8 +3941,8 @@ void destroyit(DDukeActor *actor) destwal->nextWall()->cstat = 0; } } - destsect->set_int_floorz(srcsect->int_floorz()); - destsect->set_int_ceilingz(srcsect->int_ceilingz()); + destsect->setfloorz(srcsect->floorz); + destsect->setceilingz(srcsect->ceilingz); destsect->ceilingstat = srcsect->ceilingstat; destsect->floorstat = srcsect->floorstat; destsect->ceilingpicnum = srcsect->ceilingpicnum; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 145a4dabb..033928ba5 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -647,7 +647,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat case BURNING2: if (!OwnerAc) break; if (!actorflag(OwnerAc, SFLAG_NOFLOORFIRE)) - t->set_int_z(t->sectp->int_floorz()); + t->pos.Z = t->sectp->floorz; t->shade = -127; break; case COOLEXPLOSION1: diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index e82094ce6..f73fdc69b 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -803,7 +803,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat case FIRE: case BURNING: if (!OwnerAc || !actorflag(OwnerAc, SFLAG_NOFLOORFIRE)) - t->set_int_z(t->sectp->int_floorz()); + t->pos.Z = t->sectp->floorz; t->shade = -127; break; case WALLLIGHT3: