diff --git a/src/swrenderer/r_swcanvas.cpp b/src/swrenderer/r_swcanvas.cpp index 88c0a6b29..0330d4d6e 100644 --- a/src/swrenderer/r_swcanvas.cpp +++ b/src/swrenderer/r_swcanvas.cpp @@ -128,7 +128,7 @@ void SWCanvas::DrawTexture(DCanvas *canvas, FTexture *img, DrawParms &parms) // There is not enough precision in the drawing routines to keep the full // precision for y0. :( double sprtopscreen; - modf(y0, &sprtopscreen); + modf(y0 + 0.5, &sprtopscreen); double yscale = parms.destheight / img->GetHeight(); double iyscale = 1 / yscale; @@ -192,6 +192,8 @@ void SWCanvas::DrawTexture(DCanvas *canvas, FTexture *img, DrawParms &parms) int x2_i = int(x2); fixed_t xiscale_i = FLOAT2FIXED(xiscale); + frac += xiscale_i / 2; + while (x < x2_i) { drawerargs.DrawMaskedColumn(&thread, x, iscale, img, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, !parms.masked);