From 70a9f5b97ee9fb499576e502c52b465d76343b24 Mon Sep 17 00:00:00 2001 From: avolkov Date: Fri, 18 Jul 2003 17:46:35 +0000 Subject: [PATCH] bilinear scaling fix (post optimization) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1066 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/2xscalers.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/2xscalers.c b/sc2/src/sc2code/libs/graphics/sdl/2xscalers.c index 99f4be59b..fd54b0ba6 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/2xscalers.c +++ b/sc2/src/sc2code/libs/graphics/sdl/2xscalers.c @@ -2510,16 +2510,16 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) for (y = region->y; y < yend; ++y, dst_p += ddst, src_p += dsrc) { p[0] = src_p[0]; - if (y < h - 2) + if (y < h - 1) p[2] = src_p[src->w]; else p[2] = 0; for (x = region->x; x < xend; ++x, ++src_p) { - if (y < h - 2) + if (y < h - 1) { - if (x < w - 2) + if (x < w - 1) { p[1] = src_p[1]; p[3] = src_p[src->w + 1]; @@ -2532,7 +2532,7 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) } else { - if (x < w - 2) + if (x < w - 1) p[1] = src_p[1]; else p[1] = 0; @@ -2578,16 +2578,16 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) for (y = region->y; y < yend; ++y, dst_p += ddst, src_p += dsrc) { p[0] = GET_PIX_24BIT (src_p); - if (y < h - 2) + if (y < h - 1) p[2] = GET_PIX_24BIT (src_p + src->w); else p[2] = 0; for (x = region->x; x < xend; ++x, ++src_p) { - if (y < h - 2) + if (y < h - 1) { - if (x < w - 2) + if (x < w - 1) { p[1] = GET_PIX_24BIT (src_p + 1); p[3] = GET_PIX_24BIT (src_p + src->w + 1); @@ -2600,7 +2600,7 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) } else { - if (x < w - 2) + if (x < w - 1) p[1] = GET_PIX_24BIT (src_p + 1); else p[1] = 0; @@ -2646,16 +2646,16 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) for (y = region->y; y < yend; ++y, dst_p += ddst, src_p += dsrc) { p[0] = src_p[0]; - if (y < h - 2) + if (y < h - 1) p[2] = src_p[src->w]; else p[2] = 0; for (x = region->x; x < xend; ++x, ++src_p) { - if (y < h - 2) + if (y < h - 1) { - if (x < w - 2) + if (x < w - 1) { p[1] = src_p[1]; p[3] = src_p[src->w + 1]; @@ -2668,7 +2668,7 @@ void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst, SDL_Rect *r) } else { - if (x < w - 2) + if (x < w - 1) p[1] = src_p[1]; else p[1] = 0;