Software scaling support. Not very fast, but it seems to work.

This commit is contained in:
Ken Rogoway
2011-02-14 11:50:18 -06:00
parent e66826bbdf
commit 8c8191deef
3 changed files with 62 additions and 1 deletions

View File

@@ -364,7 +364,12 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
if (!surface) {
return -1;
}
return SDL_BlitSurface(src, srcrect, surface, &final_rect);
if ( srcrect->w == final_rect.w && srcrect->h == final_rect.h ) {
return SDL_BlitSurface(src, srcrect, surface, &final_rect);
} else {
return SDL_BlitScaled(src, srcrect, surface, &final_rect);
}
}
static int