Blood: Fix model yoffset

This commit is contained in:
nukeykt 2020-04-04 14:27:53 +09:00 committed by Christoph Oelckers
parent f1f9fcff5c
commit 1ef8df0a4c
2 changed files with 14 additions and 0 deletions

View file

@ -2416,6 +2416,18 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
pTSprite->ang = (pTSprite->ang+((int)totalclock<<3))&2047;
}
if ((pTSprite->cstat&48) != 48 && usemodels && !(spriteext[nSprite].flags&SPREXT_NOTMD))
{
int nAnimTile = pTSprite->picnum + animateoffs_replace(pTSprite->picnum, 32768+pTSprite->owner);
if (usemodels && tile2model[Ptile2tile(nAnimTile, pTSprite->pal)].modelid >= 0 &&
tile2model[Ptile2tile(nAnimTile, pTSprite->pal)].framenum >= 0)
{
pTSprite->yoffset += picanm[nAnimTile].yofs;
pTSprite->xoffset += picanm[nAnimTile].xofs;
}
}
sectortype *pSector = &sector[pTSprite->sectnum];
XSECTOR *pXSector;
int nShade = pTSprite->shade;

View file

@ -1527,6 +1527,8 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
// Parkar: Moved up to be able to use k0 for the y-flipping code
k0 = (float)tspr->z+spriteext[tspr->owner].position_offset.z;
f = ((globalorientation&8) && (sprite[tspr->owner].cstat&48)!=0) ? -4.f : 4.f;
k0 -= (tspr->yoffset*tspr->yrepeat)*f;
if ((globalorientation&128) && !((globalorientation&48)==32))
k0 += (float)(sizyrep<<1);