+ } else if ((surface->bpp == 16) && (src.surface->bpp==8))
+ {
+ __u8 *srcptr=(__u8*)src.surface->data;
+ __u8 *dstptr=(__u8*)surface->data; // !!
+ __u32 pal[256];
+
+ for (int i=0; i<256; ++i)
+ {
+ __u32 icol;
+ if (src.surface->clut.data && (i<src.surface->clut.colors))
+ icol=(src.surface->clut.data[i].a<<24)|(src.surface->clut.data[i].r<<16)|(src.surface->clut.data[i].g<<8)|(src.surface->clut.data[i].b);
+ else
+ icol=0x010101*i;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ pal[i] = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+ pal[i] = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+ pal[i]^=0xFF000000;
+ }
+
+ srcptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride;
+ dstptr+=area.left()*surface->bypp+area.top()*surface->stride;
+
+ if (flag & blitAlphaBlend)
+ eWarning("ignore unsupported 8bpp -> 16bpp alphablend!");
+
+ for (int y=0; y<area.height(); y++)
+ {
+ int width=area.width();
+ unsigned char *psrc=(unsigned char*)srcptr;
+ __u16 *dst=(__u16*)dstptr;
+ if (flag & blitAlphaTest)
+ blit_8i_to_16_at(dst, psrc, pal, width);
+ else
+ blit_8i_to_16(dst, psrc, pal, width);
+ srcptr+=src.surface->stride;
+ dstptr+=surface->stride;
+ }
+ } else if ((surface->bpp == 16) && (src.surface->bpp==32))
+ {
+ __u8 *srcptr=(__u8*)src.surface->data;
+ __u8 *dstptr=(__u8*)surface->data;
+
+ srcptr+=srcarea.left()+srcarea.top()*src.surface->stride;
+ dstptr+=area.left()+area.top()*surface->stride;
+
+ if (flag & blitAlphaBlend)
+ eWarning("ignore unsupported 32bpp -> 16bpp alphablend!");
+
+ for (int y=0; y<area.height(); y++)
+ {
+ int width=area.width();
+ __u32 *srcp=(__u32*)srcptr;
+ __u16 *dstp=(__u16*)dstptr;
+
+ if (flag & blitAlphaTest)
+ {
+ while (width--)
+ {
+ if (!((*srcp)&0xFF000000))
+ {
+ srcp++;
+ dstp++;
+ } else
+ {
+ __u32 icol = *srcp++;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+ *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+ }
+ }
+ } else
+ {
+ while (width--)
+ {
+ __u32 icol = *srcp++;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+ *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+ }
+ }
+ srcptr+=src.surface->stride;
+ dstptr+=surface->stride;
+ }