From b327f7f03ab4202bd7229238ee17097a2a1100cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 7 Feb 2022 08:47:18 +0100 Subject: [PATCH] - some simple replacements. --- source/games/blood/src/actor.cpp | 2 +- source/games/blood/src/animatesprite.cpp | 8 ++++---- source/games/duke/src/actors_d.cpp | 6 +++--- source/games/duke/src/actors_r.cpp | 6 +++--- source/games/duke/src/animatesprites_d.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 2 +- source/games/duke/src/player_d.cpp | 8 ++++---- source/games/duke/src/player_r.cpp | 8 ++++---- source/games/duke/src/player_w.cpp | 2 +- source/games/duke/src/sectors_d.cpp | 4 ++-- source/games/duke/src/sectors_r.cpp | 2 +- source/games/duke/src/spawn.cpp | 2 +- source/games/duke/src/spawn_d.cpp | 4 ++-- source/games/duke/src/spawn_r.cpp | 4 ++-- source/games/sw/src/bunny.cpp | 4 ++-- source/games/sw/src/ripper.cpp | 2 +- source/games/sw/src/ripper2.cpp | 2 +- source/games/sw/src/sprite.cpp | 2 +- source/games/sw/src/track.cpp | 2 +- source/games/sw/src/weapon.cpp | 8 ++++---- 20 files changed, 40 insertions(+), 40 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index fa5d97ef8..5f635a6d6 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -7087,7 +7087,7 @@ void actPostProcess(void) void MakeSplash(DBloodActor* actor) { actor->spr.flags &= ~2; - actor->add_int_z(-(4 << 8)); + actor->spr.pos.Z -= 4; int nSurface = tileGetSurfType(actor->hit.florhit); switch (actor->spr.type) { diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index ab91b31ae..1f1df368a 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -221,7 +221,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (!pNSprite) break; - pNSprite->set_int_z(pTSprite->int_pos().Z); + pNSprite->pos.Z = pTSprite->pos.Z; pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->shade = -128; pNSprite->xrepeat = pTSprite->xrepeat; @@ -314,7 +314,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF break; pNSprite->shade = -128; - pNSprite->set_int_z(pTSprite->int_pos().Z); + pNSprite->pos.Z = pTSprite->pos.Z; pNSprite->picnum = 908; pNSprite->statnum = kStatDecoration; pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum) * pTSprite->xrepeat) / 64; @@ -431,7 +431,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->shade = -128; pNSprite->pal = 2; pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; - pNSprite->set_int_z(pTSprite->int_pos().Z); + pNSprite->pos.Z = pTSprite->pos.Z; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; pNSprite->picnum = 2427; @@ -479,7 +479,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (!pNSprite) break; - pNSprite->set_int_z(pTSprite->int_pos().Z); + pNSprite->pos.Z = pTSprite->pos.Z; if (gDetail > 1) pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP; pNSprite->shade = ClipLow(pTSprite->shade - 32, -128); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 442d74d7b..c153ef450 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -709,7 +709,7 @@ void movefallers_d(void) if (act->temp_data[0] == 0) { - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; act->temp_data[1] = act->spr.ang; x = act->spr.extra; j = fi.ifhitbyweapon(act); @@ -923,7 +923,7 @@ static void movetripbomb(DDukeActor *actor) actor->temp_data[0]++; actor->set_int_xy(actor->temp_data[3], actor->temp_data[4]); - actor->add_int_z(3 << 8); + actor->spr.pos.Z += 3; ChangeActorSect(actor, oldSect); actor->temp_data[3] = 0; if (hit && lTripBombControl & TRIPBOMB_TRIPWIRE) @@ -946,7 +946,7 @@ static void movetripbomb(DDukeActor *actor) x = hitasprite(actor, nullptr); actor->set_int_xy(actor->temp_data[3], actor->temp_data[4]); - actor->add_int_z(3 << 8); + actor->spr.pos.Z += 3; SetActor(actor, actor->spr.pos); if (actor->ovel.X != x && lTripBombControl & TRIPBOMB_TRIPWIRE) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index b59bd83cb..d627259f3 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -630,7 +630,7 @@ void movefallers_r(void) if (act->temp_data[0] == 0) { - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; act->temp_data[1] = act->spr.ang; int x = act->spr.extra; int j = fi.ifhitbyweapon(act); @@ -661,7 +661,7 @@ void movefallers_r(void) } } act->spr.ang = act->temp_data[1]; - act->add_int_z(16 << 8); + act->spr.pos.Z += 16; } else if (act->temp_data[0] == 1) { @@ -2139,7 +2139,7 @@ void rr_specialstats() { if (act->spr.hitag == 100) { - act->add_int_z(4 << 8); + act->spr.pos.Z += 4; if (act->int_pos().Z >= act->sector()->int_floorz() + 15168) act->set_int_z(act->sector()->int_floorz() + 15168); } diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index d7ba2dce1..032b0fbc6 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -227,7 +227,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat break; case ATOMICHEALTH: - t->add_int_z(-(4 << 8)); + t->pos.Z -= 4; break; case CRYSTALAMMO: t->shade = bsin(PlayClock << 4, -10); diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index eb755b731..50f33d0f5 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -223,7 +223,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat break; case ATOMICHEALTH: - t->add_int_z(-(4 << 8)); + t->pos.Z -= 4; break; case CRYSTALAMMO: t->shade = bsin(PlayClock << 4, -10); diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 337df1308..1dcbd118d 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -261,7 +261,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) if (p >= 0) { auto k = spawn(knee, SMALLSMOKE); - if (k) k->add_int_z(-(8 << 8)); + if (k) k->spr.pos.Z -= 8; S_PlayActorSound(KICK_HIT, knee); } @@ -439,7 +439,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa auto jib = spawn(spark, JIBS6); if (jib) { - jib->add_int_z(4 << 8); + jib->spr.pos.Z += 4; jib->spr.xvel = 16; jib->spr.xrepeat = jib->spr.yrepeat = 24; jib->spr.ang += 64 - (krand() & 127); @@ -2212,7 +2212,7 @@ static void operateweapon(int snum, ESyncBits actions) if (k == 15) { spawned->spr.yvel = 3; - spawned->add_int_z(8 << 8); + spawned->spr.pos.Z += 8; } k = hits(pact); @@ -2377,7 +2377,7 @@ static void operateweapon(int snum, ESyncBits actions) j->spr.ang += 1024; j->spr.ang &= 2047; j->spr.xvel += 32; - j->add_int_z(3 << 8); + j->spr.pos.Z += 3; ssp(j, CLIPMASK0); } } diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 5d6ac9019..f704604e6 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -153,7 +153,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, if (p >= 0) { auto k = spawn(wpn, SMALLSMOKE); - if (k) k->add_int_z(-(8 << 8)); + if (k) k->spr.pos.Z -= 8; if (atwith == KNEE) S_PlayActorSound(KICK_HIT, wpn); else if (isRRRA() && atwith == SLINGBLADE) S_PlayActorSound(260, wpn); } @@ -334,7 +334,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa spark->spr.xrepeat = spark->spr.yrepeat = 0; if (l) { - l->add_int_z(4 << 8); + l->spr.pos.Z += 4; l->spr.xvel = 16; l->spr.xrepeat = l->spr.yrepeat = 24; l->spr.ang += 64 - (krand() & 127); @@ -2755,7 +2755,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) if (k == 15) { spawned->spr.yvel = 3; - spawned->add_int_z(8 << 8); + spawned->spr.pos.Z += 8; } k = hits(p->GetActor()); @@ -2980,7 +2980,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) j->spr.ang += 1024; j->spr.ang &= 2047; j->spr.xvel += 32; - j->add_int_z(3 << 8); + j->spr.pos.Z += 3; ssp(j, CLIPMASK0); } } diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index 1cc7c6fb8..93746a423 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -361,7 +361,7 @@ void operateweapon_ww(int snum, ESyncBits actions) if (k == 15) { j->spr.yvel = 3; - j->add_int_z(8 << 8); + j->spr.pos.Z += 8; } k = hits(p->GetActor()); diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 4c313c757..b187d0009 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1221,7 +1221,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) if (targ->spr.cstat & CSTAT_SPRITE_BLOCK) { S_PlayActorSound(GLASS_BREAKING, targ); - targ->add_int_z(16 << 8); + targ->spr.pos.Z += 16; targ->spr.cstat = 0; lotsofglass(targ, nullptr, 5); } @@ -1374,7 +1374,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) { if (proj->spr.pal == 6) spawned->spr.pal = 6; - spawned->add_int_z(4 << 8); + spawned->spr.pos.Z += 4; spawned->spr.xvel = 16; spawned->spr.xrepeat = spawned->spr.yrepeat = 24; spawned->spr.ang += 32 - (krand() & 63); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index f0381b69c..f171539a1 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2330,7 +2330,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) { if (proj->spr.pal == 6) spawned->spr.pal = 6; - spawned->add_int_z(4 << 8); + spawned->spr.pos.Z += 4; spawned->spr.xvel = 16; spawned->spr.xrepeat = spawned->spr.yrepeat = 24; spawned->spr.ang += 32 - (krand() & 63); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 28978d396..2a50e1362 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -536,7 +536,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor) } else if (!actj) { - actor->add_int_z(4 << 8); + actor->spr.pos.Z += 4; actor->temp_data[0] = actor->int_pos().Z; if (!isRR()) actor->temp_data[1] = krand() & 127; } diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 2d1167ae4..1a482660f 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -314,7 +314,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; act->spr.xrepeat = 7 + (krand() & 7); act->spr.yrepeat = 7 + (krand() & 7); - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; if (actj && actj->spr.pal == 6) act->spr.pal = 6; insertspriteq(act); @@ -679,7 +679,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* } case WATERBUBBLE: if (actj && actj->spr.picnum == APLAYER) - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; if (act->spr.picnum == WATERBUBBLE) { if (actj) diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 52e1b8302..60565a49d 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -353,7 +353,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; act->spr.xrepeat = 7 + (krand() & 7); act->spr.yrepeat = 7 + (krand() & 7); - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; if (actj && actj->spr.pal == 6) act->spr.pal = 6; insertspriteq(act); @@ -684,7 +684,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* } case WATERBUBBLE: if (actj && actj->spr.picnum == APLAYER) - act->add_int_z(-(16 << 8)); + act->spr.pos.Z -= 16; if (act->spr.picnum == WATERBUBBLE) { if (actj) diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index 87a103e8d..65d7521ec 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -1112,7 +1112,7 @@ void BunnyHatch(DSWActor* actor) for (int i = 0; i < MAX_BUNNYS; i++) { auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.xrepeat = 30; // Baby size actorNew->spr.yrepeat = 24; actorNew->spr.ang = rip_ang[i]; @@ -1168,7 +1168,7 @@ DSWActor* BunnyHatch2(DSWActor* actor) { auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.xrepeat = 30; // Baby size actorNew->spr.yrepeat = 24; actorNew->spr.ang = RANDOM_P2(2048); diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index f5f0e813a..6d68221cf 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1174,7 +1174,7 @@ void RipperHatch(DSWActor* actor) { auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); ClearOwner(actorNew); - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64; actorNew->spr.ang = rip_ang[i]; actorNew->spr.pal = 0; diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index edad2a05a..990837780 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1199,7 +1199,7 @@ void Ripper2Hatch(DSWActor* actor) { auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); ClearOwner(actorNew); - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64; actorNew->spr.ang = rip_ang[i]; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 9b812ea30..48fe2de00 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2490,7 +2490,7 @@ void SpriteSetup(void) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.ang = NORM_ANGLE(actor->spr.ang + 1024); actorNew->spr.picnum = actor->spr.picnum; diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 8da6eba11..fc91b430e 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -303,7 +303,7 @@ DSWActor* TrackClonePoint(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; - actorNew->set_int_pos(actor->int_pos()); + actorNew->spr.pos = actor->spr.pos; actorNew->spr.ang = actor->spr.ang; actorNew->spr.lotag = actor->spr.lotag; actorNew->spr.hitag = actor->spr.hitag; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 160df0756..f0e40dce2 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -17398,7 +17398,7 @@ int QueueStar(DSWActor* actor) { // move old star to new stars place auto osp = StarQueue[StarQueueHead]; - osp->set_int_pos(actor->int_pos()); + osp->spr.pos = actor->spr.pos; ChangeActorSect(osp, actor->sector()); KillActor(actor); actor = osp; @@ -17511,7 +17511,7 @@ int QueueFloorBlood(DSWActor* actor) spawnedActor->spr.extra = 0; spawnedActor->spr.clipdist = 0; spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0; - spawnedActor->set_int_pos(actor->int_pos()); + spawnedActor->spr.pos = actor->spr.pos; spawnedActor->add_int_z(Z(1)); spawnedActor->spr.ang = RANDOM_P2(2048); // Just make it any old angle spawnedActor->spr.shade -= 5; // Brighten it up just a bit @@ -17612,7 +17612,7 @@ int QueueFootPrint(DSWActor* actor) spawnedActor->spr.extra = 0; spawnedActor->spr.clipdist = 0; spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0; - spawnedActor->set_int_pos(actor->int_pos()); + spawnedActor->spr.pos = actor->spr.pos; spawnedActor->spr.ang = actor->spr.ang; spawnedActor->user.Flags &= ~(SPR_SHADOW); switch (FootMode) @@ -17885,7 +17885,7 @@ void QueueGeneric(DSWActor* actor, short pic) { // move old sprite to new sprite's place auto osp = GenericQueue[GenericQueueHead]; - osp->set_int_pos(actor->int_pos()); + osp->spr.pos = actor->spr.pos; ChangeActorSect(osp, actor->sector()); KillActor(actor); actor = GenericQueue[GenericQueueHead];