diff --git a/source/games/duke/src/_polymost.cpp b/source/games/duke/src/_polymost.cpp index 6aca1769950..045c4ed4130 100644 --- a/source/games/duke/src/_polymost.cpp +++ b/source/games/duke/src/_polymost.cpp @@ -215,7 +215,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed DukeSectIterator it(tgsect); while (auto act = it.Next()) { - changespritesect(act, geosectorwarp[gs]); + changeactorsect(act, geosectorwarp[gs]); setsprite(act, act->s->x -= geox[gs], act->s->y -= geoy[gs], act->s->z); } if (geosector[gs] == sect) @@ -235,7 +235,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed DukeSectIterator it(tgsect); while (auto act = it.Next()) { - changespritesect(act, geosector[gs]); + changeactorsect(act, geosector[gs]); setsprite(act, act->s->x += geox[gs], act->s->y += geoy[gs], act->s->z); } } @@ -247,7 +247,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed DukeSectIterator it(tgsect); while (auto act = it.Next()) { - changespritesect(act, geosectorwarp2[gs]); + changeactorsect(act, geosectorwarp2[gs]); setsprite(act, act->s->x -= geox2[gs], act->s->y -= geoy2[gs], act->s->z); } if (geosector[gs] == sect) @@ -267,7 +267,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed DukeSectIterator it(tgsect); while (auto act = it.Next()) { - changespritesect(act, geosector[gs]); + changeactorsect(act, geosector[gs]); setsprite(act, act->s->x += geox2[gs], act->s->y += geoy2[gs], act->s->z); } } diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 2e4c0f1d522..92a23ec2491 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1011,7 +1011,7 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2) spri->picnum = 0; // give it a picnum without any behavior attached, just in case spri->cstat |= CSTAT_SPRITE_INVISIBLE; spri->cstat2 |= CSTAT2_SPRITE_NOFIND; - changespritestat(actor, STAT_REMOVED); + changeactorstat(actor, STAT_REMOVED); } } } @@ -4028,7 +4028,7 @@ void handle_se17(DDukeActor* actor) ps[p].truecz = act3->ceilingz; ps[p].bobcounter = 0; - changespritesect(act3, spr2->sectnum); + changeactorsect(act3, spr2->sectnum); ps[p].cursectnum = spr2->sectnum; } else if (spr3->statnum != STAT_EFFECTOR) @@ -4039,7 +4039,7 @@ void handle_se17(DDukeActor* actor) spr3->backupz(); - changespritesect(act3, spr2->sectnum); + changeactorsect(act3, spr2->sectnum); setsprite(act3, spr3->pos); act3->floorz = sector[spr2->sectnum].floorz; @@ -5319,7 +5319,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO pushmove(&x, &y, &z, &j, 128, (4 << 8), (4 << 8), CLIPMASK0); s->x = x; s->y = y; s->z = z; if (j != s->sectnum && j >= 0 && j < MAXSECTORS) - changespritesect(actor, j); + changeactorsect(actor, j); S_PlayActorSound(thud, actor); } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index ed649077048..e49bbe03516 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -612,7 +612,7 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un if (dasectnum >= 0) if ((dasectnum != spri->sectnum)) - changespritesect(actor, dasectnum); + changeactorsect(actor, dasectnum); daz = spri->z + ((zchange * TICSPERFRAME) >> 3); if ((daz > actor->ceilingz) && (daz <= actor->floorz)) spri->z = daz; @@ -1119,7 +1119,7 @@ static void movetripbomb(DDukeActor *actor) int16_t curSectNum = s->sectnum; updatesectorneighbor(s->x, s->y, &curSectNum, 1024, 2048); - changespritesect(actor, curSectNum); + changeactorsect(actor, curSectNum); DDukeActor* hit; x = hitasprite(actor, &hit); @@ -1154,10 +1154,10 @@ static void movetripbomb(DDukeActor *actor) if (curSectNum == -1) break; - changespritesect(actor, curSectNum); + changeactorsect(actor, curSectNum); // this is a hack to work around the LASERLINE sprite's art tile offset - changespritesect(spawned, curSectNum); + changeactorsect(spawned, curSectNum); } } @@ -1165,7 +1165,7 @@ static void movetripbomb(DDukeActor *actor) actor->temp_data[0]++; s->x = actor->temp_data[3]; s->y = actor->temp_data[4]; s->z += (3 << 8); - changespritesect(actor, oldSectNum); + changeactorsect(actor, oldSectNum); actor->temp_data[3] = 0; if (hit && lTripBombControl & TRIPBOMB_TRIPWIRE) { @@ -2049,7 +2049,7 @@ void movetransports_d(void) ps[p].bobposy = ps[p].oposy = ps[p].posy = Owner->s->y; ps[p].oposz = ps[p].posz = Owner->s->z - gs.playerheight; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); ps[p].cursectnum = spr2->sectnum; if (spr->pal == 0) @@ -2078,7 +2078,7 @@ void movetransports_d(void) auto pa = ps[p].GetActor(); pa->s->opos = ps[p].pos; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); ps[p].cursectnum = Owner->s->sectnum; break; @@ -2130,7 +2130,7 @@ void movetransports_d(void) ps[p].transporter_hold = -2; ps[p].cursectnum = Owner->s->sectnum; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); setsprite(ps[p].GetActor(), ps[p].posx, ps[p].posy, ps[p].posz + gs.playerheight); if ((krand() & 255) < 32) @@ -2256,7 +2256,7 @@ void movetransports_d(void) Owner->temp_data[0] = 13; } - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); } } else @@ -2267,7 +2267,7 @@ void movetransports_d(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); } break; case 1: @@ -2277,7 +2277,7 @@ void movetransports_d(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); break; case 2: @@ -2287,7 +2287,7 @@ void movetransports_d(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); break; } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index f710d5225fd..070fc223968 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -441,7 +441,7 @@ int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, un if (dasectnum >= 0) if ((dasectnum != spri->sectnum)) - changespritesect(actor, dasectnum); + changeactorsect(actor, dasectnum); daz = spri->z + ((zchange * TICSPERFRAME) >> 3); if ((daz > actor->ceilingz) && (daz <= actor->floorz)) spri->z = daz; @@ -1632,7 +1632,7 @@ void movetransports_r(void) ps[p].bobposy = ps[p].oposy = ps[p].posy = Owner->s->y; ps[p].oposz = ps[p].posz = Owner->s->z - (gs.playerheight - (4 << 8)); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); ps[p].cursectnum = spr2->sectnum; auto beam = spawn(Owner, TRANSPORTERBEAM); @@ -1655,7 +1655,7 @@ void movetransports_r(void) else ps[p].posz = Owner->s->z + 6144; ps[p].oposz = ps[p].posz; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); ps[p].cursectnum = Owner->s->sectnum; break; @@ -1720,7 +1720,7 @@ void movetransports_r(void) ps[p].transporter_hold = -2; ps[p].cursectnum = Owner->s->sectnum; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); if ((krand() & 255) < 32) spawn(ps[p].GetActor(), WATERSPLASH2); @@ -1734,7 +1734,7 @@ void movetransports_r(void) ps[p].transporter_hold = -2; ps[p].cursectnum = Owner->s->sectnum; - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); } } break; @@ -1860,7 +1860,7 @@ void movetransports_r(void) Owner->temp_data[0] = 13; } - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); } } else @@ -1871,7 +1871,7 @@ void movetransports_r(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); } break; case ST_1_ABOVE_WATER: @@ -1881,7 +1881,7 @@ void movetransports_r(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); break; case ST_2_UNDERWATER: @@ -1891,7 +1891,7 @@ void movetransports_r(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); break; @@ -1903,7 +1903,7 @@ void movetransports_r(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); movesprite_ex(act2, MulScale(spr2->xvel, bcos(spr2->ang), 14), MulScale(spr2->xvel, bsin(spr2->ang), 14), 0, CLIPMASK1, coll); @@ -1917,7 +1917,7 @@ void movetransports_r(void) spr2->backupz(); - changespritesect(act2, Owner->s->sectnum); + changeactorsect(act2, Owner->s->sectnum); movesprite_ex(act2, MulScale(spr2->xvel, bcos(spr2->ang), 14), MulScale(spr2->xvel, bsin(spr2->ang), 14), 0, CLIPMASK1, coll); @@ -2486,7 +2486,7 @@ void rr_specialstats() ps[p].bobposy = ps[p].oposy = ps[p].posy = act2->s->y; ps[p].oposz = ps[p].posz = act2->s->z - (36 << 8); auto pact = ps[p].GetActor(); - changespritesect(pact, act2->s->sectnum); + changeactorsect(pact, act2->s->sectnum); ps[p].cursectnum = pact->s->sectnum; S_PlayActorSound(70, act2); deletesprite(act2); diff --git a/source/games/duke/src/dukeactor.h b/source/games/duke/src/dukeactor.h index 57918f25995..7c75b6479e1 100644 --- a/source/games/duke/src/dukeactor.h +++ b/source/games/duke/src/dukeactor.h @@ -100,16 +100,11 @@ inline void changeactorstat(DDukeActor* a, int newstat) ::changespritestat(a->GetIndex(), newstat); } -inline void changespritesect(DDukeActor* a, int newsect) +inline void changeactorsect(DDukeActor* a, int newsect) { ::changespritesect(a->GetIndex(), newsect); } -inline void changespritesect(int i, int newsect) -{ - ::changespritesect(i, newsect); -} - inline int setsprite(DDukeActor* a, int x, int y, int z) { return ::setsprite(a->GetIndex(), x, y, z); @@ -216,4 +211,5 @@ inline void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16 *neartagsprite = nts == -1 ? nullptr : &hittype[nts]; } + END_DUKE_NS diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index fe123596626..501b4eb8178 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -3015,7 +3015,7 @@ void processinput_d(int snum) p->posx += p->posxv >> 14; p->posy += p->posyv >> 14; updatesector(p->posx, p->posy, &p->cursectnum); - changespritesect(pact, p->cursectnum); + changeactorsect(pact, p->cursectnum); } else clipmove_ex(&p->posx, &p->posy, @@ -3065,7 +3065,7 @@ void processinput_d(int snum) S_PlayActorSound(DUKE_ONWATER, pact); if (p->cursectnum != s->sectnum) - changespritesect(pact, p->cursectnum); + changeactorsect(pact, p->cursectnum); if (ud.clipping == 0) j = (pushmove(&p->posx, &p->posy, &p->posz, &p->cursectnum, 164L, (4L << 8), (4L << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index b84de69ebaa..886115340c7 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3778,7 +3778,7 @@ void processinput_r(int snum) p->posx += p->posxv >> 14; p->posy += p->posyv >> 14; updatesector(p->posx, p->posy, &p->cursectnum); - changespritesect(pact, p->cursectnum); + changeactorsect(pact, p->cursectnum); } else clipmove_ex(&p->posx, &p->posy, @@ -3910,7 +3910,7 @@ void processinput_r(int snum) S_PlayActorSound(DUKE_ONWATER, pact); if (p->cursectnum != s->sectnum) - changespritesect(pact, p->cursectnum); + changeactorsect(pact, p->cursectnum); int j; if (ud.clipping == 0) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index e123dd7f90e..520d9f25cf7 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1413,7 +1413,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) short j = s->sectnum; pushmove(&s->x, &s->y, &s->z, &j, 128L, (4 << 8), (4 << 8), CLIPMASK0); if (j != s->sectnum && j >= 0 && j < MAXSECTORS) - changespritesect(targ, j); + changeactorsect(targ, j); } if (s->statnum == 2) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index cf5a92edbe8..71f10735908 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -997,7 +997,7 @@ void spawneffector(DDukeActor* actor) sp->picnum = 0; sp->cstat2 = CSTAT2_SPRITE_NOFIND; sp->cstat = CSTAT_SPRITE_INVISIBLE; - changespritesect(actor, STAT_REMOVED); + changeactorsect(actor, STAT_REMOVED); Printf("Found lonely Sector Effector (lotag 0) at (%d,%d)\n", sp->x, sp->y); return; }