changeset 2853:6258fa7cd300

Fixed picking blit function when RLE fails
author Sam Lantinga <slouken@libsdl.org>
date Sun, 07 Dec 2008 22:37:40 +0000
parents 7046f9567045
children e92d58afcbda
files 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
diffstat 6 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/SDL_blit.h	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_blit.h	Sun Dec 07 22:37:40 2008 +0000
@@ -52,6 +52,7 @@
 #define SDL_COPY_RLE_DESIRED        0x00001000
 #define SDL_COPY_RLE_COLORKEY       0x00002000
 #define SDL_COPY_RLE_ALPHAKEY       0x00004000
+#define SDL_COPY_RLE_MASK           (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)
 
 /* SDL blit CPU flags */
 #define SDL_CPU_ANY                 0x00000000
--- a/src/video/SDL_blit_0.c	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_blit_0.c	Sun Dec 07 22:37:40 2008 +0000
@@ -465,7 +465,7 @@
     } else {
         which = surface->map->dst->format->BytesPerPixel;
     }
-    switch (surface->map->info.flags) {
+    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     case 0:
         return bitmap_blit[which];
 
--- a/src/video/SDL_blit_1.c	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_blit_1.c	Sun Dec 07 22:37:40 2008 +0000
@@ -532,7 +532,7 @@
     } else {
         which = dstfmt->BytesPerPixel;
     }
-    switch (surface->map->info.flags) {
+    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     case 0:
         return one_blit[which];
 
--- a/src/video/SDL_blit_A.c	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_blit_A.c	Sun Dec 07 22:37:40 2008 +0000
@@ -2153,7 +2153,7 @@
     SDL_PixelFormat *sf = surface->format;
     SDL_PixelFormat *df = surface->map->dst->format;
 
-    switch (surface->map->info.flags) {
+    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     case SDL_COPY_BLEND:
         /* Per-pixel alpha blits */
         switch (df->BytesPerPixel) {
--- a/src/video/SDL_blit_N.c	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_blit_N.c	Sun Dec 07 22:37:40 2008 +0000
@@ -2430,7 +2430,7 @@
         return (NULL);
     }
 
-    switch (surface->map->info.flags) {
+    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
     case 0:
         blitfun = NULL;
         if (dstfmt->BitsPerPixel == 8) {
--- a/src/video/SDL_surface.c	Sun Dec 07 22:29:58 2008 +0000
+++ b/src/video/SDL_surface.c	Sun Dec 07 22:37:40 2008 +0000
@@ -548,7 +548,7 @@
         return 0;
     }
 
-    switch (surface->map->info.flags & (SDL_COPY_NEAREST)) {
+    switch (surface->map->info.flags & SDL_COPY_NEAREST) {
     case SDL_COPY_NEAREST:
         *scaleMode = SDL_TEXTURESCALEMODE_FAST;
         break;