mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- Fix pixel center sampling bug in SWCanvas::DrawTexture
This commit is contained in:
parent
c56cd245ac
commit
3ff021608d
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue