+ if (!*src)
+ {
+ src++;
+ dst++;
+ } else
+ *dst++=*src++;
+ }
+ } else
+ memcpy(dstptr, srcptr, area.width()*surface->bypp);
+ srcptr+=src.surface->stride;
+ dstptr+=surface->stride;
+ }
+ } else if ((surface->bpp == 32) && (src.surface->bpp==32))
+ {
+ __u32 *srcptr=(__u32*)src.surface->data;
+ __u32 *dstptr=(__u32*)surface->data;
+
+ srcptr+=srcarea.left()+srcarea.top()*src.surface->stride/4;
+ dstptr+=area.left()+area.top()*surface->stride/4;
+ for (int y=0; y<area.height(); y++)
+ {
+ if (flag & blitAlphaTest)
+ {
+ int width=area.width();
+ unsigned long *src=(unsigned long*)srcptr;
+ unsigned long *dst=(unsigned long*)dstptr;
+
+ while (width--)
+ {
+ if (!((*src)&0xFF000000))
+ {
+ src++;
+ dst++;
+ } else
+ *dst++=*src++;
+ }
+ } else if (flag & blitAlphaBlend)
+ {
+ // uh oh. this is only until hardware accel is working.
+
+ int width=area.width();
+ // ARGB color space!
+ unsigned char *src=(unsigned char*)srcptr;
+ unsigned char *dst=(unsigned char*)dstptr;
+
+#define BLEND(x, y, a) (y + ((x-y) * a)/256)
+ while (width--)
+ {
+ unsigned char sa = src[3];
+ unsigned char sr = src[2];
+ unsigned char sg = src[1];
+ unsigned char sb = src[0];
+
+ unsigned char da = dst[3];
+ unsigned char dr = dst[2];
+ unsigned char dg = dst[1];
+ unsigned char db = dst[0];
+
+ dst[3] = BLEND(0xFF, da, sa);
+ dst[2] = BLEND(sr, dr, sa);
+ dst[1] = BLEND(sg, dg, sa);
+ dst[0] = BLEND(sb, db, sa);
+#undef BLEND
+
+ src += 4; dst += 4;
+ }
+ } else
+ memcpy(dstptr, srcptr, area.width()*surface->bypp);
+ srcptr+=src.surface->stride/4;
+ dstptr+=surface->stride/4;
+ }
+ } else if ((surface->bpp == 32) && (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)
+ {
+ if (src.surface->clut.data && (i<src.surface->clut.colors))
+ pal[i]=(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
+ pal[i]=0x010101*i;
+ pal[i]^=0xFF000000;
+ }
+
+ srcptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride;
+ dstptr+=area.left()*surface->bypp+area.top()*surface->stride;
+ for (int y=0; y<area.height(); y++)