equal
deleted
inserted
replaced
682 */ |
682 */ |
683 int |
683 int |
684 SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, |
684 SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, |
685 SDL_Surface * dst, SDL_Rect * dstrect) |
685 SDL_Surface * dst, SDL_Rect * dstrect) |
686 { |
686 { |
|
687 static const Uint32 complex_copy_flags = ( |
|
688 SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | |
|
689 SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | |
|
690 SDL_COPY_COLORKEY |
|
691 ); |
|
692 |
687 /* Save off the original dst width, height */ |
693 /* Save off the original dst width, height */ |
688 int dstW = dstrect->w; |
694 int dstW = dstrect->w; |
689 int dstH = dstrect->h; |
695 int dstH = dstrect->h; |
690 SDL_Rect final_dst = *dstrect; |
696 SDL_Rect final_dst = *dstrect; |
691 SDL_Rect final_src = *srcrect; |
697 SDL_Rect final_src = *srcrect; |
708 /* Clip the src surface to the srcrect */ |
714 /* Clip the src surface to the srcrect */ |
709 SDL_SetClipRect( src, &final_src ); |
715 SDL_SetClipRect( src, &final_src ); |
710 |
716 |
711 src->map->info.flags |= SDL_COPY_NEAREST; |
717 src->map->info.flags |= SDL_COPY_NEAREST; |
712 |
718 |
713 if ( src->format->format == dst->format->format && !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) { |
719 if ( !(src->map->info.flags & complex_copy_flags) && |
|
720 src->format->format == dst->format->format && |
|
721 !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) { |
714 return SDL_SoftStretch( src, &final_src, dst, &final_dst ); |
722 return SDL_SoftStretch( src, &final_src, dst, &final_dst ); |
715 } else { |
723 } else { |
716 return SDL_LowerBlit( src, &final_src, dst, &final_dst ); |
724 return SDL_LowerBlit( src, &final_src, dst, &final_dst ); |
717 } |
725 } |
718 } |
726 } |