From 1ef8df0a4cc28fc19bbfebaaef3dbf1f8d1fe93d Mon Sep 17 00:00:00 2001 From: nukeykt Date: Sat, 4 Apr 2020 14:27:53 +0900 Subject: [PATCH] Blood: Fix model yoffset --- source/blood/src/view.cpp | 12 ++++++++++++ source/build/src/mdsprite.cpp | 2 ++ 2 files changed, 14 insertions(+) diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 5534811eb..c279fa08b 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -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 = §or[pTSprite->sectnum]; XSECTOR *pXSector; int nShade = pTSprite->shade; diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index bf4e5db8c..a97932bbc 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -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);