destend now scales the added-on patch width properly if needed

This commit is contained in:
Monster Iestyn 2016-03-25 19:43:17 +00:00
parent c63b746714
commit 76d71bda92
1 changed files with 10 additions and 1 deletions

View File

@ -477,7 +477,16 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
}
deststart = desttop;
destend = desttop + SHORT(patch->width) * dupx;
if (pscale != FRACUNIT) // scale width properly
{
fixed_t pwidth = SHORT(patch->width)<<FRACBITS;
pwidth = FixedMul(pwidth, pscale);
pwidth = FixedMul(pwidth, dupx<<FRACBITS);
pwidth >>= FRACBITS;
destend = desttop + pwidth;
}
else
destend = desttop + SHORT(patch->width) * dupx;
for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++x, desttop++)
{