[comp.sys.mac.programmer] Question about "GrafPort transfer modes"..

franco@bbn.com (Frank A. Lonigro) (12/01/88)

OK, I realy need some help here!!  I'm running system software 5.0 on a 
Mac Plus with 2Megs of RAM and trying a little animation testing using
THINK C 3.0.  If I understand transfer modes correctly the following
simple peace of code should OR the picture I want to display in the current
grafport with the current grafports background, in doing so, the white part
of the picture should not white out the grey background under it, but no
matter what I've tryed, the white part of the picture wipes out the background.

Am I missing something or is something wrong with transfer modes????

Thanks very much in advance and please e-mail me directly and I'll post a
summory later.

-franco
franco@bbn.com
franco%bbn.com@relay.cs.net
...!harvard!bbn!franco

/* Simple animation code */
Animate (dialog)
DialogPtr dialog;
{
        int             i;
        int             itemType;
        Handle          itemHandle;
        Rect            itemRect;
        PicHandle       thePicture;
        PenState        pnState;
        GrafPtr         curPort;

        GetPort (&curPort);
        SetPort (dialog);

	GetPenState (&pnState);
        PenMode (patOr);

        GetDItem (dialog, boardH8, &itemType, &itemHandle, &itemRect);
        itemRect.left += 7;
        itemRect.top += 5;
        itemRect.right -= 7;
        itemRect.bottom -= 3; /* 32 x 32 bits   */

        thePicture = GetPicture(wrookPict);
        HLock(thePicture);

        for (i=1; i < 275; i++) {
                DrawPicture(thePicture, &itemRect);
                OffsetRect (&itemRect, 0, 1);
        }

        HUnlock(thePicture);

	SetPenState (&pnState);
        SetPort (curPort);        
}

====    =============    ==============================
====    =============    ==============================
====    =============    ==============================
====             ====             ====             ====
====             ====             ====             ====
====    =====    ====    =====    ====    =====    ====
====    =====    ====    =====    ====    =====    ====
====    =====    ====    =====    ====    =====    ====
====    =====    ====    =====    ====    =====    ====
====             ====             ====    =====    ====
====             ====             ====    =====    ====
=======================================================
=======================================================
=======================================================