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 20b4d9f762
commit 32d70d6f2b
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