mirror of https://github.com/ZDoom/gzdoom-gles.git
- Fix pixel center sampling bug in SWCanvas::DrawTexture
This commit is contained in:
parent
c56cd245ac
commit
3ff021608d
|
@ -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
|
// There is not enough precision in the drawing routines to keep the full
|
||||||
// precision for y0. :(
|
// precision for y0. :(
|
||||||
double sprtopscreen;
|
double sprtopscreen;
|
||||||
modf(y0, &sprtopscreen);
|
modf(y0 + 0.5, &sprtopscreen);
|
||||||
|
|
||||||
double yscale = parms.destheight / img->GetHeight();
|
double yscale = parms.destheight / img->GetHeight();
|
||||||
double iyscale = 1 / yscale;
|
double iyscale = 1 / yscale;
|
||||||
|
@ -192,6 +192,8 @@ void SWCanvas::DrawTexture(DCanvas *canvas, FTexture *img, DrawParms &parms)
|
||||||
int x2_i = int(x2);
|
int x2_i = int(x2);
|
||||||
fixed_t xiscale_i = FLOAT2FIXED(xiscale);
|
fixed_t xiscale_i = FLOAT2FIXED(xiscale);
|
||||||
|
|
||||||
|
frac += xiscale_i / 2;
|
||||||
|
|
||||||
while (x < x2_i)
|
while (x < x2_i)
|
||||||
{
|
{
|
||||||
drawerargs.DrawMaskedColumn(&thread, x, iscale, img, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, !parms.masked);
|
drawerargs.DrawMaskedColumn(&thread, x, iscale, img, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, !parms.masked);
|
||||||
|
|
Loading…
Reference in New Issue