diff --git a/src/v_video.c b/src/v_video.c index 802a4d388a943876d8f398a1523fe69c263a0e6d..0d80dc50e27be4c13f4a86f314eccd39ba3cb131 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -406,22 +406,35 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t colfrac = FixedDiv(FRACUNIT, fdup); rowfrac = FixedDiv(FRACUNIT, fdup); - if (scrn & V_OFFSET) // Crosshair shit + // So it turns out offsets aren't scaled in V_NOSCALESTART unless V_OFFSET is applied ...poo, that's terrible + // For now let's just at least give V_OFFSET the ability to support V_FLIP + // I'll probably make a better fix for 2.2 where I don't have to worry about breaking existing support for stuff + // -- Monster Iestyn 29/10/18 { - y -= FixedMul((SHORT(patch->topoffset)*dupy)<<FRACBITS, pscale); - x -= FixedMul((SHORT(patch->leftoffset)*dupx)<<FRACBITS, pscale); - } - else - { - y -= FixedMul(SHORT(patch->topoffset)<<FRACBITS, pscale); + fixed_t offsetx = 0, offsety = 0; + // left offset if (scrn & V_FLIP) { flip = true; - x -= FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1; + offsetx = FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1; } else - x -= FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); + offsetx = FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); + + // top offset + // TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!? + offsety = FixedMul(SHORT(patch->topoffset)<<FRACBITS, pscale); + + if (scrn & V_OFFSET) // Multiply by dupx/dupy for crosshairs + { + offsetx = FixedMul(offsetx, dupx<<FRACBITS); + offsety = FixedMul(offsety, dupy<<FRACBITS); + } + + // Subtract the offsets from x/y positions + x -= offsetx; + y -= offsety; } if (scrn & V_SPLITSCREEN)