mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Properly consider sprites with a clipshape as bridge (p->spritebridge).
git-svn-id: https://svn.eduke32.com/eduke32@4574 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9969efd8d1
commit
ceaa661304
3 changed files with 29 additions and 26 deletions
|
@ -1231,6 +1231,8 @@ static inline int32_t E_SpriteIsValid(const int32_t i)
|
|||
return ((unsigned)i < MAXSPRITES && sprite[i].statnum != MAXSTATUS);
|
||||
}
|
||||
|
||||
int32_t clipshape_idx_for_sprite(spritetype *curspr, int32_t curidx);
|
||||
|
||||
void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
int32_t sectorofwall(int16_t theline);
|
||||
|
|
|
@ -1802,7 +1802,28 @@ int32_t clipmapinfo_load(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int32_t clipshape_idx_for_sprite(spritetype *curspr, int32_t curidx)
|
||||
{
|
||||
if (curidx < 0) // per-sprite init
|
||||
curidx = pictoidx[curspr->picnum];
|
||||
else
|
||||
curidx = clipinfo[curidx].next;
|
||||
|
||||
while (curidx>=0 && (curspr->cstat&32) != (sector[sectq[clipinfo[curidx].qbeg]].CM_CSTAT&32))
|
||||
curidx = clipinfo[curidx].next;
|
||||
|
||||
return curidx;
|
||||
}
|
||||
#else
|
||||
int32_t clipshape_idx_for_sprite(spritetype *curspr, int32_t curidx)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(curspr);
|
||||
UNREFERENCED_PARAMETER(curidx);
|
||||
return -1;
|
||||
}
|
||||
#endif // HAVE_CLIPSHAPE_FEATURE
|
||||
////// //////
|
||||
|
||||
#define WALLS_ARE_CONSISTENT(k) ((wall[k].x == x2 && wall[k].y == y2) \
|
||||
|
@ -12552,14 +12573,7 @@ restart_grand:
|
|||
mapinfo_set(&origmapinfo, &clipmapinfo); // replace sector and wall with clip map
|
||||
|
||||
curspr = &sprite[clipspritelist[clipspritecnt]];
|
||||
|
||||
if (curidx < 0) // per-sprite init
|
||||
curidx = pictoidx[curspr->picnum];
|
||||
else
|
||||
curidx = clipinfo[curidx].next;
|
||||
|
||||
while (curidx>=0 && (curspr->cstat&32) != (sector[sectq[clipinfo[curidx].qbeg]].CM_CSTAT&32))
|
||||
curidx = clipinfo[curidx].next;
|
||||
curidx = clipshape_idx_for_sprite(curspr, curidx);
|
||||
|
||||
if (curidx < 0)
|
||||
{
|
||||
|
@ -13372,14 +13386,7 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum,
|
|||
}
|
||||
|
||||
curspr = &sprite[clipspritelist[clipspritecnt]];
|
||||
|
||||
if (curidx < 0) // per-sprite init
|
||||
curidx = pictoidx[curspr->picnum];
|
||||
else
|
||||
curidx = clipinfo[curidx].next;
|
||||
|
||||
while (curidx>=0 && (curspr->cstat&32) != (sector[sectq[clipinfo[curidx].qbeg]].CM_CSTAT&32))
|
||||
curidx = clipinfo[curidx].next;
|
||||
curidx = clipshape_idx_for_sprite(curspr, curidx);
|
||||
|
||||
if (curidx < 0)
|
||||
{
|
||||
|
@ -14265,14 +14272,7 @@ restart_grand:
|
|||
// one set of clip-sprite sectors completed, prepare the next
|
||||
|
||||
curspr = &sprite[clipspritelist[clipspritecnt]];
|
||||
|
||||
if (curidx < 0) // per-sprite init
|
||||
curidx = pictoidx[curspr->picnum];
|
||||
else
|
||||
curidx = clipinfo[curidx].next;
|
||||
|
||||
while (curidx>=0 && (curspr->cstat&32) != (sector[sectq[clipinfo[curidx].qbeg]].CM_CSTAT&32))
|
||||
curidx = clipinfo[curidx].next;
|
||||
curidx = clipshape_idx_for_sprite(curspr, curidx);
|
||||
|
||||
if (curidx < 0)
|
||||
{
|
||||
|
|
|
@ -4328,7 +4328,8 @@ void P_ProcessInput(int32_t snum)
|
|||
{
|
||||
j = lz&(MAXSPRITES-1);
|
||||
|
||||
if ((sprite[j].cstat&33) == 33 || (sprite[j].cstat&17) == 17)
|
||||
if ((sprite[j].cstat&33) == 33 || (sprite[j].cstat&17) == 17 ||
|
||||
clipshape_idx_for_sprite(&sprite[j], -1) >= 0)
|
||||
{
|
||||
if ((sprite[j].xvel&1) == 0) // EDuke32 extension
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue