WineD3D: add rgb24 colorkey conversion

Alexandre Julliard julliard at winehq.org
Mon Aug 14 13:02:43 CDT 2006


"Roderick Colenbrander" <thunderbird2k at gmx.net> writes:

> +            for (x = 0; x < len; x++) {
> +                /* Retrieve RGB24 color */
> +                DWORD color = *((DWORD*)src);
> +                /* Store the RGB portion in dest and reserve a byte for alpha */
> +                *Dest = color << 8;
> +                if ((color < surf->SrcBltCKey.dwColorSpaceLowValue) ||
> +                    (color > surf->SrcBltCKey.dwColorSpaceHighValue))
> +                    *Dest |= 0xff;
> +                src += 3;

You should avoid unaligned DWORD accesses, this doesn't work on all
platforms.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list