src/video/SDL_blit_0.c
changeset 2267 c785543d1843
parent 2262 bee005ace1bf
child 2698 e1da92da346c
     1.1 --- a/src/video/SDL_blit_0.c	Sat Aug 18 01:44:21 2007 +0000
     1.2 +++ b/src/video/SDL_blit_0.c	Sat Aug 18 05:39:09 2007 +0000
     1.3 @@ -38,9 +38,9 @@
     1.4      width = info->dst_w;
     1.5      height = info->dst_h;
     1.6      src = info->src;
     1.7 -    srcskip = info->s_skip;
     1.8 +    srcskip = info->src_skip;
     1.9      dst = info->dst;
    1.10 -    dstskip = info->dst_pitch;
    1.11 +    dstskip = info->dst_skip;
    1.12      map = info->table;
    1.13      srcskip += width - (width + 7) / 8;
    1.14  
    1.15 @@ -93,9 +93,9 @@
    1.16      width = info->dst_w;
    1.17      height = info->dst_h;
    1.18      src = info->src;
    1.19 -    srcskip = info->s_skip;
    1.20 +    srcskip = info->src_skip;
    1.21      dst = (Uint16 *) info->dst;
    1.22 -    dstskip = info->dst_pitch / 2;
    1.23 +    dstskip = info->dst_skip / 2;
    1.24      map = (Uint16 *) info->table;
    1.25      srcskip += width - (width + 7) / 8;
    1.26  
    1.27 @@ -128,9 +128,9 @@
    1.28      width = info->dst_w;
    1.29      height = info->dst_h;
    1.30      src = info->src;
    1.31 -    srcskip = info->s_skip;
    1.32 +    srcskip = info->src_skip;
    1.33      dst = info->dst;
    1.34 -    dstskip = info->dst_pitch;
    1.35 +    dstskip = info->dst_skip;
    1.36      map = info->table;
    1.37      srcskip += width - (width + 7) / 8;
    1.38  
    1.39 @@ -167,9 +167,9 @@
    1.40      width = info->dst_w;
    1.41      height = info->dst_h;
    1.42      src = info->src;
    1.43 -    srcskip = info->s_skip;
    1.44 +    srcskip = info->src_skip;
    1.45      dst = (Uint32 *) info->dst;
    1.46 -    dstskip = info->dst_pitch / 4;
    1.47 +    dstskip = info->dst_skip / 4;
    1.48      map = (Uint32 *) info->table;
    1.49      srcskip += width - (width + 7) / 8;
    1.50  
    1.51 @@ -198,9 +198,9 @@
    1.52      int height = info->dst_h;
    1.53      Uint8 *src = info->src;
    1.54      Uint8 *dst = info->dst;
    1.55 -    int srcskip = info->s_skip;
    1.56 -    int dstskip = info->dst_pitch;
    1.57 -    Uint32 ckey = info->ckey;
    1.58 +    int srcskip = info->src_skip;
    1.59 +    int dstskip = info->dst_skip;
    1.60 +    Uint32 ckey = info->colorkey;
    1.61      Uint8 *palmap = info->table;
    1.62      int c;
    1.63  
    1.64 @@ -251,9 +251,9 @@
    1.65      int height = info->dst_h;
    1.66      Uint8 *src = info->src;
    1.67      Uint16 *dstp = (Uint16 *) info->dst;
    1.68 -    int srcskip = info->s_skip;
    1.69 -    int dstskip = info->dst_pitch;
    1.70 -    Uint32 ckey = info->ckey;
    1.71 +    int srcskip = info->src_skip;
    1.72 +    int dstskip = info->dst_skip;
    1.73 +    Uint32 ckey = info->colorkey;
    1.74      Uint8 *palmap = info->table;
    1.75      int c;
    1.76  
    1.77 @@ -286,9 +286,9 @@
    1.78      int height = info->dst_h;
    1.79      Uint8 *src = info->src;
    1.80      Uint8 *dst = info->dst;
    1.81 -    int srcskip = info->s_skip;
    1.82 -    int dstskip = info->dst_pitch;
    1.83 -    Uint32 ckey = info->ckey;
    1.84 +    int srcskip = info->src_skip;
    1.85 +    int dstskip = info->dst_skip;
    1.86 +    Uint32 ckey = info->colorkey;
    1.87      Uint8 *palmap = info->table;
    1.88      int c;
    1.89  
    1.90 @@ -320,9 +320,9 @@
    1.91      int height = info->dst_h;
    1.92      Uint8 *src = info->src;
    1.93      Uint32 *dstp = (Uint32 *) info->dst;
    1.94 -    int srcskip = info->s_skip;
    1.95 -    int dstskip = info->dst_pitch;
    1.96 -    Uint32 ckey = info->ckey;
    1.97 +    int srcskip = info->src_skip;
    1.98 +    int dstskip = info->dst_skip;
    1.99 +    Uint32 ckey = info->colorkey;
   1.100      Uint8 *palmap = info->table;
   1.101      int c;
   1.102  
   1.103 @@ -355,13 +355,13 @@
   1.104      int height = info->dst_h;
   1.105      Uint8 *src = info->src;
   1.106      Uint8 *dst = info->dst;
   1.107 -    int srcskip = info->s_skip;
   1.108 -    int dstskip = info->dst_pitch;
   1.109 -    const SDL_Color *srcpal = info->src->palette->colors;
   1.110 -    SDL_PixelFormat *dstfmt = info->dst;
   1.111 +    int srcskip = info->src_skip;
   1.112 +    int dstskip = info->dst_skip;
   1.113 +    const SDL_Color *srcpal = info->src_fmt->palette->colors;
   1.114 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.115      int dstbpp;
   1.116      int c;
   1.117 -    const int A = (info->cmod >> 24);
   1.118 +    const int A = info->a;
   1.119  
   1.120      /* Set up some basic variables */
   1.121      dstbpp = dstfmt->BytesPerPixel;
   1.122 @@ -400,15 +400,15 @@
   1.123      int height = info->dst_h;
   1.124      Uint8 *src = info->src;
   1.125      Uint8 *dst = info->dst;
   1.126 -    int srcskip = info->s_skip;
   1.127 -    int dstskip = info->dst_pitch;
   1.128 -    SDL_PixelFormat *srcfmt = info->src;
   1.129 -    SDL_PixelFormat *dstfmt = info->dst;
   1.130 +    int srcskip = info->src_skip;
   1.131 +    int dstskip = info->dst_skip;
   1.132 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.133 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.134      const SDL_Color *srcpal = srcfmt->palette->colors;
   1.135      int dstbpp;
   1.136      int c;
   1.137 -    const int A = (info->cmod >> 24);
   1.138 -    Uint32 ckey = info->ckey;
   1.139 +    const int A = info->a;
   1.140 +    Uint32 ckey = info->colorkey;
   1.141  
   1.142      /* Set up some basic variables */
   1.143      dstbpp = dstfmt->BytesPerPixel;
   1.144 @@ -440,16 +440,16 @@
   1.145      }
   1.146  }
   1.147  
   1.148 -static SDL_loblit bitmap_blit[] = {
   1.149 +static SDL_BlitFunc bitmap_blit[] = {
   1.150      NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
   1.151  };
   1.152  
   1.153 -static SDL_loblit colorkey_blit[] = {
   1.154 +static SDL_BlitFunc colorkey_blit[] = {
   1.155      NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
   1.156  };
   1.157  
   1.158 -SDL_loblit
   1.159 -SDL_CalculateBlit0(SDL_Surface * surface, int blit_index)
   1.160 +SDL_BlitFunc
   1.161 +SDL_CalculateBlit0(SDL_Surface * surface)
   1.162  {
   1.163      int which;
   1.164  
   1.165 @@ -462,17 +462,17 @@
   1.166      } else {
   1.167          which = surface->map->dst->format->BytesPerPixel;
   1.168      }
   1.169 -    switch (blit_index) {
   1.170 -    case 0:                    /* copy */
   1.171 +    switch (surface->map->info.flags) {
   1.172 +    case 0:
   1.173          return bitmap_blit[which];
   1.174  
   1.175 -    case 1:                    /* colorkey */
   1.176 +    case SDL_COPY_COLORKEY:
   1.177          return colorkey_blit[which];
   1.178  
   1.179 -    case 2:                    /* alpha */
   1.180 +    case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
   1.181          return which >= 2 ? BlitBtoNAlpha : NULL;
   1.182  
   1.183 -    case 4:                    /* alpha + colorkey */
   1.184 +    case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
   1.185          return which >= 2 ? BlitBtoNAlphaKey : NULL;
   1.186      }
   1.187      return NULL;