mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-06 09:56:26 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user