- deprecate the sector index variant of pushmove

This commit is contained in:
Christoph Oelckers 2021-11-26 20:41:03 +01:00
parent 2aefe4398b
commit 6748a39c8f
7 changed files with 28 additions and 19 deletions

View file

@ -33,7 +33,7 @@ int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist
int32_t clipmove_(vec3_t *const pos, int *const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist,
int32_t const flordist, uint32_t const cliptype, int clipmoveboxtracenum = 3) ATTRIBUTE((nonnull(1, 2)));
int pushmove(vec3_t *const vect, int *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
int pushmove_(vec3_t *const vect, int *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true) ATTRIBUTE((nonnull(1, 2)));
#endif

View file

@ -825,7 +825,7 @@ int32_t clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_
//
// pushmove
//
int pushmove(vec3_t *const vect, int *const sectnum,
int pushmove_(vec3_t *const vect, int *const sectnum,
int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype, bool clear /*= true*/)
{
int bad;

View file

@ -358,6 +358,14 @@ inline void getzrange(int x, int y, int z, int16_t sectnum, int32_t* ceilz, int3
getzrange_(&v, sectnum, ceilz, ceilhit, florz, florhit, walldist, cliptype);
}
[[deprecated]]
inline int pushmove(vec3_t* const vect, int* const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true)
{
return pushmove_(vect, sectnum, walldist, ceildist, flordist, cliptype, clear);
}
inline int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& direction, HitInfoBase& hitinfo, unsigned cliptype)
@ -400,3 +408,12 @@ inline void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, Colli
ceilhit.setFromEngine(ch);
florhit.setFromEngine(fh);
}
inline int pushmove(vec3_t* const vect, sectortype** const sect, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true)
{
int sectno = *sect ? sector.IndexOf(*sect) : -1;
int res = pushmove_(vect, &sectno, walldist, ceildist, flordist, cliptype, clear);
*sect = sectno == -1 ? nullptr : &sector[sectno];
return res;
}

View file

@ -323,15 +323,6 @@ inline void dragpoint(walltype* pointhighlight, int32_t dax, int32_t day)
dragpoint(wallnum(pointhighlight), dax, day);
}
inline int pushmove(vec3_t *const vect, sectortype**const sect, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true)
{
int sectno = *sect? sector.IndexOf(*sect) : -1;
int res = pushmove(vect, &sectno, walldist, ceildist, flordist, cliptype, clear);
*sect = sectno == -1? nullptr : &sector[sectno];
return res;
}
inline void alignceilslope(sectortype* dasect, int32_t x, int32_t y, int32_t z)
{
alignceilslope(sector.IndexOf(dasect), x, y, z);

View file

@ -262,6 +262,7 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput)
void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput)
{
#if 0
spritetype *pSprite = pPlayer->pSprite;
XSPRITE *pXSprite = pPlayer->pXSprite;
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][predict.at48];
@ -353,6 +354,7 @@ void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput)
predict.at72 = 0;
}
}
#endif
}
static void fakeMoveDude(spritetype *pSprite)

View file

@ -5291,10 +5291,10 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
else if (s->zvel > 2048 && s->sector()->lotag != 1)
{
auto j = s->sector();
pushmove(&s->pos, &j, 128, (4 << 8), (4 << 8), CLIPMASK0);
if (j != s->sector() && j != nullptr)
changeactorsect(actor, j);
auto sect = s->sector();
pushmove(&s->pos, &sect, 128, (4 << 8), (4 << 8), CLIPMASK0);
if (sect != s->sector() && sect != nullptr)
changeactorsect(actor, sect);
S_PlayActorSound(thud, actor);
}

View file

@ -282,10 +282,9 @@ void AISet::Tick(RunListEvent* ev)
auto nMov = MoveCreature(pActor);
static_assert(sizeof(pSprite->sectnum) != 4);
int sectnum = pSprite->sectnum;
pushmove(&pSprite->pos, &sectnum, pSprite->clipdist << 2, 5120, -5120, CLIPMASK0);
pSprite->sectnum = sectnum;
auto sect = pSprite->sector();
pushmove(&pSprite->pos, &sect, pSprite->clipdist << 2, 5120, -5120, CLIPMASK0);
pSprite->setsector(sect);
if (pSprite->zvel > 4000)
{