All pastes #920801 Raw Edit

Someone

public c v1 · immutable
#920801 ·published 2008-02-27 16:54 UTC
rendered paste body
static void BlitNtoN(SDL_BlitInfo *info){        int width = info->d_width;        int height = info->d_height;        Uint8 *src = info->s_pixels;        int srcskip = info->s_skip;        Uint8 *dst = info->d_pixels;        int dstskip = info->d_skip;        SDL_PixelFormat *srcfmt = info->src;        int srcbpp = srcfmt->BytesPerPixel;        SDL_PixelFormat *dstfmt = info->dst;        int dstbpp = dstfmt->BytesPerPixel;        unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;        while ( height-- ) {                DUFFS_LOOP(                {                        Uint32 Pixel;                        unsigned sR;                        unsigned sG;                        unsigned sB;                        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);                        ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);                        dst += dstbpp;                        src += srcbpp;                },                width);                src += srcskip;                dst += dstskip;        }}