src/video/SDL_blit.c
changeset 1895 c121d94672cb
parent 1402 d910939febfa
child 2247 93994f65c74c
     1.1 --- a/src/video/SDL_blit.c	Thu Jul 06 18:01:37 2006 +0000
     1.2 +++ b/src/video/SDL_blit.c	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -37,316 +37,258 @@
     1.4  #endif
     1.5  
     1.6  /* The general purpose software blit routine */
     1.7 -static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect,
     1.8 -			SDL_Surface *dst, SDL_Rect *dstrect)
     1.9 +static int
    1.10 +SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect,
    1.11 +             SDL_Surface * dst, SDL_Rect * dstrect)
    1.12  {
    1.13 -	int okay;
    1.14 -	int src_locked;
    1.15 -	int dst_locked;
    1.16 +    int okay;
    1.17 +    int src_locked;
    1.18 +    int dst_locked;
    1.19  
    1.20 -	/* Everything is okay at the beginning...  */
    1.21 -	okay = 1;
    1.22 +    /* Everything is okay at the beginning...  */
    1.23 +    okay = 1;
    1.24  
    1.25 -	/* Lock the destination if it's in hardware */
    1.26 -	dst_locked = 0;
    1.27 -	if ( SDL_MUSTLOCK(dst) ) {
    1.28 -		if ( SDL_LockSurface(dst) < 0 ) {
    1.29 -			okay = 0;
    1.30 -		} else {
    1.31 -			dst_locked = 1;
    1.32 -		}
    1.33 -	}
    1.34 -	/* Lock the source if it's in hardware */
    1.35 -	src_locked = 0;
    1.36 -	if ( SDL_MUSTLOCK(src) ) {
    1.37 -		if ( SDL_LockSurface(src) < 0 ) {
    1.38 -			okay = 0;
    1.39 -		} else {
    1.40 -			src_locked = 1;
    1.41 -		}
    1.42 -	}
    1.43 +    /* Lock the destination if it's in hardware */
    1.44 +    dst_locked = 0;
    1.45 +    if (SDL_MUSTLOCK(dst)) {
    1.46 +        if (SDL_LockSurface(dst) < 0) {
    1.47 +            okay = 0;
    1.48 +        } else {
    1.49 +            dst_locked = 1;
    1.50 +        }
    1.51 +    }
    1.52 +    /* Lock the source if it's in hardware */
    1.53 +    src_locked = 0;
    1.54 +    if (SDL_MUSTLOCK(src)) {
    1.55 +        if (SDL_LockSurface(src) < 0) {
    1.56 +            okay = 0;
    1.57 +        } else {
    1.58 +            src_locked = 1;
    1.59 +        }
    1.60 +    }
    1.61  
    1.62 -	/* Set up source and destination buffer pointers, and BLIT! */
    1.63 -	if ( okay  && srcrect->w && srcrect->h ) {
    1.64 -		SDL_BlitInfo info;
    1.65 -		SDL_loblit RunBlit;
    1.66 +    /* Set up source and destination buffer pointers, and BLIT! */
    1.67 +    if (okay && srcrect->w && srcrect->h) {
    1.68 +        SDL_BlitInfo info;
    1.69 +        SDL_loblit RunBlit;
    1.70  
    1.71 -		/* Set up the blit information */
    1.72 -		info.s_pixels = (Uint8 *)src->pixels +
    1.73 -				(Uint16)srcrect->y*src->pitch +
    1.74 -				(Uint16)srcrect->x*src->format->BytesPerPixel;
    1.75 -		info.s_width = srcrect->w;
    1.76 -		info.s_height = srcrect->h;
    1.77 -		info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
    1.78 -		info.d_pixels = (Uint8 *)dst->pixels +
    1.79 -				(Uint16)dstrect->y*dst->pitch +
    1.80 -				(Uint16)dstrect->x*dst->format->BytesPerPixel;
    1.81 -		info.d_width = dstrect->w;
    1.82 -		info.d_height = dstrect->h;
    1.83 -		info.d_skip=dst->pitch-info.d_width*dst->format->BytesPerPixel;
    1.84 -		info.aux_data = src->map->sw_data->aux_data;
    1.85 -		info.src = src->format;
    1.86 -		info.table = src->map->table;
    1.87 -		info.dst = dst->format;
    1.88 -		RunBlit = src->map->sw_data->blit;
    1.89 +        /* Set up the blit information */
    1.90 +        info.s_pixels = (Uint8 *) src->pixels +
    1.91 +            (Uint16) srcrect->y * src->pitch +
    1.92 +            (Uint16) srcrect->x * src->format->BytesPerPixel;
    1.93 +        info.s_width = srcrect->w;
    1.94 +        info.s_height = srcrect->h;
    1.95 +        info.s_skip = src->pitch - info.s_width * src->format->BytesPerPixel;
    1.96 +        info.d_pixels = (Uint8 *) dst->pixels +
    1.97 +            (Uint16) dstrect->y * dst->pitch +
    1.98 +            (Uint16) dstrect->x * dst->format->BytesPerPixel;
    1.99 +        info.d_width = dstrect->w;
   1.100 +        info.d_height = dstrect->h;
   1.101 +        info.d_skip = dst->pitch - info.d_width * dst->format->BytesPerPixel;
   1.102 +        info.aux_data = src->map->sw_data->aux_data;
   1.103 +        info.src = src->format;
   1.104 +        info.table = src->map->table;
   1.105 +        info.dst = dst->format;
   1.106 +        RunBlit = src->map->sw_data->blit;
   1.107  
   1.108 -		/* Run the actual software blit */
   1.109 -		RunBlit(&info);
   1.110 -	}
   1.111 +        /* Run the actual software blit */
   1.112 +        RunBlit(&info);
   1.113 +    }
   1.114  
   1.115 -	/* We need to unlock the surfaces if they're locked */
   1.116 -	if ( dst_locked ) {
   1.117 -		SDL_UnlockSurface(dst);
   1.118 -	}
   1.119 -	if ( src_locked ) {
   1.120 -		SDL_UnlockSurface(src);
   1.121 -	}
   1.122 -	/* Blit is done! */
   1.123 -	return(okay ? 0 : -1);
   1.124 +    /* We need to unlock the surfaces if they're locked */
   1.125 +    if (dst_locked) {
   1.126 +        SDL_UnlockSurface(dst);
   1.127 +    }
   1.128 +    if (src_locked) {
   1.129 +        SDL_UnlockSurface(src);
   1.130 +    }
   1.131 +    /* Blit is done! */
   1.132 +    return (okay ? 0 : -1);
   1.133  }
   1.134  
   1.135  #ifdef MMX_ASMBLIT
   1.136 -static __inline__ void SDL_memcpyMMX(Uint8 *to, const Uint8 *from, int len)
   1.137 +static __inline__ void
   1.138 +SDL_memcpyMMX(Uint8 * to, const Uint8 * from, int len)
   1.139  {
   1.140 -	int i;
   1.141 +    int i;
   1.142  
   1.143 -	for(i=0; i<len/8; i++) {
   1.144 -		__asm__ __volatile__ (
   1.145 -		"	movq (%0), %%mm0\n"
   1.146 -		"	movq %%mm0, (%1)\n"
   1.147 -		: : "r" (from), "r" (to) : "memory");
   1.148 -		from+=8;
   1.149 -		to+=8;
   1.150 -	}
   1.151 -	if (len&7)
   1.152 -		SDL_memcpy(to, from, len&7);
   1.153 +    for (i = 0; i < len / 8; i++) {
   1.154 +        __asm__ __volatile__("	movq (%0), %%mm0\n"
   1.155 +                             "	movq %%mm0, (%1)\n"::"r"(from),
   1.156 +                             "r"(to):"memory");
   1.157 +        from += 8;
   1.158 +        to += 8;
   1.159 +    }
   1.160 +    if (len & 7)
   1.161 +        SDL_memcpy(to, from, len & 7);
   1.162  }
   1.163  
   1.164 -static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len)
   1.165 +static __inline__ void
   1.166 +SDL_memcpySSE(Uint8 * to, const Uint8 * from, int len)
   1.167  {
   1.168 -	int i;
   1.169 +    int i;
   1.170  
   1.171 -	__asm__ __volatile__ (
   1.172 -	"	prefetchnta (%0)\n"
   1.173 -	"	prefetchnta 64(%0)\n"
   1.174 -	"	prefetchnta 128(%0)\n"
   1.175 -	"	prefetchnta 192(%0)\n"
   1.176 -	: : "r" (from) );
   1.177 +    __asm__ __volatile__("	prefetchnta (%0)\n"
   1.178 +                         "	prefetchnta 64(%0)\n"
   1.179 +                         "	prefetchnta 128(%0)\n"
   1.180 +                         "	prefetchnta 192(%0)\n"::"r"(from));
   1.181  
   1.182 -	for(i=0; i<len/8; i++) {
   1.183 -		__asm__ __volatile__ (
   1.184 -		"	prefetchnta 256(%0)\n"
   1.185 -		"	movq (%0), %%mm0\n"
   1.186 -		"	movntq %%mm0, (%1)\n"
   1.187 -		: : "r" (from), "r" (to) : "memory");
   1.188 -		from+=8;
   1.189 -		to+=8;
   1.190 -	}
   1.191 -	if (len&7)
   1.192 -		SDL_memcpy(to, from, len&7);
   1.193 +    for (i = 0; i < len / 8; i++) {
   1.194 +        __asm__ __volatile__("	prefetchnta 256(%0)\n"
   1.195 +                             "	movq (%0), %%mm0\n"
   1.196 +                             "	movntq %%mm0, (%1)\n"::"r"(from),
   1.197 +                             "r"(to):"memory");
   1.198 +        from += 8;
   1.199 +        to += 8;
   1.200 +    }
   1.201 +    if (len & 7)
   1.202 +        SDL_memcpy(to, from, len & 7);
   1.203  }
   1.204  #endif
   1.205  
   1.206 -static void SDL_BlitCopy(SDL_BlitInfo *info)
   1.207 +static void
   1.208 +SDL_BlitCopy(SDL_BlitInfo * info)
   1.209  {
   1.210 -	Uint8 *src, *dst;
   1.211 -	int w, h;
   1.212 -	int srcskip, dstskip;
   1.213 +    Uint8 *src, *dst;
   1.214 +    int w, h;
   1.215 +    int srcskip, dstskip;
   1.216  
   1.217 -	w = info->d_width*info->dst->BytesPerPixel;
   1.218 -	h = info->d_height;
   1.219 -	src = info->s_pixels;
   1.220 -	dst = info->d_pixels;
   1.221 -	srcskip = w+info->s_skip;
   1.222 -	dstskip = w+info->d_skip;
   1.223 +    w = info->d_width * info->dst->BytesPerPixel;
   1.224 +    h = info->d_height;
   1.225 +    src = info->s_pixels;
   1.226 +    dst = info->d_pixels;
   1.227 +    srcskip = w + info->s_skip;
   1.228 +    dstskip = w + info->d_skip;
   1.229  #ifdef MMX_ASMBLIT
   1.230 -	if(SDL_HasSSE())
   1.231 -	{
   1.232 -		while ( h-- ) {
   1.233 -			SDL_memcpySSE(dst, src, w);
   1.234 -			src += srcskip;
   1.235 -			dst += dstskip;
   1.236 -		}
   1.237 -		__asm__ __volatile__ (
   1.238 -		"	emms\n"
   1.239 -		::);
   1.240 -	}
   1.241 -	else
   1.242 -	if(SDL_HasMMX())
   1.243 -	{
   1.244 -		while ( h-- ) {
   1.245 -			SDL_memcpyMMX(dst, src, w);
   1.246 -			src += srcskip;
   1.247 -			dst += dstskip;
   1.248 -		}
   1.249 -		__asm__ __volatile__ (
   1.250 -		"	emms\n"
   1.251 -		::);
   1.252 -	}
   1.253 -	else
   1.254 +    if (SDL_HasSSE()) {
   1.255 +        while (h--) {
   1.256 +            SDL_memcpySSE(dst, src, w);
   1.257 +            src += srcskip;
   1.258 +            dst += dstskip;
   1.259 +        }
   1.260 +        __asm__ __volatile__("	emms\n"::);
   1.261 +    } else if (SDL_HasMMX()) {
   1.262 +        while (h--) {
   1.263 +            SDL_memcpyMMX(dst, src, w);
   1.264 +            src += srcskip;
   1.265 +            dst += dstskip;
   1.266 +        }
   1.267 +        __asm__ __volatile__("	emms\n"::);
   1.268 +    } else
   1.269  #endif
   1.270 -	while ( h-- ) {
   1.271 -		SDL_memcpy(dst, src, w);
   1.272 -		src += srcskip;
   1.273 -		dst += dstskip;
   1.274 -	}
   1.275 +        while (h--) {
   1.276 +            SDL_memcpy(dst, src, w);
   1.277 +            src += srcskip;
   1.278 +            dst += dstskip;
   1.279 +        }
   1.280  }
   1.281  
   1.282 -static void SDL_BlitCopyOverlap(SDL_BlitInfo *info)
   1.283 +static void
   1.284 +SDL_BlitCopyOverlap(SDL_BlitInfo * info)
   1.285  {
   1.286 -	Uint8 *src, *dst;
   1.287 -	int w, h;
   1.288 -	int srcskip, dstskip;
   1.289 +    Uint8 *src, *dst;
   1.290 +    int w, h;
   1.291 +    int srcskip, dstskip;
   1.292  
   1.293 -	w = info->d_width*info->dst->BytesPerPixel;
   1.294 -	h = info->d_height;
   1.295 -	src = info->s_pixels;
   1.296 -	dst = info->d_pixels;
   1.297 -	srcskip = w+info->s_skip;
   1.298 -	dstskip = w+info->d_skip;
   1.299 -	if ( dst < src ) {
   1.300 -		while ( h-- ) {
   1.301 -			SDL_memcpy(dst, src, w);
   1.302 -			src += srcskip;
   1.303 -			dst += dstskip;
   1.304 -		}
   1.305 -	} else {
   1.306 -		src += ((h-1) * srcskip);
   1.307 -		dst += ((h-1) * dstskip);
   1.308 -		while ( h-- ) {
   1.309 -			SDL_revcpy(dst, src, w);
   1.310 -			src -= srcskip;
   1.311 -			dst -= dstskip;
   1.312 -		}
   1.313 -	}
   1.314 +    w = info->d_width * info->dst->BytesPerPixel;
   1.315 +    h = info->d_height;
   1.316 +    src = info->s_pixels;
   1.317 +    dst = info->d_pixels;
   1.318 +    srcskip = w + info->s_skip;
   1.319 +    dstskip = w + info->d_skip;
   1.320 +    if (dst < src) {
   1.321 +        while (h--) {
   1.322 +            SDL_memcpy(dst, src, w);
   1.323 +            src += srcskip;
   1.324 +            dst += dstskip;
   1.325 +        }
   1.326 +    } else {
   1.327 +        src += ((h - 1) * srcskip);
   1.328 +        dst += ((h - 1) * dstskip);
   1.329 +        while (h--) {
   1.330 +            SDL_revcpy(dst, src, w);
   1.331 +            src -= srcskip;
   1.332 +            dst -= dstskip;
   1.333 +        }
   1.334 +    }
   1.335  }
   1.336  
   1.337  /* Figure out which of many blit routines to set up on a surface */
   1.338 -int SDL_CalculateBlit(SDL_Surface *surface)
   1.339 +int
   1.340 +SDL_CalculateBlit(SDL_Surface * surface)
   1.341  {
   1.342 -	int blit_index;
   1.343 +    int blit_index;
   1.344  
   1.345 -	/* Clean everything out to start */
   1.346 -	if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
   1.347 -		SDL_UnRLESurface(surface, 1);
   1.348 -	}
   1.349 -	surface->map->sw_blit = NULL;
   1.350 +    /* Clean everything out to start */
   1.351 +    if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
   1.352 +        SDL_UnRLESurface(surface, 1);
   1.353 +    }
   1.354 +    surface->map->sw_blit = NULL;
   1.355  
   1.356 -	/* Figure out if an accelerated hardware blit is possible */
   1.357 -	surface->flags &= ~SDL_HWACCEL;
   1.358 -	if ( surface->map->identity ) {
   1.359 -		int hw_blit_ok;
   1.360 +    /* Get the blit function index, based on surface mode */
   1.361 +    /* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */
   1.362 +    blit_index = 0;
   1.363 +    blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY)) << 0;
   1.364 +    if (surface->flags & SDL_SRCALPHA
   1.365 +        && (surface->format->alpha != SDL_ALPHA_OPAQUE
   1.366 +            || surface->format->Amask)) {
   1.367 +        blit_index |= 2;
   1.368 +    }
   1.369  
   1.370 -		if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
   1.371 -			/* We only support accelerated blitting to hardware */
   1.372 -			if ( surface->map->dst->flags & SDL_HWSURFACE ) {
   1.373 -				hw_blit_ok = current_video->info.blit_hw;
   1.374 -			} else {
   1.375 -				hw_blit_ok = 0;
   1.376 -			}
   1.377 -			if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
   1.378 -				hw_blit_ok = current_video->info.blit_hw_CC;
   1.379 -			}
   1.380 -			if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
   1.381 -				hw_blit_ok = current_video->info.blit_hw_A;
   1.382 -			}
   1.383 -		} else {
   1.384 -			/* We only support accelerated blitting to hardware */
   1.385 -			if ( surface->map->dst->flags & SDL_HWSURFACE ) {
   1.386 -				hw_blit_ok = current_video->info.blit_sw;
   1.387 -			} else {
   1.388 -				hw_blit_ok = 0;
   1.389 -			}
   1.390 -			if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
   1.391 -				hw_blit_ok = current_video->info.blit_sw_CC;
   1.392 -			}
   1.393 -			if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
   1.394 -				hw_blit_ok = current_video->info.blit_sw_A;
   1.395 -			}
   1.396 -		}
   1.397 -		if ( hw_blit_ok ) {
   1.398 -			SDL_VideoDevice *video = current_video;
   1.399 -			SDL_VideoDevice *this  = current_video;
   1.400 -			video->CheckHWBlit(this, surface, surface->map->dst);
   1.401 -		}
   1.402 -	}
   1.403 -	
   1.404 -	/* if an alpha pixel format is specified, we can accelerate alpha blits */
   1.405 -	if (((surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE )&&(current_video->displayformatalphapixel)) 
   1.406 -	{
   1.407 -		if ( (surface->flags & SDL_SRCALPHA) ) 
   1.408 -			if ( current_video->info.blit_hw_A ) {
   1.409 -				SDL_VideoDevice *video = current_video;
   1.410 -				SDL_VideoDevice *this  = current_video;
   1.411 -				video->CheckHWBlit(this, surface, surface->map->dst);
   1.412 -			}
   1.413 -	}
   1.414 +    /* Check for special "identity" case -- copy blit */
   1.415 +    if (surface->map->identity && blit_index == 0) {
   1.416 +        surface->map->sw_data->blit = SDL_BlitCopy;
   1.417  
   1.418 -	/* Get the blit function index, based on surface mode */
   1.419 -	/* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */
   1.420 -	blit_index = 0;
   1.421 -	blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY))      << 0;
   1.422 -	if ( surface->flags & SDL_SRCALPHA
   1.423 -	     && (surface->format->alpha != SDL_ALPHA_OPAQUE
   1.424 -		 || surface->format->Amask) ) {
   1.425 -	        blit_index |= 2;
   1.426 -	}
   1.427 +        /* Handle overlapping blits on the same surface */
   1.428 +        if (surface == surface->map->dst) {
   1.429 +            surface->map->sw_data->blit = SDL_BlitCopyOverlap;
   1.430 +        }
   1.431 +    } else {
   1.432 +        if (surface->format->BitsPerPixel < 8) {
   1.433 +            surface->map->sw_data->blit =
   1.434 +                SDL_CalculateBlit0(surface, blit_index);
   1.435 +        } else {
   1.436 +            switch (surface->format->BytesPerPixel) {
   1.437 +            case 1:
   1.438 +                surface->map->sw_data->blit =
   1.439 +                    SDL_CalculateBlit1(surface, blit_index);
   1.440 +                break;
   1.441 +            case 2:
   1.442 +            case 3:
   1.443 +            case 4:
   1.444 +                surface->map->sw_data->blit =
   1.445 +                    SDL_CalculateBlitN(surface, blit_index);
   1.446 +                break;
   1.447 +            default:
   1.448 +                surface->map->sw_data->blit = NULL;
   1.449 +                break;
   1.450 +            }
   1.451 +        }
   1.452 +    }
   1.453 +    /* Make sure we have a blit function */
   1.454 +    if (surface->map->sw_data->blit == NULL) {
   1.455 +        SDL_InvalidateMap(surface->map);
   1.456 +        SDL_SetError("Blit combination not supported");
   1.457 +        return (-1);
   1.458 +    }
   1.459  
   1.460 -	/* Check for special "identity" case -- copy blit */
   1.461 -	if ( surface->map->identity && blit_index == 0 ) {
   1.462 -	        surface->map->sw_data->blit = SDL_BlitCopy;
   1.463 +    /* Choose software blitting function */
   1.464 +    if (surface->flags & SDL_RLEACCELOK) {
   1.465 +        if (surface->map->identity
   1.466 +            && (blit_index == 1
   1.467 +                || (blit_index == 3 && !surface->format->Amask))) {
   1.468 +            if (SDL_RLESurface(surface) == 0)
   1.469 +                surface->map->sw_blit = SDL_RLEBlit;
   1.470 +        } else if (blit_index == 2 && surface->format->Amask) {
   1.471 +            if (SDL_RLESurface(surface) == 0)
   1.472 +                surface->map->sw_blit = SDL_RLEAlphaBlit;
   1.473 +        }
   1.474 +    }
   1.475  
   1.476 -		/* Handle overlapping blits on the same surface */
   1.477 -		if ( surface == surface->map->dst ) {
   1.478 -		        surface->map->sw_data->blit = SDL_BlitCopyOverlap;
   1.479 -		}
   1.480 -	} else {
   1.481 -		if ( surface->format->BitsPerPixel < 8 ) {
   1.482 -			surface->map->sw_data->blit =
   1.483 -			    SDL_CalculateBlit0(surface, blit_index);
   1.484 -		} else {
   1.485 -			switch ( surface->format->BytesPerPixel ) {
   1.486 -			    case 1:
   1.487 -				surface->map->sw_data->blit =
   1.488 -				    SDL_CalculateBlit1(surface, blit_index);
   1.489 -				break;
   1.490 -			    case 2:
   1.491 -			    case 3:
   1.492 -			    case 4:
   1.493 -				surface->map->sw_data->blit =
   1.494 -				    SDL_CalculateBlitN(surface, blit_index);
   1.495 -				break;
   1.496 -			    default:
   1.497 -				surface->map->sw_data->blit = NULL;
   1.498 -				break;
   1.499 -			}
   1.500 -		}
   1.501 -	}
   1.502 -	/* Make sure we have a blit function */
   1.503 -	if ( surface->map->sw_data->blit == NULL ) {
   1.504 -		SDL_InvalidateMap(surface->map);
   1.505 -		SDL_SetError("Blit combination not supported");
   1.506 -		return(-1);
   1.507 -	}
   1.508 -
   1.509 -	/* Choose software blitting function */
   1.510 -	if(surface->flags & SDL_RLEACCELOK
   1.511 -	   && (surface->flags & SDL_HWACCEL) != SDL_HWACCEL) {
   1.512 -
   1.513 -	        if(surface->map->identity
   1.514 -		   && (blit_index == 1
   1.515 -		       || (blit_index == 3 && !surface->format->Amask))) {
   1.516 -		        if ( SDL_RLESurface(surface) == 0 )
   1.517 -			        surface->map->sw_blit = SDL_RLEBlit;
   1.518 -		} else if(blit_index == 2 && surface->format->Amask) {
   1.519 -		        if ( SDL_RLESurface(surface) == 0 )
   1.520 -			        surface->map->sw_blit = SDL_RLEAlphaBlit;
   1.521 -		}
   1.522 -	}
   1.523 -	
   1.524 -	if ( surface->map->sw_blit == NULL ) {
   1.525 -		surface->map->sw_blit = SDL_SoftBlit;
   1.526 -	}
   1.527 -	return(0);
   1.528 +    if (surface->map->sw_blit == NULL) {
   1.529 +        surface->map->sw_blit = SDL_SoftBlit;
   1.530 +    }
   1.531 +    return (0);
   1.532  }
   1.533  
   1.534 +/* vi: set ts=4 sw=4 expandtab: */