src/video/SDL_surface.c
changeset 7834 e22726c82922
parent 7725 c61ab95113fe
child 7860 2b0bcdea3a79
equal deleted inserted replaced
7833:b4a9cc7085f2 7834:e22726c82922
   594         dy = dstrect->y + h - clip->y - clip->h;
   594         dy = dstrect->y + h - clip->y - clip->h;
   595         if (dy > 0)
   595         if (dy > 0)
   596             h -= dy;
   596             h -= dy;
   597     }
   597     }
   598 
   598 
       
   599     /* Switch back to a fast blit if we were previously stretching */
       
   600     if (src->map->info.flags & SDL_COPY_NEAREST) {
       
   601         src->map->info.flags &= ~SDL_COPY_NEAREST;
       
   602         SDL_InvalidateMap(src->map);
       
   603     }
       
   604 
   599     if (w > 0 && h > 0) {
   605     if (w > 0 && h > 0) {
   600         SDL_Rect sr;
   606         SDL_Rect sr;
   601         sr.x = srcx;
   607         sr.x = srcx;
   602         sr.y = srcy;
   608         sr.y = srcy;
   603         sr.w = dstrect->w = w;
   609         sr.w = dstrect->w = w;
   745     full_rect.h = src->h;
   751     full_rect.h = src->h;
   746     if (!SDL_IntersectRect(&final_src, &full_rect, &final_src)) {
   752     if (!SDL_IntersectRect(&final_src, &full_rect, &final_src)) {
   747         return 0;
   753         return 0;
   748     }
   754     }
   749 
   755 
   750     src->map->info.flags |= SDL_COPY_NEAREST;
   756     if (!(src->map->info.flags & SDL_COPY_NEAREST)) {
       
   757         src->map->info.flags |= SDL_COPY_NEAREST;
       
   758         SDL_InvalidateMap(src->map);
       
   759     }
   751 
   760 
   752     if ( !(src->map->info.flags & complex_copy_flags) &&
   761     if ( !(src->map->info.flags & complex_copy_flags) &&
   753          src->format->format == dst->format->format &&
   762          src->format->format == dst->format->format &&
   754          !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) {
   763          !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) {
   755         return SDL_SoftStretch( src, &final_src, dst, &final_dst );
   764         return SDL_SoftStretch( src, &final_src, dst, &final_dst );