src/video/SDL_RLEaccel.c
changeset 8922 dfb6f8611ebe
parent 8149 681eb46b8ac4
child 8924 b80cdf666e91
     1.1 --- a/src/video/SDL_RLEaccel.c	Wed Jun 25 00:20:21 2014 -0700
     1.2 +++ b/src/video/SDL_RLEaccel.c	Wed Jun 25 00:43:10 2014 -0700
     1.3 @@ -376,10 +376,10 @@
     1.4   * right. Top clipping has already been taken care of.
     1.5   */
     1.6  static void
     1.7 -RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst,
     1.8 +RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst,
     1.9              Uint8 * dstbuf, SDL_Rect * srcrect, unsigned alpha)
    1.10  {
    1.11 -    SDL_PixelFormat *fmt = dst->format;
    1.12 +    SDL_PixelFormat *fmt = surf_dst->format;
    1.13  
    1.14  #define RLECLIPBLIT(bpp, Type, do_blit)                    \
    1.15      do {                                   \
    1.16 @@ -418,7 +418,7 @@
    1.17          break;                             \
    1.18          if(ofs == w) {                         \
    1.19          ofs = 0;                           \
    1.20 -        dstbuf += dst->pitch;                      \
    1.21 +        dstbuf += surf_dst->pitch;                      \
    1.22          if(!--linecount)                       \
    1.23              break;                         \
    1.24          }                                  \
    1.25 @@ -434,18 +434,18 @@
    1.26  
    1.27  /* blit a colorkeyed RLE surface */
    1.28  int
    1.29 -SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect,
    1.30 -            SDL_Surface * dst, SDL_Rect * dstrect)
    1.31 +SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect,
    1.32 +            SDL_Surface * surf_dst, SDL_Rect * dstrect)
    1.33  {
    1.34      Uint8 *dstbuf;
    1.35      Uint8 *srcbuf;
    1.36      int x, y;
    1.37 -    int w = src->w;
    1.38 +    int w = surf_src->w;
    1.39      unsigned alpha;
    1.40  
    1.41      /* Lock the destination if necessary */
    1.42 -    if (SDL_MUSTLOCK(dst)) {
    1.43 -        if (SDL_LockSurface(dst) < 0) {
    1.44 +    if (SDL_MUSTLOCK(surf_dst)) {
    1.45 +        if (SDL_LockSurface(surf_dst) < 0) {
    1.46              return (-1);
    1.47          }
    1.48      }
    1.49 @@ -453,9 +453,9 @@
    1.50      /* Set up the source and destination pointers */
    1.51      x = dstrect->x;
    1.52      y = dstrect->y;
    1.53 -    dstbuf = (Uint8 *) dst->pixels
    1.54 -        + y * dst->pitch + x * src->format->BytesPerPixel;
    1.55 -    srcbuf = (Uint8 *) src->map->data;
    1.56 +    dstbuf = (Uint8 *) surf_dst->pixels
    1.57 +        + y * surf_dst->pitch + x * surf_src->format->BytesPerPixel;
    1.58 +    srcbuf = (Uint8 *) surf_src->map->data;
    1.59  
    1.60      {
    1.61          /* skip lines at the top if necessary */
    1.62 @@ -481,7 +481,7 @@
    1.63              }               \
    1.64          }
    1.65  
    1.66 -            switch (src->format->BytesPerPixel) {
    1.67 +            switch (surf_src->format->BytesPerPixel) {
    1.68              case 1:
    1.69                  RLESKIP(1, Uint8);
    1.70                  break;
    1.71 @@ -501,12 +501,12 @@
    1.72          }
    1.73      }
    1.74  
    1.75 -    alpha = src->map->info.a;
    1.76 +    alpha = surf_src->map->info.a;
    1.77      /* if left or right edge clipping needed, call clip blit */
    1.78 -    if (srcrect->x || srcrect->w != src->w) {
    1.79 -        RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
    1.80 +    if (srcrect->x || srcrect->w != surf_src->w) {
    1.81 +        RLEClipBlit(w, srcbuf, surf_dst, dstbuf, srcrect, alpha);
    1.82      } else {
    1.83 -        SDL_PixelFormat *fmt = src->format;
    1.84 +        SDL_PixelFormat *fmt = surf_src->format;
    1.85  
    1.86  #define RLEBLIT(bpp, Type, do_blit)                       \
    1.87          do {                                  \
    1.88 @@ -525,7 +525,7 @@
    1.89              break;                            \
    1.90              if(ofs == w) {                        \
    1.91              ofs = 0;                          \
    1.92 -            dstbuf += dst->pitch;                     \
    1.93 +            dstbuf += surf_dst->pitch;                     \
    1.94              if(!--linecount)                      \
    1.95                  break;                        \
    1.96              }                                 \
    1.97 @@ -539,8 +539,8 @@
    1.98  
    1.99    done:
   1.100      /* Unlock the destination if necessary */
   1.101 -    if (SDL_MUSTLOCK(dst)) {
   1.102 -        SDL_UnlockSurface(dst);
   1.103 +    if (SDL_MUSTLOCK(surf_dst)) {
   1.104 +        SDL_UnlockSurface(surf_dst);
   1.105      }
   1.106      return (0);
   1.107  }
   1.108 @@ -620,10 +620,10 @@
   1.109  
   1.110  /* blit a pixel-alpha RLE surface clipped at the right and/or left edges */
   1.111  static void
   1.112 -RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst,
   1.113 +RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst,
   1.114                   Uint8 * dstbuf, SDL_Rect * srcrect)
   1.115  {
   1.116 -    SDL_PixelFormat *df = dst->format;
   1.117 +    SDL_PixelFormat *df = surf_dst->format;
   1.118      /*
   1.119       * clipped blitter: Ptype is the destination pixel type,
   1.120       * Ctype the translucent count type, and do_blend the macro
   1.121 @@ -693,7 +693,7 @@
   1.122              ofs += run;                       \
   1.123          }                             \
   1.124          } while(ofs < w);                         \
   1.125 -        dstbuf += dst->pitch;                     \
   1.126 +        dstbuf += surf_dst->pitch;                     \
   1.127      } while(--linecount);                         \
   1.128      } while(0)
   1.129  
   1.130 @@ -712,25 +712,25 @@
   1.131  
   1.132  /* blit a pixel-alpha RLE surface */
   1.133  int
   1.134 -SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect,
   1.135 -                 SDL_Surface * dst, SDL_Rect * dstrect)
   1.136 +SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect,
   1.137 +                 SDL_Surface * surf_dst, SDL_Rect * dstrect)
   1.138  {
   1.139      int x, y;
   1.140 -    int w = src->w;
   1.141 +    int w = surf_src->w;
   1.142      Uint8 *srcbuf, *dstbuf;
   1.143 -    SDL_PixelFormat *df = dst->format;
   1.144 +    SDL_PixelFormat *df = surf_dst->format;
   1.145  
   1.146      /* Lock the destination if necessary */
   1.147 -    if (SDL_MUSTLOCK(dst)) {
   1.148 -        if (SDL_LockSurface(dst) < 0) {
   1.149 +    if (SDL_MUSTLOCK(surf_dst)) {
   1.150 +        if (SDL_LockSurface(surf_dst) < 0) {
   1.151              return -1;
   1.152          }
   1.153      }
   1.154  
   1.155      x = dstrect->x;
   1.156      y = dstrect->y;
   1.157 -    dstbuf = (Uint8 *) dst->pixels + y * dst->pitch + x * df->BytesPerPixel;
   1.158 -    srcbuf = (Uint8 *) src->map->data + sizeof(RLEDestFormat);
   1.159 +    dstbuf = (Uint8 *) surf_dst->pixels + y * surf_dst->pitch + x * df->BytesPerPixel;
   1.160 +    srcbuf = (Uint8 *) surf_src->map->data + sizeof(RLEDestFormat);
   1.161  
   1.162      {
   1.163          /* skip lines at the top if necessary */
   1.164 @@ -789,8 +789,8 @@
   1.165      }
   1.166  
   1.167      /* if left or right edge clipping needed, call clip blit */
   1.168 -    if (srcrect->x || srcrect->w != src->w) {
   1.169 -        RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect);
   1.170 +    if (srcrect->x || srcrect->w != surf_src->w) {
   1.171 +        RLEAlphaClipBlit(w, srcbuf, surf_dst, dstbuf, srcrect);
   1.172      } else {
   1.173  
   1.174          /*
   1.175 @@ -839,7 +839,7 @@
   1.176              ofs += run;                  \
   1.177              }                            \
   1.178          } while(ofs < w);                    \
   1.179 -        dstbuf += dst->pitch;                    \
   1.180 +        dstbuf += surf_dst->pitch;                    \
   1.181          } while(--linecount);                    \
   1.182      } while(0)
   1.183  
   1.184 @@ -859,8 +859,8 @@
   1.185  
   1.186    done:
   1.187      /* Unlock the destination if necessary */
   1.188 -    if (SDL_MUSTLOCK(dst)) {
   1.189 -        SDL_UnlockSurface(dst);
   1.190 +    if (SDL_MUSTLOCK(surf_dst)) {
   1.191 +        SDL_UnlockSurface(surf_dst);
   1.192      }
   1.193      return 0;
   1.194  }