Skip to content

Commit

Permalink
- more changesprite* renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 12, 2021
1 parent 2e37cc6 commit b1ac1ad
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 44 deletions.
8 changes: 4 additions & 4 deletions source/games/duke/src/_polymost.cpp
Expand Up @@ -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)
Expand All @@ -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);
}
}
Expand All @@ -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)
Expand All @@ -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);
}
}
Expand Down
8 changes: 4 additions & 4 deletions source/games/duke/src/actors.cpp
Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
24 changes: 12 additions & 12 deletions source/games/duke/src/actors_d.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1154,18 +1154,18 @@ 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);

}
}

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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -2256,7 +2256,7 @@ void movetransports_d(void)
Owner->temp_data[0] = 13;
}

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);
}
}
else
Expand All @@ -2267,7 +2267,7 @@ void movetransports_d(void)

spr2->backupz();

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);
}
break;
case 1:
Expand All @@ -2277,7 +2277,7 @@ void movetransports_d(void)

spr2->backupz();

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);

break;
case 2:
Expand All @@ -2287,7 +2287,7 @@ void movetransports_d(void)

spr2->backupz();

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);

break;
}
Expand Down
24 changes: 12 additions & 12 deletions source/games/duke/src/actors_r.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -1860,7 +1860,7 @@ void movetransports_r(void)
Owner->temp_data[0] = 13;
}

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);
}
}
else
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -1891,7 +1891,7 @@ void movetransports_r(void)

spr2->backupz();

changespritesect(act2, Owner->s->sectnum);
changeactorsect(act2, Owner->s->sectnum);

break;

Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions source/games/duke/src/dukeactor.h
Expand Up @@ -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);
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions source/games/duke/src/player_d.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/player_r.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/sectors_d.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/spawn.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit b1ac1ad

Please sign in to comment.