diff -r f061a86fbb08 src/render/software/SDL_render_sw.c --- a/src/render/software/SDL_render_sw.c Sun Jul 13 09:04:55 2014 -0700 +++ b/src/render/software/SDL_render_sw.c Mon Jul 14 01:39:27 2014 +0300 @@ -578,6 +578,7 @@ SDL_Surface *src = (SDL_Surface *) texture->driverdata; SDL_Rect final_rect, tmp_rect; SDL_Surface *surface_rotated, *surface_scaled; + SDL_BlendMode texblendmode; Uint32 colorkey; int retval, dstwidth, dstheight, abscenterx, abscentery; double cangle, sangle, px, py, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y; @@ -606,7 +607,13 @@ tmp_rect.x = 0; tmp_rect.y = 0; + /* reset the texture blend mode for the duration of the scaled blit */ + SDL_GetSurfaceBlendMode(src, &texblendmode); + SDL_SetSurfaceBlendMode(src, SDL_BLENDMODE_NONE); retval = SDL_BlitScaled(src, srcrect, surface_scaled, &tmp_rect); + /* restore it */ + SDL_SetSurfaceBlendMode(src, texblendmode); + if (!retval) { SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, -angle, &dstwidth, &dstheight, &cangle, &sangle); surface_rotated = SDLgfx_rotateSurface(surface_scaled, -angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle); @@ -646,7 +653,13 @@ tmp_rect.w = dstwidth; tmp_rect.h = dstheight; - retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect); + /* set the appropriate blend mode for the rotated blit */ + SDL_SetSurfaceBlendMode(surface_rotated, texblendmode); + if (surface->w != surface_rotated->w || surface->h != surface_rotated->h) { + retval = SDL_BlitScaled(surface_rotated, NULL, surface, &tmp_rect); + } else { + retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect); + } SDL_FreeSurface(surface_scaled); SDL_FreeSurface(surface_rotated); return retval;