diff --git a/src/r_things.c b/src/r_things.c index 8e67880e47d7438de4f4b026ec8ad24f22fec0ed..34104bc41ae848cc01d71a1e3dce3815bceeb6ef 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1956,6 +1956,8 @@ static void R_ProjectSprite(mobj_t *thing) if (spritexscale < 1 || spriteyscale < 1) return; + SINT8 hflipoffset = 1; + SINT8 vflipoffset = 1; if (thing->renderflags & RF_ABSOLUTEOFFSETS) { spr_offset = interp.spritexoffset; @@ -1963,19 +1965,19 @@ static void R_ProjectSprite(mobj_t *thing) } else { - SINT8 flipoffset = 1; + if (!(thing->renderflags & RF_FLIPOFFSETS) && flip) + hflipoffset = -1; + if (!(thing->renderflags & RF_FLIPOFFSETS) && R_ThingVerticallyFlipped(thing)) + vflipoffset = -1; - if ((thing->renderflags & RF_FLIPOFFSETS) && flip) - flipoffset = -1; - - spr_offset += interp.spritexoffset * flipoffset; - spr_topoffset += interp.spriteyoffset * flipoffset; + spr_offset += interp.spritexoffset * hflipoffset; + spr_topoffset += interp.spriteyoffset * vflipoffset; } #ifdef ROTSPRITE // let spriteinfo offset by units less than a pixel - spr_offset += (fixed_t)sprinfo->offset[thing->frame&FF_FRAMEMASK].x; - spr_topoffset += (fixed_t)sprinfo->offset[thing->frame&FF_FRAMEMASK].y; + spr_offset += (fixed_t)sprinfo->offset[thing->frame&FF_FRAMEMASK].x * hflipoffset; + spr_topoffset += (fixed_t)sprinfo->offset[thing->frame&FF_FRAMEMASK].y * vflipoffset; #endif if (flip)