home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
x
/
xibm.zip
/
apa16
/
apa16PolyPt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-30
|
3KB
|
106 lines
/***********************************************************
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16PolyPt.c,v 5.0 1991/12/30 19:22:51 jfc Exp $ */
#include "X.h"
#include "pixmapstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "miscstruct.h"
#include "regionstr.h"
#include "scrnintstr.h"
#include "apa16Hdwr.h"
#include "mfb.h"
void
apa16PolyPoint(pDrawable, pGC, mode, npt, pptInit)
register DrawablePtr pDrawable;
GCPtr pGC;
int mode; /* Origin or Previous */
int npt;
xPoint *pptInit;
{
register BoxPtr pbox;
register int nbox;
int nptTmp;
register xPoint *ppt;
register int rop;
mfbPrivGC *pGCPriv;
if (!(pGC->planemask & 1))
return;
pGCPriv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
rop = pGCPriv->rop;
if (rop == RROP_NOP)
return;
if (pDrawable->type != DRAWABLE_WINDOW)
{
mfbPolyPoint(pDrawable, pGC, mode, npt, pptInit);
return;
}
if ((mode == CoordModePrevious) && (npt > 1))
{
for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++)
{
ppt->x += (ppt-1)->x;
ppt->y += (ppt-1)->y;
}
}
QUEUE_WAIT();
if (rop == RROP_BLACK)
MR = (MR_DEFAULT & MERGE_MODE_MASK) | MERGE_BLACK;
else if (rop == RROP_WHITE)
MR = (MR_DEFAULT & MERGE_MODE_MASK) | MERGE_WHITE;
else /* rop == RROP_INVERT */
MR = (MR_DEFAULT & MERGE_MODE_MASK) | MERGE_INVERT;
nbox = REGION_NUM_RECTS(pGCPriv->pCompositeClip);
pbox = REGION_RECTS(pGCPriv->pCompositeClip);
for (; --nbox >= 0; pbox++)
{
int x1 = pbox->x1, x2 = pbox->x2;
int y1 = pbox->y1, y2 = pbox->y2;
for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++)
{
register int x;
register int y;
x = ppt->x + pDrawable->x;
y = ppt->y + pDrawable->y;
if (x >= x1 && x < x2 && y >= y1 && y < y2)
*((volatile unsigned short *)APA16_BASE + (y * APA16_WIDTH / 16) + (x >> 4)) = 1 << (~x & 0xf);
}
}
apa16Qmerge_mode_old = MERGE_COPY;
MR = MR_DEFAULT;
}