--- fbportrait_right.c 2001-06-21 08:32:41.000000000 +0200 +++ fbportrait_right.c.new 2007-01-02 09:07:01.000000000 +0100 @@ -52,9 +52,9 @@ fbportrait_fillrect(PSD psd,MWCOORD x1, MWCOORD y1, MWCOORD x2, MWCOORD y2, MWPIXELVAL c) { - while(x2 <= x1) + while(x1 <= x2) psd->orgsubdriver->DrawHorzLine(psd, psd->yvirtres-y2-1, - psd->yvirtres-y1-1, x2++, c); + psd->yvirtres-y1-1, x1++, c); } static void @@ -70,19 +70,83 @@ MWCOORD dsth, PSD srcpsd, MWCOORD srcx, MWCOORD srcy, MWCOORD srcw, MWCOORD srch, long op) { - //dstpsd->orgsubdriver->StretchBlit(dstpsd, dstpsd->yvirtres-desty-dsth, destx, - //dsth, dstw, srcpsd, srcpsd->yvirtres-srcy-srch, srcx, - //srch, srcw, op); + dstpsd->orgsubdriver->StretchBlit(dstpsd, dstpsd->yvirtres-desty-dsth, destx, + dsth, dstw, srcpsd, srcpsd->yvirtres-srcy-srch, srcx, + srch, srcw, op); } +static void +fbportrait_drawarea_alphacol(PSD dstpsd, driver_gc_t * gc) +{ + driver_gc_t l_gc; + ADDR8 alpha_in, alpha_out; + int in_x, in_y; + int in_w, in_h; + int out_x, out_y; + int out_w, out_h; + + l_gc = *gc; + l_gc.dstx = dstpsd->yvirtres - gc->dsty - gc->dsth; + l_gc.dsty = gc->dstx; + l_gc.dstw = gc->dsth; + l_gc.dsth = gc->dstw; + + l_gc.srcx = 0; + l_gc.srcy = 0; + l_gc.src_linelen = l_gc.dstw; + if (!(l_gc.misc = malloc(l_gc.dstw * l_gc.dsth))) { + return; + } + + alpha_in = ((ADDR8) gc->misc) + gc->src_linelen * gc->srcy + gc->srcx; + in_w = gc->dstw; + in_h = gc->dsth; + + alpha_out = l_gc.misc; + out_w = l_gc.dstw; + out_h = l_gc.dsth; + + for (in_y = 0; in_y < in_h; in_y++) { + for (in_x = 0; in_x < in_w; in_x++) { + out_y = in_x; + out_x = ((out_w - 1) - in_y); + + alpha_out[((out_y * out_w) + out_x)] = alpha_in[((in_y * in_w) + in_x)]; + } + } + + dstpsd->orgsubdriver->DrawArea(dstpsd, &l_gc, PSDOP_ALPHACOL); + + free((void *)l_gc.misc); +} + +static void +fbportrait_drawarea(PSD dstpsd, driver_gc_t * gc, int op) +{ + if (!dstpsd->orgsubdriver->DrawArea) { + return; + } + + switch(op) { +#if MW_FEATURE_PSDOP_ALPHACOL + case PSDOP_ALPHACOL: + fbportrait_drawarea_alphacol(dstpsd, gc); + break; +#endif /* MW_FEATURE_PSDOP_ALPHACOL */ + + default: + break; + } + +} SUBDRIVER fbportrait_right = { NULL, fbportrait_drawpixel, fbportrait_readpixel, fbportrait_drawhorzline, fbportrait_drawvertline, - gen_fillrect, + fbportrait_fillrect, // gen_fillrect, fbportrait_blit, - NULL, + fbportrait_drawarea, fbportrait_stretchblit };