now that V_FLIP's effects are always supported in V_DrawFixedPatch, there's no need for the "flip" variable anymore

This commit is contained in:
Monster Iestyn 2018-10-30 14:22:21 +00:00
parent 2fa0896fd0
commit 22e8dd1f9d
1 changed files with 2 additions and 6 deletions

View File

@ -331,7 +331,6 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
{ {
UINT8 (*patchdrawfunc)(const UINT8*, const UINT8*, fixed_t); UINT8 (*patchdrawfunc)(const UINT8*, const UINT8*, fixed_t);
UINT32 alphalevel = 0; UINT32 alphalevel = 0;
boolean flip = false;
fixed_t col, ofs, colfrac, rowfrac, fdup; fixed_t col, ofs, colfrac, rowfrac, fdup;
INT32 dupx, dupy; INT32 dupx, dupy;
@ -415,10 +414,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
// left offset // left offset
if (scrn & V_FLIP) if (scrn & V_FLIP)
{
flip = true;
offsetx = FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1; offsetx = FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1;
}
else else
offsetx = FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); offsetx = FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale);
@ -510,7 +506,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++) for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++)
{ {
INT32 topdelta, prevdelta = -1; INT32 topdelta, prevdelta = -1;
if (flip) // offx is measured from right edge instead of left if (scrn & V_FLIP) // offx is measured from right edge instead of left
{ {
if (x+pwidth-offx < 0) // don't draw off the left of the screen (WRAP PREVENTION) if (x+pwidth-offx < 0) // don't draw off the left of the screen (WRAP PREVENTION)
break; break;
@ -534,7 +530,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
prevdelta = topdelta; prevdelta = topdelta;
source = (const UINT8 *)(column) + 3; source = (const UINT8 *)(column) + 3;
dest = desttop; dest = desttop;
if (flip) if (scrn & V_FLIP)
dest = deststart + (destend - desttop); dest = deststart + (destend - desttop);
dest += FixedInt(FixedMul(topdelta<<FRACBITS,fdup))*vid.width; dest += FixedInt(FixedMul(topdelta<<FRACBITS,fdup))*vid.width;