Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!ames!ucbcad!ucbvax!INGRES.BERKELEY.EDU!hatcher From: hatcher@INGRES.BERKELEY.EDU.UUCP Newsgroups: comp.sys.amiga Subject: Re: Dropshadow Message-ID: <8705010752.AA10059@ingres.Berkeley.EDU> Date: Fri, 1-May-87 03:52:01 EDT Article-I.D.: ingres.8705010752.AA10059 Posted: Fri May 1 03:52:01 1987 Date-Received: Sat, 2-May-87 03:46:09 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: University of California, Berkeley Lines: 87 Summary: Here's source to add bitplane to WB Recently there has been some interest in how Jim Mackraz added a bitplane to Workbench in his Dropshadow program. He is still keeping the source to Dropshadow secret last I heard, but he was kind enough to release an excerpt from it on a local BBS (the part that adds the extra bitplane). Here it is; keep in mind that this is a code *fragment*, so presumably you should use it as a springboard rather than try to use it without looking it over! I added a C-style comment to the very end so you'd know whether you received it intact or not. Enjoy, Doug Merritt ucbvax!ingres!hatcher P.S. Chuck McManis's recent (4/30) explanation of the method would probably accompany this quite well; you did save it didn't you? ----------------------- apply andy's drill here ------------------------ Date: 10-APR-87 01:03 AM Subj: From Jim Mackraz- Code (F) wbscreen = window->WScreen; /* find it */ /* new 3-deep bitmap will replace the one in WB's RInfo */ if (!(ribitmap = (struct BitMap *) AllocMem((LONG) sizeof(struct BitMap), (LONG)MEMF_PUBLIC|MEMF_CLEAR))) { D( printf("alloc bitmap failed\n") ); goto EXITING; } InitBitMap(ribitmap, 3L, (LONG) wbscreen->Width, (LONG)wbscreen->Height); /* allocate bitmap for my rastport view of single bitplane */ if (!(bmap2 = (struct BitMap *) AllocMem((LONG) sizeof(struct BitMap), (LONG)MEMF_PUBLIC|MEMF_CLEAR))) { D( printf("alloc bitmap failed\n") ); goto EXITING; } /* my rendering bit map: depth 1 */ InitBitMap(bmap2, 1L, (LONG) wbscreen->Width, (LONG) wbscreen->Height); if (!(bmap2->Planes[0] = (UBYTE *) AllocRaster((LONG) wbscreen->Width, (LONG)wbscreen->Height))) { D( printf("alloc raster failed\n") ); goto EXITING; } /* get a rastport, and set it up for rendering into bmap2 */ if (!(rport2 = (struct RastPort *) AllocMem((LONG) sizeof (struct RastPort), (LONG) MEMF_PUBLIC))) { D( printf("alloc rastport failed\n") ); goto EXITING; } InitRastPort(rport2); rport2->BitMap = bmap2; SetRast(rport2, 0L); /* set up new bitmap for RInfo */ save_bitmap = wbscreen->ViewPort.RasInfo->BitMap; ribitmap->Planes[0] = save_bitmap->Planes[0]; ribitmap->Planes[1] = save_bitmap->Planes[1]; ribitmap->Planes[2] = bmap2->Planes[0]; Forbid(); /* add our extra plane to the bit-map as viewed by * the WB ViewPort (WB should never know the difference) */ wbscreen->ViewPort.RasInfo->BitMap = ribitmap; Permit(); it_is_done = 1; shadowColors(wbscreen); /* put viewport changed into effect */ MakeScreen(wbscreen); RethinkDisplay(); /**************************** end of code fragment *********************/