Added PSPF_MIRROR to software renderer.

This commit is contained in:
Major Cooke 2017-06-04 09:59:37 -05:00 committed by Rachael Alexanderson
parent 5d40b2c36c
commit 17fc58f712

View file

@ -240,7 +240,7 @@ namespace swrenderer
if (pspr->Flags & PSPF_ADDBOB) if (pspr->Flags & PSPF_ADDBOB)
{ {
sx += bobx; sx += (pspr->Flags & PSPF_MIRROR) ? -bobx : bobx;
sy += boby; sy += boby;
} }
@ -256,17 +256,18 @@ namespace swrenderer
double pspriteyscale = pspritexscale * viewport->YaspectMul; double pspriteyscale = pspritexscale * viewport->YaspectMul;
double pspritexiscale = 1 / pspritexscale; double pspritexiscale = 1 / pspritexscale;
// calculate edges of the shape int tleft = tex->GetScaledLeftOffset();
tx = sx - BASEXCENTER; 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); x1 = xs_RoundToInt(viewport->CenterX + tx * pspritexscale);
// off the right side // off the right side
if (x1 > viewwidth) if (x1 > viewwidth)
return; return;
tx += tex->GetScaledWidth(); tx += twidth;
x2 = xs_RoundToInt(viewport->CenterX + tx * pspritexscale); x2 = xs_RoundToInt(viewport->CenterX + tx * pspritexscale);
// off the left side // off the left side