src/video/SDL_blit_A.c
changeset 12585 dff36de37426
parent 12503 806492103856
equal deleted inserted replaced
12584:233b2a61cad1 12585:dff36de37426
  1274     switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
  1274     switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
  1275     case SDL_COPY_BLEND:
  1275     case SDL_COPY_BLEND:
  1276         /* Per-pixel alpha blits */
  1276         /* Per-pixel alpha blits */
  1277         switch (df->BytesPerPixel) {
  1277         switch (df->BytesPerPixel) {
  1278         case 1:
  1278         case 1:
  1279             return BlitNto1PixelAlpha;
  1279             if (df->palette != NULL) {
       
  1280                 return BlitNto1PixelAlpha;
       
  1281             } else {
       
  1282                 /* RGB332 has no palette ! */
       
  1283                 return BlitNtoNPixelAlpha;
       
  1284             }
  1280 
  1285 
  1281         case 2:
  1286         case 2:
  1282                 if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
  1287                 if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
  1283                     && sf->Gmask == 0xff00
  1288                     && sf->Gmask == 0xff00
  1284                     && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
  1289                     && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
  1324     case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
  1329     case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
  1325         if (sf->Amask == 0) {
  1330         if (sf->Amask == 0) {
  1326             /* Per-surface alpha blits */
  1331             /* Per-surface alpha blits */
  1327             switch (df->BytesPerPixel) {
  1332             switch (df->BytesPerPixel) {
  1328             case 1:
  1333             case 1:
  1329                 return BlitNto1SurfaceAlpha;
  1334                 if (df->palette != NULL) {
       
  1335                     return BlitNto1SurfaceAlpha;
       
  1336                 } else {
       
  1337                     /* RGB332 has no palette ! */
       
  1338                     return BlitNtoNSurfaceAlpha;
       
  1339                 }
  1330 
  1340 
  1331             case 2:
  1341             case 2:
  1332                 if (surface->map->identity) {
  1342                 if (surface->map->identity) {
  1333                     if (df->Gmask == 0x7e0) {
  1343                     if (df->Gmask == 0x7e0) {
  1334 #ifdef __MMX__
  1344 #ifdef __MMX__
  1372         break;
  1382         break;
  1373 
  1383 
  1374     case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
  1384     case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
  1375         if (sf->Amask == 0) {
  1385         if (sf->Amask == 0) {
  1376             if (df->BytesPerPixel == 1) {
  1386             if (df->BytesPerPixel == 1) {
  1377                 return BlitNto1SurfaceAlphaKey;
  1387 
       
  1388                 if (df->palette != NULL) {
       
  1389                     return BlitNto1SurfaceAlphaKey;
       
  1390                 } else {
       
  1391                     /* RGB332 has no palette ! */
       
  1392                     return BlitNtoNSurfaceAlphaKey;
       
  1393                 }
  1378             } else {
  1394             } else {
  1379                 return BlitNtoNSurfaceAlphaKey;
  1395                 return BlitNtoNSurfaceAlphaKey;
  1380             }
  1396             }
  1381         }
  1397         }
  1382         break;
  1398         break;