src/video/SDL_yuv_sw.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
child 1672 8e754b82cecc
     1.1 --- a/src/video/SDL_yuv_sw.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/SDL_yuv_sw.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -123,21 +123,21 @@
     1.4  /* The colorspace conversion functions */
     1.5  
     1.6  #if 0                           /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */
     1.7 -extern void Color565DitherYV12MMX1X (int *colortab, Uint32 * rgb_2_pix,
     1.8 -                                     unsigned char *lum, unsigned char *cr,
     1.9 -                                     unsigned char *cb, unsigned char *out,
    1.10 -                                     int rows, int cols, int mod);
    1.11 -extern void ColorRGBDitherYV12MMX1X (int *colortab, Uint32 * rgb_2_pix,
    1.12 -                                     unsigned char *lum, unsigned char *cr,
    1.13 -                                     unsigned char *cb, unsigned char *out,
    1.14 -                                     int rows, int cols, int mod);
    1.15 +extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
    1.16 +                                    unsigned char *lum, unsigned char *cr,
    1.17 +                                    unsigned char *cb, unsigned char *out,
    1.18 +                                    int rows, int cols, int mod);
    1.19 +extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
    1.20 +                                    unsigned char *lum, unsigned char *cr,
    1.21 +                                    unsigned char *cb, unsigned char *out,
    1.22 +                                    int rows, int cols, int mod);
    1.23  #endif
    1.24  
    1.25  static void
    1.26 -Color16DitherYV12Mod1X (int *colortab, Uint32 * rgb_2_pix,
    1.27 -                        unsigned char *lum, unsigned char *cr,
    1.28 -                        unsigned char *cb, unsigned char *out,
    1.29 -                        int rows, int cols, int mod)
    1.30 +Color16DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
    1.31 +                       unsigned char *lum, unsigned char *cr,
    1.32 +                       unsigned char *cb, unsigned char *out,
    1.33 +                       int rows, int cols, int mod)
    1.34  {
    1.35      unsigned short *row1;
    1.36      unsigned short *row2;
    1.37 @@ -204,10 +204,10 @@
    1.38  }
    1.39  
    1.40  static void
    1.41 -Color24DitherYV12Mod1X (int *colortab, Uint32 * rgb_2_pix,
    1.42 -                        unsigned char *lum, unsigned char *cr,
    1.43 -                        unsigned char *cb, unsigned char *out,
    1.44 -                        int rows, int cols, int mod)
    1.45 +Color24DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
    1.46 +                       unsigned char *lum, unsigned char *cr,
    1.47 +                       unsigned char *cb, unsigned char *out,
    1.48 +                       int rows, int cols, int mod)
    1.49  {
    1.50      unsigned int value;
    1.51      unsigned char *row1;
    1.52 @@ -284,10 +284,10 @@
    1.53  }
    1.54  
    1.55  static void
    1.56 -Color32DitherYV12Mod1X (int *colortab, Uint32 * rgb_2_pix,
    1.57 -                        unsigned char *lum, unsigned char *cr,
    1.58 -                        unsigned char *cb, unsigned char *out,
    1.59 -                        int rows, int cols, int mod)
    1.60 +Color32DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
    1.61 +                       unsigned char *lum, unsigned char *cr,
    1.62 +                       unsigned char *cb, unsigned char *out,
    1.63 +                       int rows, int cols, int mod)
    1.64  {
    1.65      unsigned int *row1;
    1.66      unsigned int *row2;
    1.67 @@ -355,10 +355,10 @@
    1.68   * the horisontal doubling for free (almost).
    1.69   */
    1.70  static void
    1.71 -Color16DitherYV12Mod2X (int *colortab, Uint32 * rgb_2_pix,
    1.72 -                        unsigned char *lum, unsigned char *cr,
    1.73 -                        unsigned char *cb, unsigned char *out,
    1.74 -                        int rows, int cols, int mod)
    1.75 +Color16DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
    1.76 +                       unsigned char *lum, unsigned char *cr,
    1.77 +                       unsigned char *cb, unsigned char *out,
    1.78 +                       int rows, int cols, int mod)
    1.79  {
    1.80      unsigned int *row1 = (unsigned int *) out;
    1.81      const int next_row = cols + (mod / 2);
    1.82 @@ -428,10 +428,10 @@
    1.83  }
    1.84  
    1.85  static void
    1.86 -Color24DitherYV12Mod2X (int *colortab, Uint32 * rgb_2_pix,
    1.87 -                        unsigned char *lum, unsigned char *cr,
    1.88 -                        unsigned char *cb, unsigned char *out,
    1.89 -                        int rows, int cols, int mod)
    1.90 +Color24DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
    1.91 +                       unsigned char *lum, unsigned char *cr,
    1.92 +                       unsigned char *cb, unsigned char *out,
    1.93 +                       int rows, int cols, int mod)
    1.94  {
    1.95      unsigned int value;
    1.96      unsigned char *row1 = out;
    1.97 @@ -522,10 +522,10 @@
    1.98  }
    1.99  
   1.100  static void
   1.101 -Color32DitherYV12Mod2X (int *colortab, Uint32 * rgb_2_pix,
   1.102 -                        unsigned char *lum, unsigned char *cr,
   1.103 -                        unsigned char *cb, unsigned char *out,
   1.104 -                        int rows, int cols, int mod)
   1.105 +Color32DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
   1.106 +                       unsigned char *lum, unsigned char *cr,
   1.107 +                       unsigned char *cb, unsigned char *out,
   1.108 +                       int rows, int cols, int mod)
   1.109  {
   1.110      unsigned int *row1 = (unsigned int *) out;
   1.111      const int next_row = cols * 2 + mod;
   1.112 @@ -595,10 +595,10 @@
   1.113  }
   1.114  
   1.115  static void
   1.116 -Color16DitherYUY2Mod1X (int *colortab, Uint32 * rgb_2_pix,
   1.117 -                        unsigned char *lum, unsigned char *cr,
   1.118 -                        unsigned char *cb, unsigned char *out,
   1.119 -                        int rows, int cols, int mod)
   1.120 +Color16DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
   1.121 +                       unsigned char *lum, unsigned char *cr,
   1.122 +                       unsigned char *cb, unsigned char *out,
   1.123 +                       int rows, int cols, int mod)
   1.124  {
   1.125      unsigned short *row;
   1.126      int x, y;
   1.127 @@ -641,10 +641,10 @@
   1.128  }
   1.129  
   1.130  static void
   1.131 -Color24DitherYUY2Mod1X (int *colortab, Uint32 * rgb_2_pix,
   1.132 -                        unsigned char *lum, unsigned char *cr,
   1.133 -                        unsigned char *cb, unsigned char *out,
   1.134 -                        int rows, int cols, int mod)
   1.135 +Color24DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
   1.136 +                       unsigned char *lum, unsigned char *cr,
   1.137 +                       unsigned char *cb, unsigned char *out,
   1.138 +                       int rows, int cols, int mod)
   1.139  {
   1.140      unsigned int value;
   1.141      unsigned char *row;
   1.142 @@ -691,10 +691,10 @@
   1.143  }
   1.144  
   1.145  static void
   1.146 -Color32DitherYUY2Mod1X (int *colortab, Uint32 * rgb_2_pix,
   1.147 -                        unsigned char *lum, unsigned char *cr,
   1.148 -                        unsigned char *cb, unsigned char *out,
   1.149 -                        int rows, int cols, int mod)
   1.150 +Color32DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
   1.151 +                       unsigned char *lum, unsigned char *cr,
   1.152 +                       unsigned char *cb, unsigned char *out,
   1.153 +                       int rows, int cols, int mod)
   1.154  {
   1.155      unsigned int *row;
   1.156      int x, y;
   1.157 @@ -739,10 +739,10 @@
   1.158   * the horisontal doubling for free (almost).
   1.159   */
   1.160  static void
   1.161 -Color16DitherYUY2Mod2X (int *colortab, Uint32 * rgb_2_pix,
   1.162 -                        unsigned char *lum, unsigned char *cr,
   1.163 -                        unsigned char *cb, unsigned char *out,
   1.164 -                        int rows, int cols, int mod)
   1.165 +Color16DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
   1.166 +                       unsigned char *lum, unsigned char *cr,
   1.167 +                       unsigned char *cb, unsigned char *out,
   1.168 +                       int rows, int cols, int mod)
   1.169  {
   1.170      unsigned int *row = (unsigned int *) out;
   1.171      const int next_row = cols + (mod / 2);
   1.172 @@ -785,10 +785,10 @@
   1.173  }
   1.174  
   1.175  static void
   1.176 -Color24DitherYUY2Mod2X (int *colortab, Uint32 * rgb_2_pix,
   1.177 -                        unsigned char *lum, unsigned char *cr,
   1.178 -                        unsigned char *cb, unsigned char *out,
   1.179 -                        int rows, int cols, int mod)
   1.180 +Color24DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
   1.181 +                       unsigned char *lum, unsigned char *cr,
   1.182 +                       unsigned char *cb, unsigned char *out,
   1.183 +                       int rows, int cols, int mod)
   1.184  {
   1.185      unsigned int value;
   1.186      unsigned char *row = out;
   1.187 @@ -841,10 +841,10 @@
   1.188  }
   1.189  
   1.190  static void
   1.191 -Color32DitherYUY2Mod2X (int *colortab, Uint32 * rgb_2_pix,
   1.192 -                        unsigned char *lum, unsigned char *cr,
   1.193 -                        unsigned char *cb, unsigned char *out,
   1.194 -                        int rows, int cols, int mod)
   1.195 +Color32DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
   1.196 +                       unsigned char *lum, unsigned char *cr,
   1.197 +                       unsigned char *cb, unsigned char *out,
   1.198 +                       int rows, int cols, int mod)
   1.199  {
   1.200      unsigned int *row = (unsigned int *) out;
   1.201      const int next_row = cols * 2 + mod;
   1.202 @@ -893,13 +893,13 @@
   1.203   * Low performance, do not call often.
   1.204   */
   1.205  static int
   1.206 -number_of_bits_set (Uint32 a)
   1.207 +number_of_bits_set(Uint32 a)
   1.208  {
   1.209      if (!a)
   1.210          return 0;
   1.211      if (a & 1)
   1.212 -        return 1 + number_of_bits_set (a >> 1);
   1.213 -    return (number_of_bits_set (a >> 1));
   1.214 +        return 1 + number_of_bits_set(a >> 1);
   1.215 +    return (number_of_bits_set(a >> 1));
   1.216  }
   1.217  
   1.218  /*
   1.219 @@ -907,20 +907,20 @@
   1.220   * Low performance, do not call often.
   1.221   */
   1.222  static int
   1.223 -free_bits_at_bottom (Uint32 a)
   1.224 +free_bits_at_bottom(Uint32 a)
   1.225  {
   1.226      /* assume char is 8 bits */
   1.227      if (!a)
   1.228 -        return sizeof (Uint32) * 8;
   1.229 +        return sizeof(Uint32) * 8;
   1.230      if (((Sint32) a) & 1l)
   1.231          return 0;
   1.232 -    return 1 + free_bits_at_bottom (a >> 1);
   1.233 +    return 1 + free_bits_at_bottom(a >> 1);
   1.234  }
   1.235  
   1.236  
   1.237  SDL_Overlay *
   1.238 -SDL_CreateYUV_SW (_THIS, int width, int height, Uint32 format,
   1.239 -                  SDL_Surface * display)
   1.240 +SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format,
   1.241 +                 SDL_Surface * display)
   1.242  {
   1.243      SDL_Overlay *overlay;
   1.244      struct private_yuvhwdata *swdata;
   1.245 @@ -939,7 +939,7 @@
   1.246      if ((display->format->BytesPerPixel != 2) &&
   1.247          (display->format->BytesPerPixel != 3) &&
   1.248          (display->format->BytesPerPixel != 4)) {
   1.249 -        SDL_SetError ("Can't use YUV data on non 16/24/32 bit surfaces");
   1.250 +        SDL_SetError("Can't use YUV data on non 16/24/32 bit surfaces");
   1.251          return (NULL);
   1.252      }
   1.253  
   1.254 @@ -952,17 +952,17 @@
   1.255      case SDL_YVYU_OVERLAY:
   1.256          break;
   1.257      default:
   1.258 -        SDL_SetError ("Unsupported YUV format");
   1.259 +        SDL_SetError("Unsupported YUV format");
   1.260          return (NULL);
   1.261      }
   1.262  
   1.263      /* Create the overlay structure */
   1.264 -    overlay = (SDL_Overlay *) SDL_malloc (sizeof *overlay);
   1.265 +    overlay = (SDL_Overlay *) SDL_malloc(sizeof *overlay);
   1.266      if (overlay == NULL) {
   1.267 -        SDL_OutOfMemory ();
   1.268 +        SDL_OutOfMemory();
   1.269          return (NULL);
   1.270      }
   1.271 -    SDL_memset (overlay, 0, (sizeof *overlay));
   1.272 +    SDL_memset(overlay, 0, (sizeof *overlay));
   1.273  
   1.274      /* Fill in the basic members */
   1.275      overlay->format = format;
   1.276 @@ -973,28 +973,28 @@
   1.277      overlay->hwfuncs = &sw_yuvfuncs;
   1.278  
   1.279      /* Create the pixel data and lookup tables */
   1.280 -    swdata = (struct private_yuvhwdata *) SDL_malloc (sizeof *swdata);
   1.281 +    swdata = (struct private_yuvhwdata *) SDL_malloc(sizeof *swdata);
   1.282      overlay->hwdata = swdata;
   1.283      if (swdata == NULL) {
   1.284 -        SDL_OutOfMemory ();
   1.285 -        SDL_FreeYUVOverlay (overlay);
   1.286 +        SDL_OutOfMemory();
   1.287 +        SDL_FreeYUVOverlay(overlay);
   1.288          return (NULL);
   1.289      }
   1.290      swdata->stretch = NULL;
   1.291      swdata->display = display;
   1.292 -    swdata->pixels = (Uint8 *) SDL_malloc (width * height * 2);
   1.293 -    swdata->colortab = (int *) SDL_malloc (4 * 256 * sizeof (int));
   1.294 +    swdata->pixels = (Uint8 *) SDL_malloc(width * height * 2);
   1.295 +    swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
   1.296      Cr_r_tab = &swdata->colortab[0 * 256];
   1.297      Cr_g_tab = &swdata->colortab[1 * 256];
   1.298      Cb_g_tab = &swdata->colortab[2 * 256];
   1.299      Cb_b_tab = &swdata->colortab[3 * 256];
   1.300 -    swdata->rgb_2_pix = (Uint32 *) SDL_malloc (3 * 768 * sizeof (Uint32));
   1.301 +    swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
   1.302      r_2_pix_alloc = &swdata->rgb_2_pix[0 * 768];
   1.303      g_2_pix_alloc = &swdata->rgb_2_pix[1 * 768];
   1.304      b_2_pix_alloc = &swdata->rgb_2_pix[2 * 768];
   1.305      if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
   1.306 -        SDL_OutOfMemory ();
   1.307 -        SDL_FreeYUVOverlay (overlay);
   1.308 +        SDL_OutOfMemory();
   1.309 +        SDL_FreeYUVOverlay(overlay);
   1.310          return (NULL);
   1.311      }
   1.312  
   1.313 @@ -1017,12 +1017,12 @@
   1.314      Gmask = display->format->Gmask;
   1.315      Bmask = display->format->Bmask;
   1.316      for (i = 0; i < 256; ++i) {
   1.317 -        r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set (Rmask));
   1.318 -        r_2_pix_alloc[i + 256] <<= free_bits_at_bottom (Rmask);
   1.319 -        g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set (Gmask));
   1.320 -        g_2_pix_alloc[i + 256] <<= free_bits_at_bottom (Gmask);
   1.321 -        b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set (Bmask));
   1.322 -        b_2_pix_alloc[i + 256] <<= free_bits_at_bottom (Bmask);
   1.323 +        r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Rmask));
   1.324 +        r_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Rmask);
   1.325 +        g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Gmask));
   1.326 +        g_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Gmask);
   1.327 +        b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Bmask));
   1.328 +        b_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Bmask);
   1.329      }
   1.330  
   1.331      /*
   1.332 @@ -1060,7 +1060,7 @@
   1.333          if (display->format->BytesPerPixel == 2) {
   1.334  #if 0                           /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */
   1.335              /* inline assembly functions */
   1.336 -            if (SDL_HasMMX () && (Rmask == 0xF800) &&
   1.337 +            if (SDL_HasMMX() && (Rmask == 0xF800) &&
   1.338                  (Gmask == 0x07E0) && (Bmask == 0x001F) && (width & 15) == 0) {
   1.339  /*printf("Using MMX 16-bit 565 dither\n");*/
   1.340                  swdata->Display1X = Color565DitherYV12MMX1X;
   1.341 @@ -1080,7 +1080,7 @@
   1.342          if (display->format->BytesPerPixel == 4) {
   1.343  #if 0                           /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */
   1.344              /* inline assembly functions */
   1.345 -            if (SDL_HasMMX () && (Rmask == 0x00FF0000) &&
   1.346 +            if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
   1.347                  (Gmask == 0x0000FF00) &&
   1.348                  (Bmask == 0x000000FF) && (width & 15) == 0) {
   1.349  /*printf("Using MMX 32-bit dither\n");*/
   1.350 @@ -1149,20 +1149,20 @@
   1.351  }
   1.352  
   1.353  int
   1.354 -SDL_LockYUV_SW (_THIS, SDL_Overlay * overlay)
   1.355 +SDL_LockYUV_SW(_THIS, SDL_Overlay * overlay)
   1.356  {
   1.357      return (0);
   1.358  }
   1.359  
   1.360  void
   1.361 -SDL_UnlockYUV_SW (_THIS, SDL_Overlay * overlay)
   1.362 +SDL_UnlockYUV_SW(_THIS, SDL_Overlay * overlay)
   1.363  {
   1.364      return;
   1.365  }
   1.366  
   1.367  int
   1.368 -SDL_DisplayYUV_SW (_THIS, SDL_Overlay * overlay, SDL_Rect * src,
   1.369 -                   SDL_Rect * dst)
   1.370 +SDL_DisplayYUV_SW(_THIS, SDL_Overlay * overlay, SDL_Rect * src,
   1.371 +                  SDL_Rect * dst)
   1.372  {
   1.373      struct private_yuvhwdata *swdata;
   1.374      int stretch;
   1.375 @@ -1192,17 +1192,16 @@
   1.376      if (stretch) {
   1.377          if (!swdata->stretch) {
   1.378              display = swdata->display;
   1.379 -            swdata->stretch = SDL_CreateRGBSurface (SDL_SWSURFACE,
   1.380 -                                                    overlay->w,
   1.381 -                                                    overlay->h,
   1.382 -                                                    display->format->
   1.383 -                                                    BitsPerPixel,
   1.384 -                                                    display->format->
   1.385 -                                                    Rmask,
   1.386 -                                                    display->format->
   1.387 -                                                    Gmask,
   1.388 -                                                    display->format->
   1.389 -                                                    Bmask, 0);
   1.390 +            swdata->stretch = SDL_CreateRGBSurface(SDL_SWSURFACE,
   1.391 +                                                   overlay->w,
   1.392 +                                                   overlay->h,
   1.393 +                                                   display->format->
   1.394 +                                                   BitsPerPixel,
   1.395 +                                                   display->format->
   1.396 +                                                   Rmask,
   1.397 +                                                   display->format->
   1.398 +                                                   Gmask,
   1.399 +                                                   display->format->Bmask, 0);
   1.400              if (!swdata->stretch) {
   1.401                  return (-1);
   1.402              }
   1.403 @@ -1238,11 +1237,11 @@
   1.404          Cb = lum + 3;
   1.405          break;
   1.406      default:
   1.407 -        SDL_SetError ("Unsupported YUV format in blit");
   1.408 +        SDL_SetError("Unsupported YUV format in blit");
   1.409          return (-1);
   1.410      }
   1.411 -    if (SDL_MUSTLOCK (display)) {
   1.412 -        if (SDL_LockSurface (display) < 0) {
   1.413 +    if (SDL_MUSTLOCK(display)) {
   1.414 +        if (SDL_LockSurface(display) < 0) {
   1.415              return (-1);
   1.416          }
   1.417      }
   1.418 @@ -1257,45 +1256,45 @@
   1.419  
   1.420      if (scale_2x) {
   1.421          mod -= (overlay->w * 2);
   1.422 -        swdata->Display2X (swdata->colortab, swdata->rgb_2_pix,
   1.423 -                           lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
   1.424 +        swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
   1.425 +                          lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
   1.426      } else {
   1.427          mod -= overlay->w;
   1.428 -        swdata->Display1X (swdata->colortab, swdata->rgb_2_pix,
   1.429 -                           lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
   1.430 +        swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
   1.431 +                          lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
   1.432      }
   1.433 -    if (SDL_MUSTLOCK (display)) {
   1.434 -        SDL_UnlockSurface (display);
   1.435 +    if (SDL_MUSTLOCK(display)) {
   1.436 +        SDL_UnlockSurface(display);
   1.437      }
   1.438      if (stretch) {
   1.439          display = swdata->display;
   1.440 -        SDL_SoftStretch (swdata->stretch, src, display, dst);
   1.441 +        SDL_SoftStretch(swdata->stretch, src, display, dst);
   1.442      }
   1.443 -    SDL_UpdateRects (display, 1, dst);
   1.444 +    SDL_UpdateRects(display, 1, dst);
   1.445  
   1.446      return (0);
   1.447  }
   1.448  
   1.449  void
   1.450 -SDL_FreeYUV_SW (_THIS, SDL_Overlay * overlay)
   1.451 +SDL_FreeYUV_SW(_THIS, SDL_Overlay * overlay)
   1.452  {
   1.453      struct private_yuvhwdata *swdata;
   1.454  
   1.455      swdata = overlay->hwdata;
   1.456      if (swdata) {
   1.457          if (swdata->stretch) {
   1.458 -            SDL_FreeSurface (swdata->stretch);
   1.459 +            SDL_FreeSurface(swdata->stretch);
   1.460          }
   1.461          if (swdata->pixels) {
   1.462 -            SDL_free (swdata->pixels);
   1.463 +            SDL_free(swdata->pixels);
   1.464          }
   1.465          if (swdata->colortab) {
   1.466 -            SDL_free (swdata->colortab);
   1.467 +            SDL_free(swdata->colortab);
   1.468          }
   1.469          if (swdata->rgb_2_pix) {
   1.470 -            SDL_free (swdata->rgb_2_pix);
   1.471 +            SDL_free(swdata->rgb_2_pix);
   1.472          }
   1.473 -        SDL_free (swdata);
   1.474 +        SDL_free(swdata);
   1.475      }
   1.476  }
   1.477