Software nearest scaling: start at the middle of pixel

so that it matches opengl GL_NEAREST mode most of the time
This commit is contained in:
Sylvain
2021-03-04 14:33:56 +01:00
parent ac8a3fda8f
commit ab0cf42a4b
3 changed files with 6 additions and 6 deletions

View File

@@ -857,13 +857,13 @@ SDL_LowerSoftStretchLinear(SDL_Surface *s, const SDL_Rect *srcrect,
incy = (src_h << 16) / dst_h; \
incx = (src_w << 16) / dst_w; \
dst_gap = dst_pitch - bpp * dst_w; \
posy = 0; \
posy = incy / 2; \
#define SDL_SCALE_NEAREST__HEIGHT \
srcy = (posy >> 16); \
src_h0 = (const Uint32 *)((const Uint8 *)src_ptr + srcy * src_pitch); \
posy += incy; \
posx = 0; \
posx = incx / 2; \
n = dst_w;