From 17fc58f71248d019cc07882c2916774cff87222c Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 4 Jun 2017 09:59:37 -0500 Subject: [PATCH] Added PSPF_MIRROR to software renderer. --- src/swrenderer/things/r_playersprite.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 9fd4a44e29..e67f5d761b 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -240,7 +240,7 @@ namespace swrenderer if (pspr->Flags & PSPF_ADDBOB) { - sx += bobx; + sx += (pspr->Flags & PSPF_MIRROR) ? -bobx : bobx; sy += boby; } @@ -256,17 +256,18 @@ namespace swrenderer double pspriteyscale = pspritexscale * viewport->YaspectMul; double pspritexiscale = 1 / pspritexscale; - // calculate edges of the shape - tx = sx - BASEXCENTER; + int tleft = tex->GetScaledLeftOffset(); + int twidth = tex->GetScaledWidth(); - tx -= tex->GetScaledLeftOffset(); + // calculate edges of the shape + tx = (pspr->Flags & PSPF_MIRROR) ? ((BASEXCENTER - twidth) - (sx - tleft)) : ((sx - BASEXCENTER) - tleft); x1 = xs_RoundToInt(viewport->CenterX + tx * pspritexscale); // off the right side if (x1 > viewwidth) return; - tx += tex->GetScaledWidth(); + tx += twidth; x2 = xs_RoundToInt(viewport->CenterX + tx * pspritexscale); // off the left side