nanogui: 16bpp and 32bpp blitting broken
Subject:
16bpp and 32bpp blitting broken
From:
Greg Haerr ####@####.####
Date:
7 Jan 2000 18:05:41 -0000
Message-Id: <C1962B36D9BBD311B0F80060083DFEFB01E627@SYS.CenSoft.COM>
Kyle,
Attached is a rewritten fblin16.c function, for speed.
It incorporates your patch, slightly rewritten. Could you please
check that it works?
Also, from inspection it appears that fblin32.c has the same
problem. Both of these fixes will appear in the next cut.
/* srccopy bitblt, opcode is currently ignored*/
void
linear16_blit(PSD dstpsd, COORD dstx, COORD dsty, COORD w, COORD h,
PSD srcpsd, COORD srcx, COORD srcy, int op)
{
ADDR16 dst = dstpsd->addr;
ADDR16 src = srcpsd->addr;
int i;
int dlinelen = dstpsd->linelen;
int slinelen = srcpsd->linelen;
assert (dst != 0);
assert (dstx >= 0 && dstx < dstpsd->xres);
assert (dsty >= 0 && dsty < dstpsd->yres);
assert (w > 0);
assert (h > 0);
assert (src != 0);
assert (srcx >= 0 && srcx < srcpsd->xres);
assert (srcy >= 0 && srcy < srcpsd->yres);
assert (dstx+w <= dstpsd->xres);
assert (dsty+h <= dstpsd->yres);
assert (srcx+w <= srcpsd->xres);
assert (srcy+h <= srcpsd->yres);
DRAWON;
dst += dstx + dsty * dlinelen;
src += srcx + srcy * slinelen;
while(--h >= 0) {
#if 0
/* a _fast_ memcpy is a _must_ in this routine*/
wmemcpy(dst, src, w);
dst += dlinelen;
src += slinelen;
#else
for(i=0; i<w; ++i)
*dst++ = *src++;
dst += dlinelen - w;
src += slinelen - w;
#endif
}
DRAWOFF;
}