Path: utzoo!utgpu!water!watmath!clyde!bellcore!tness7!tness1!nuchat!uunet!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: Cookie Cut BltBitMap Keywords: function needed Message-ID: <4177@cbmvax.UUCP> Date: 3 Jul 88 00:03:00 GMT References: <406@icus.UUCP> <58733@sun.uucp> <2238@sugar.UUCP> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Organization: Commodore Technology, West Chester, PA Lines: 40 In article <2238@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >In article <58733@sun.uucp>, cmcmanis@sun.uucp (Chuck McManis) writes: >> Assuming you have a 4 plane >> screen (16 colors), set up each blit with the "A" source pointing >> at your unit's image, the "B" source pointing at the terrain image, >> and the "D"estination pointed at your real image. The minterm you >> will use is A+~AB which is "bit from A if it is non zero, otherwise >> take the bit from B", >I think you would still need a mask, since in a given bitplane a bit might >be zero in A, 1 in B, but still be in the object represented by A. You need >to or all the bitplanes in A together to produce the mask (in C). You can >do this with the blitter, and you might be able to do it in setup. Then you >do AC+B~C... Exactly correct, the "cookie cutter" blit. As a word of advise, with a "fake" bitmap that has all planes pointing to on bitplane a BltBitMap(srcBM,0,0,fakeBM,0,0,sizex,sizey,0xE0,-1L,NULL) will create your mask for you. >Isn't there already a function that does this? Nope, now that I look, there >isn't. Why isn't there a general Blt function? > > Blt(src1, src1x, src1y, src2, src2x, src2y, src3, src3x, src3y, > destrp, destx, desty, sizex, sizey, minterm); > >Or is this the function you mentioned in BlitLab? If so, does the blitlab >function go through the layers library? I'd love such a function too. Unfortunately, for certain cases arbitrary rectangle operations require the A source for a mask. Tom can explain it better than I. I think the killer is when the sources must be shifted in different directions, or when the byte counts are wrong, or some such; and the FWM/LWM don't always hit the right word. It's part of the problem of having a BIMMER, not a BLITTER. We deal with words, not bits. -- Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup