src/video/SDL_blit_A.c
changeset 12585 dff36de37426
parent 12503 806492103856
     1.1 --- a/src/video/SDL_blit_A.c	Wed Jan 30 16:36:47 2019 +0100
     1.2 +++ b/src/video/SDL_blit_A.c	Wed Jan 30 17:16:08 2019 +0100
     1.3 @@ -1276,7 +1276,12 @@
     1.4          /* Per-pixel alpha blits */
     1.5          switch (df->BytesPerPixel) {
     1.6          case 1:
     1.7 -            return BlitNto1PixelAlpha;
     1.8 +            if (df->palette != NULL) {
     1.9 +                return BlitNto1PixelAlpha;
    1.10 +            } else {
    1.11 +                /* RGB332 has no palette ! */
    1.12 +                return BlitNtoNPixelAlpha;
    1.13 +            }
    1.14  
    1.15          case 2:
    1.16                  if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
    1.17 @@ -1326,7 +1331,12 @@
    1.18              /* Per-surface alpha blits */
    1.19              switch (df->BytesPerPixel) {
    1.20              case 1:
    1.21 -                return BlitNto1SurfaceAlpha;
    1.22 +                if (df->palette != NULL) {
    1.23 +                    return BlitNto1SurfaceAlpha;
    1.24 +                } else {
    1.25 +                    /* RGB332 has no palette ! */
    1.26 +                    return BlitNtoNSurfaceAlpha;
    1.27 +                }
    1.28  
    1.29              case 2:
    1.30                  if (surface->map->identity) {
    1.31 @@ -1374,7 +1384,13 @@
    1.32      case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
    1.33          if (sf->Amask == 0) {
    1.34              if (df->BytesPerPixel == 1) {
    1.35 -                return BlitNto1SurfaceAlphaKey;
    1.36 +
    1.37 +                if (df->palette != NULL) {
    1.38 +                    return BlitNto1SurfaceAlphaKey;
    1.39 +                } else {
    1.40 +                    /* RGB332 has no palette ! */
    1.41 +                    return BlitNtoNSurfaceAlphaKey;
    1.42 +                }
    1.43              } else {
    1.44                  return BlitNtoNSurfaceAlphaKey;
    1.45              }