[comp.sys.amiga] DropShadow

hatcher@INGRES.BERKELEY.EDU.UUCP (03/08/87)

At the March FAUG meeting, I saw a program called dropshadow, which
put shadows around workbench windows. I (foolishly) assumed it was on
the new diskette I bought that night. Nope! Does anybody know where to
get this program? Anybody want to post it uuencoded? Or is it on a Fish
disk? (My latest is 53, haven't seen it).
	Doug

shf@solar.STANFORD.EDU (Stuart Ferguson) (04/30/87)

While people are discussing Workbench enhancements/improvements, why not
include _DropShadow_* as part of the environment?  I still find that one
of the neatest demos for the Amiga, as well as a great enhancement to
an already good graphic world.  Having the shadows really makes the
window "depth" arangement "intuitive."  :-)  The program could be sped up
and added as a Preferences option.

By the way, does anyone know how that program works?  Specifically: it
must add another bitplane to the Workbench screen but how does it do it?
Does it append the bitplane to the existing ones or does it allocate a
whole new screen and point the Workbench at it?

Always thankful for special tutoring,
	Stuart		shf@solar.Stanford.EDU

* I'd credit _DS_'s author here, but he didn't sign his name to his product.
Perhaps someone who knows can fill in the blank.

bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) (04/30/87)

In article <1555@solar.STANFORD.EDU> shf@solar.UUCP (Stuart Ferguson) writes:
>[why not] include _DropShadow_ [in V1.3]?  I still find that one
>of the neatest demos for the Amiga, as well as a great enhancement to
>
>By the way, does anyone know how that program works?  [...]
>* I'd credit _DS_'s author here, but he didn't sign his name to his product.
>Perhaps someone who knows can fill in the blank.

Sure! Here is an excerpt from the manual that comes with dropshadow V2.0:
and yes, dropshadow *LOOKS AWESOME!*




DropShadow V2 Rev 0 (C) Copyright James Mackraz, 1987
this version may be freely redistibuted
-----   -----------------------------------------   -----
Notes for Version 2, Revision 0                     April 7, 1987
Added the following from the wish list:

-A slider gadget is implemented to adjust the 3-dimensional
-distance between the planes of the windows.

-A slider gadget is implemented to adjust shadow darkness.  If
-desired, full independent control of the shadow colors is
-possible.
-----   -----------------------------------------   -----
Notes for Version 1, Revision 1                     March 12,1987

-When Windows are moved, created, sized, deleted, or depth-
-arranged, Intuition calls layers.library.  This program
-intercepts those calls to determine that the shadow needs
-to be recalculated.  Before this version, this recalculating
-and redrawing was done before Intuition got a chance to
-redraw Window borders and Gadgets.

-This version of DropShadow performs the work on its schedule,
-and is only signaled by the code which intercepts the
-layers calls.  This makes for a smoother and less dangerous
-implementation.

-Best with FAST ram, too slow otherwise.

mike@ames.UUCP (Mike Smithwick) (04/30/87)

[this is for the ravenous line-eating beast of Traal]

In article <1555@solar.STANFORD.EDU> shf@solar.UUCP (Stuart Ferguson) writes:
>By the way, does anyone know how that program works?  Specifically: it
>must add another bitplane to the Workbench screen but how does it do it?
>Does it append the bitplane to the existing ones or does it allocate a
>whole new screen and point the Workbench at it?
>	Stuart		shf@solar.Stanford.EDU
Yes it does add another bitplane to the existing WB screen. Then it goes
and twiddles with the layers library. The copy I have came with documentation
which explained a little about it. 

>* I'd credit _DS_'s author here, but he didn't sign his name to his product.

>Perhaps someone who knows can fill in the blank.
The author is Jim Mackraz, who took -=RJ=-s (tm) place on 1.2 intiution 
developement. 

Jim usually pops up at the BADGE meetings, so since you're at Stanford 
already, drop on in, and thank him in person.

I use 4 windowed systemms, the Mac, the Amy (natch!), a SUN-160 and Iris,, and
with both Dropshadow, and Dropcloth, in hi-res interlace, the Amy is clearly
the best looking of the bunch, screenwise.  
 
				  *** mike ***

Fortran? Just say no!

-- 
				   *** mike (powered by M&Ms) smithwick ***

"ever felt like life was a game, and 
 someone gave you the wrong instruction book?"

cmcmanis@sun.UUCP (04/30/87)

In article <1555@solar.STANFORD.EDU>, (Stuart Ferguson) writes:
> While people are discussing Workbench enhancements/improvements, why not
> include _DropShadow_* as part of the environment? 

Because it slows things down a bit? 
 
> By the way, does anyone know how that program works?  Specifically: it
> must add another bitplane to the Workbench screen but how does it do it?
> Does it append the bitplane to the existing ones or does it allocate a
> whole new screen and point the Workbench at it?
> 	Stuart		shf@solar.Stanford.EDU

Jim Mackraz wrote it but kept the source secret. However he had published
his dualpf program slightly earlier and the techniques seem to be similar.
You can allocate another bitplane for the Workbench screen using AllocRaster
and plugging the pointer into the bp->Planes[2] entry. Then set the 4
upper color registers to 'darker' versions of the workbench colors, diddle
the screen pointers to make it believe it is a 3 bitplane screen, and
voila whenever you draw a 1 bit in the new plane the user sees a shadow.
Of course that is the easy part, now you have to SetFunction() the Layers
library to let you know when the windows may have changed and update their
shadows. And you have to calculate the 'altitude' of the various windows
and figure out how to adjust the shadows etc. 


-- 
--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These views are my own and no one elses. They could be yours too, just
call MrgCop() and then ReThinkDisplay()!

billk@crash.UUCP (05/01/87)

> Specifically: it must add another bitplane to the Workbench screen but how
> does it do it?

It's easy to add more bitplanes to the Workbench Screen.  Just get the screen
structure pointer and index into it to get the sc_BitMap pointer.  Now just
use AllocRaster (once for each new bitplane) to allocate the extra bitplane(s)
you need.  Now stick them into the BitMap structure.  (In the WorkBench
screen, the first extra bitplane would go to sc_bitmap.bm_planes + 8)  Then
adjust the depth field so it matches the number of planes you now have in your
bitmap structure. 

I tried it -- it works fine. (I believe four bitplanes is the max for...yes.) 
The only thing you notice if you allot them and then don't do anything with
them is that window-sizings get slower.
                                                                Bill

hatcher@INGRES.BERKELEY.EDU.UUCP (05/01/87)

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 *********************/

sdl@linus.UUCP (Steven D. Litvintchouk) (05/02/87)

Posting-Front-End: GNU Emacs 18.41.1 of Thu Apr  9 1987 on linus (berkeley-unix)



>  Sure! Here is an excerpt from the manual that comes with dropshadow V2.0:
>  and yes, dropshadow *LOOKS AWESOME!*
>  DropShadow V2 Rev 0 (C) Copyright James Mackraz, 1987
>  this version may be freely redistibuted

Where can I get ahold of a copy of DropShadow V2.0?  I currently have
only V1.0 (which I agree is great!).



Steven Litvintchouk
MITRE Corporation
Burlington Road
Bedford, MA  01730

Fone:  (617)271-7753
ARPA:  sdl@mitre-bedford
UUCP:  ...{cbosgd,decvax,genrad,ll-xn,philabs,security,utzoo}!linus!sdl