Fixed picking blit function when RLE fails
authorSam Lantinga <slouken@libsdl.org>
Sun, 07 Dec 2008 22:37:40 +0000
changeset 28536258fa7cd300
parent 2852 7046f9567045
child 2854 e92d58afcbda
Fixed picking blit function when RLE fails
src/video/SDL_blit.h
src/video/SDL_blit_0.c
src/video/SDL_blit_1.c
src/video/SDL_blit_A.c
src/video/SDL_blit_N.c
src/video/SDL_surface.c
     1.1 --- a/src/video/SDL_blit.h	Sun Dec 07 22:29:58 2008 +0000
     1.2 +++ b/src/video/SDL_blit.h	Sun Dec 07 22:37:40 2008 +0000
     1.3 @@ -52,6 +52,7 @@
     1.4  #define SDL_COPY_RLE_DESIRED        0x00001000
     1.5  #define SDL_COPY_RLE_COLORKEY       0x00002000
     1.6  #define SDL_COPY_RLE_ALPHAKEY       0x00004000
     1.7 +#define SDL_COPY_RLE_MASK           (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)
     1.8  
     1.9  /* SDL blit CPU flags */
    1.10  #define SDL_CPU_ANY                 0x00000000
     2.1 --- a/src/video/SDL_blit_0.c	Sun Dec 07 22:29:58 2008 +0000
     2.2 +++ b/src/video/SDL_blit_0.c	Sun Dec 07 22:37:40 2008 +0000
     2.3 @@ -465,7 +465,7 @@
     2.4      } else {
     2.5          which = surface->map->dst->format->BytesPerPixel;
     2.6      }
     2.7 -    switch (surface->map->info.flags) {
     2.8 +    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     2.9      case 0:
    2.10          return bitmap_blit[which];
    2.11  
     3.1 --- a/src/video/SDL_blit_1.c	Sun Dec 07 22:29:58 2008 +0000
     3.2 +++ b/src/video/SDL_blit_1.c	Sun Dec 07 22:37:40 2008 +0000
     3.3 @@ -532,7 +532,7 @@
     3.4      } else {
     3.5          which = dstfmt->BytesPerPixel;
     3.6      }
     3.7 -    switch (surface->map->info.flags) {
     3.8 +    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     3.9      case 0:
    3.10          return one_blit[which];
    3.11  
     4.1 --- a/src/video/SDL_blit_A.c	Sun Dec 07 22:29:58 2008 +0000
     4.2 +++ b/src/video/SDL_blit_A.c	Sun Dec 07 22:37:40 2008 +0000
     4.3 @@ -2153,7 +2153,7 @@
     4.4      SDL_PixelFormat *sf = surface->format;
     4.5      SDL_PixelFormat *df = surface->map->dst->format;
     4.6  
     4.7 -    switch (surface->map->info.flags) {
     4.8 +    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     4.9      case SDL_COPY_BLEND:
    4.10          /* Per-pixel alpha blits */
    4.11          switch (df->BytesPerPixel) {
     5.1 --- a/src/video/SDL_blit_N.c	Sun Dec 07 22:29:58 2008 +0000
     5.2 +++ b/src/video/SDL_blit_N.c	Sun Dec 07 22:37:40 2008 +0000
     5.3 @@ -2430,7 +2430,7 @@
     5.4          return (NULL);
     5.5      }
     5.6  
     5.7 -    switch (surface->map->info.flags) {
     5.8 +    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     5.9      case 0:
    5.10          blitfun = NULL;
    5.11          if (dstfmt->BitsPerPixel == 8) {
     6.1 --- a/src/video/SDL_surface.c	Sun Dec 07 22:29:58 2008 +0000
     6.2 +++ b/src/video/SDL_surface.c	Sun Dec 07 22:37:40 2008 +0000
     6.3 @@ -548,7 +548,7 @@
     6.4          return 0;
     6.5      }
     6.6  
     6.7 -    switch (surface->map->info.flags & (SDL_COPY_NEAREST)) {
     6.8 +    switch (surface->map->info.flags & SDL_COPY_NEAREST) {
     6.9      case SDL_COPY_NEAREST:
    6.10          *scaleMode = SDL_TEXTURESCALEMODE_FAST;
    6.11          break;