src/video/SDL_blit_1.c
changeset 12201 8bdc4d340419
parent 11811 5d94cb6b24d3
child 12503 806492103856
     1.1 --- a/src/video/SDL_blit_1.c	Sat Aug 18 17:23:40 2018 -0400
     1.2 +++ b/src/video/SDL_blit_1.c	Mon Sep 24 11:49:25 2018 -0700
     1.3 @@ -49,13 +49,13 @@
     1.4      while (height--) {
     1.5  #ifdef USE_DUFFS_LOOP
     1.6          /* *INDENT-OFF* */
     1.7 -		DUFFS_LOOP(
     1.8 -			{
     1.9 -			  *dst = map[*src];
    1.10 -			}
    1.11 -			dst++;
    1.12 -			src++;
    1.13 -		, width);
    1.14 +        DUFFS_LOOP(
    1.15 +            {
    1.16 +              *dst = map[*src];
    1.17 +            }
    1.18 +            dst++;
    1.19 +            src++;
    1.20 +        , width);
    1.21          /* *INDENT-ON* */
    1.22  #else
    1.23          for (c = width; c; --c) {
    1.24 @@ -72,11 +72,11 @@
    1.25  /* This is now endian dependent */
    1.26  #ifndef USE_DUFFS_LOOP
    1.27  # if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
    1.28 -#  define HI	1
    1.29 -#  define LO	0
    1.30 +#  define HI    1
    1.31 +#  define LO    0
    1.32  # else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
    1.33 -#  define HI	0
    1.34 -#  define LO	1
    1.35 +#  define HI    0
    1.36 +#  define LO    1
    1.37  # endif
    1.38  #endif
    1.39  static void
    1.40 @@ -101,14 +101,14 @@
    1.41  
    1.42  #ifdef USE_DUFFS_LOOP
    1.43      while (height--) {
    1.44 -		/* *INDENT-OFF* */
    1.45 -		DUFFS_LOOP(
    1.46 -		{
    1.47 -			*(Uint16 *)dst = map[*src++];
    1.48 -			dst += 2;
    1.49 -		},
    1.50 -		width);
    1.51 -		/* *INDENT-ON* */
    1.52 +        /* *INDENT-OFF* */
    1.53 +        DUFFS_LOOP(
    1.54 +        {
    1.55 +            *(Uint16 *)dst = map[*src++];
    1.56 +            dst += 2;
    1.57 +        },
    1.58 +        width);
    1.59 +        /* *INDENT-ON* */
    1.60          src += srcskip;
    1.61          dst += dstskip;
    1.62      }
    1.63 @@ -208,18 +208,18 @@
    1.64  
    1.65      while (height--) {
    1.66  #ifdef USE_DUFFS_LOOP
    1.67 -		/* *INDENT-OFF* */
    1.68 -		DUFFS_LOOP(
    1.69 -			{
    1.70 -				o = *src * 4;
    1.71 -				dst[0] = map[o++];
    1.72 -				dst[1] = map[o++];
    1.73 -				dst[2] = map[o++];
    1.74 -			}
    1.75 -			src++;
    1.76 -			dst += 3;
    1.77 -		, width);
    1.78 -		/* *INDENT-ON* */
    1.79 +        /* *INDENT-OFF* */
    1.80 +        DUFFS_LOOP(
    1.81 +            {
    1.82 +                o = *src * 4;
    1.83 +                dst[0] = map[o++];
    1.84 +                dst[1] = map[o++];
    1.85 +                dst[2] = map[o++];
    1.86 +            }
    1.87 +            src++;
    1.88 +            dst += 3;
    1.89 +        , width);
    1.90 +        /* *INDENT-ON* */
    1.91  #else
    1.92          for (c = width; c; --c) {
    1.93              o = *src * 4;
    1.94 @@ -257,11 +257,11 @@
    1.95  
    1.96      while (height--) {
    1.97  #ifdef USE_DUFFS_LOOP
    1.98 -		/* *INDENT-OFF* */
    1.99 -		DUFFS_LOOP(
   1.100 -			*dst++ = map[*src++];
   1.101 -		, width);
   1.102 -		/* *INDENT-ON* */
   1.103 +        /* *INDENT-OFF* */
   1.104 +        DUFFS_LOOP(
   1.105 +            *dst++ = map[*src++];
   1.106 +        , width);
   1.107 +        /* *INDENT-ON* */
   1.108  #else
   1.109          for (c = width / 4; c; --c) {
   1.110              *dst++ = map[*src++];
   1.111 @@ -297,33 +297,33 @@
   1.112  
   1.113      if (palmap) {
   1.114          while (height--) {
   1.115 -			/* *INDENT-OFF* */
   1.116 -			DUFFS_LOOP(
   1.117 -			{
   1.118 -				if ( *src != ckey ) {
   1.119 -				  *dst = palmap[*src];
   1.120 -				}
   1.121 -				dst++;
   1.122 -				src++;
   1.123 -			},
   1.124 -			width);
   1.125 -			/* *INDENT-ON* */
   1.126 +            /* *INDENT-OFF* */
   1.127 +            DUFFS_LOOP(
   1.128 +            {
   1.129 +                if ( *src != ckey ) {
   1.130 +                  *dst = palmap[*src];
   1.131 +                }
   1.132 +                dst++;
   1.133 +                src++;
   1.134 +            },
   1.135 +            width);
   1.136 +            /* *INDENT-ON* */
   1.137              src += srcskip;
   1.138              dst += dstskip;
   1.139          }
   1.140      } else {
   1.141          while (height--) {
   1.142 -			/* *INDENT-OFF* */
   1.143 -			DUFFS_LOOP(
   1.144 -			{
   1.145 -				if ( *src != ckey ) {
   1.146 -				  *dst = *src;
   1.147 -				}
   1.148 -				dst++;
   1.149 -				src++;
   1.150 -			},
   1.151 -			width);
   1.152 -			/* *INDENT-ON* */
   1.153 +            /* *INDENT-OFF* */
   1.154 +            DUFFS_LOOP(
   1.155 +            {
   1.156 +                if ( *src != ckey ) {
   1.157 +                  *dst = *src;
   1.158 +                }
   1.159 +                dst++;
   1.160 +                src++;
   1.161 +            },
   1.162 +            width);
   1.163 +            /* *INDENT-ON* */
   1.164              src += srcskip;
   1.165              dst += dstskip;
   1.166          }
   1.167 @@ -346,17 +346,17 @@
   1.168      dstskip /= 2;
   1.169  
   1.170      while (height--) {
   1.171 -		/* *INDENT-OFF* */
   1.172 -		DUFFS_LOOP(
   1.173 -		{
   1.174 -			if ( *src != ckey ) {
   1.175 -				*dstp=palmap[*src];
   1.176 -			}
   1.177 -			src++;
   1.178 -			dstp++;
   1.179 -		},
   1.180 -		width);
   1.181 -		/* *INDENT-ON* */
   1.182 +        /* *INDENT-OFF* */
   1.183 +        DUFFS_LOOP(
   1.184 +        {
   1.185 +            if ( *src != ckey ) {
   1.186 +                *dstp=palmap[*src];
   1.187 +            }
   1.188 +            src++;
   1.189 +            dstp++;
   1.190 +        },
   1.191 +        width);
   1.192 +        /* *INDENT-ON* */
   1.193          src += srcskip;
   1.194          dstp += dstskip;
   1.195      }
   1.196 @@ -376,20 +376,20 @@
   1.197      int o;
   1.198  
   1.199      while (height--) {
   1.200 -		/* *INDENT-OFF* */
   1.201 -		DUFFS_LOOP(
   1.202 -		{
   1.203 -			if ( *src != ckey ) {
   1.204 -				o = *src * 4;
   1.205 -				dst[0] = palmap[o++];
   1.206 -				dst[1] = palmap[o++];
   1.207 -				dst[2] = palmap[o++];
   1.208 -			}
   1.209 -			src++;
   1.210 -			dst += 3;
   1.211 -		},
   1.212 -		width);
   1.213 -		/* *INDENT-ON* */
   1.214 +        /* *INDENT-OFF* */
   1.215 +        DUFFS_LOOP(
   1.216 +        {
   1.217 +            if ( *src != ckey ) {
   1.218 +                o = *src * 4;
   1.219 +                dst[0] = palmap[o++];
   1.220 +                dst[1] = palmap[o++];
   1.221 +                dst[2] = palmap[o++];
   1.222 +            }
   1.223 +            src++;
   1.224 +            dst += 3;
   1.225 +        },
   1.226 +        width);
   1.227 +        /* *INDENT-ON* */
   1.228          src += srcskip;
   1.229          dst += dstskip;
   1.230      }
   1.231 @@ -411,17 +411,17 @@
   1.232      dstskip /= 4;
   1.233  
   1.234      while (height--) {
   1.235 -		/* *INDENT-OFF* */
   1.236 -		DUFFS_LOOP(
   1.237 -		{
   1.238 -			if ( *src != ckey ) {
   1.239 -				*dstp = palmap[*src];
   1.240 -			}
   1.241 -			src++;
   1.242 -			dstp++;
   1.243 -		},
   1.244 -		width);
   1.245 -		/* *INDENT-ON* */
   1.246 +        /* *INDENT-OFF* */
   1.247 +        DUFFS_LOOP(
   1.248 +        {
   1.249 +            if ( *src != ckey ) {
   1.250 +                *dstp = palmap[*src];
   1.251 +            }
   1.252 +            src++;
   1.253 +            dstp++;
   1.254 +        },
   1.255 +        width);
   1.256 +        /* *INDENT-ON* */
   1.257          src += srcskip;
   1.258          dstp += dstskip;
   1.259      }
   1.260 @@ -489,22 +489,22 @@
   1.261      dstbpp = dstfmt->BytesPerPixel;
   1.262  
   1.263      while (height--) {
   1.264 -		/* *INDENT-OFF* */
   1.265 -		DUFFS_LOOP(
   1.266 -		{
   1.267 -			if ( *src != ckey ) {
   1.268 -				sR = srcpal[*src].r;
   1.269 -				sG = srcpal[*src].g;
   1.270 -				sB = srcpal[*src].b;
   1.271 -				DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
   1.272 -				ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
   1.273 -			  	ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
   1.274 -			}
   1.275 -			src++;
   1.276 -			dst += dstbpp;
   1.277 -		},
   1.278 -		width);
   1.279 -		/* *INDENT-ON* */
   1.280 +        /* *INDENT-OFF* */
   1.281 +        DUFFS_LOOP(
   1.282 +        {
   1.283 +            if ( *src != ckey ) {
   1.284 +                sR = srcpal[*src].r;
   1.285 +                sG = srcpal[*src].g;
   1.286 +                sB = srcpal[*src].b;
   1.287 +                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
   1.288 +                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
   1.289 +                  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
   1.290 +            }
   1.291 +            src++;
   1.292 +            dst += dstbpp;
   1.293 +        },
   1.294 +        width);
   1.295 +        /* *INDENT-ON* */
   1.296          src += srcskip;
   1.297          dst += dstskip;
   1.298      }