| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | |
| | | while (info->dst_h--) { |
| | | Uint8 *src = 0; |
| | | Uint8 *dst = (Uint8 *) info->dst; |
| | | Uint8 *dst = info->dst; |
| | | int n = info->dst_w; |
| | | srcx = -1; |
| | | posx = 0x10000L; |
| | |
| | | srcB = (srcB * srcA) / 255; |
| | | } |
| | | } |
| | | switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) { |
| | | switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { |
| | | case 0: |
| | | dstR = srcR; |
| | | dstG = srcG; |
| | |
| | | dstG = (srcG * dstG) / 255; |
| | | dstB = (srcB * dstB) / 255; |
| | | break; |
| | | case SDL_COPY_MUL: |
| | | dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; |
| | | if (dstR > 255) |
| | | dstR = 255; |
| | | dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; |
| | | if (dstG > 255) |
| | | dstG = 255; |
| | | dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; |
| | | if (dstB > 255) |
| | | dstB = 255; |
| | | dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; |
| | | if (dstA > 255) |
| | | dstA = 255; |
| | | break; |
| | | } |
| | | if (dst_fmt->Amask) { |
| | | ASSEMBLE_RGBA(dst, dstbpp, dst_fmt, dstR, dstG, dstB, dstA); |