1: /* $Header: fill.c,v 10.3 86/02/01 15:46:50 tony Rel $ */
   2: /* fill.c	Perform a simple raster operation a section of the screen
   3:  *
   4:  *	PixFill	Do a function on the screen
   5:  *
   6:  */
   7: 
   8: /****************************************************************************
   9:  *									    *
  10:  *  Copyright (c) 1983, 1984 by						    *
  11:  *  DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts.		    *
  12:  *  All rights reserved.						    *
  13:  * 									    *
  14:  *  This software is furnished on an as-is basis and may be used and copied *
  15:  *  only with inclusion of the above copyright notice. This software or any *
  16:  *  other copies thereof may be provided or otherwise made available to     *
  17:  *  others only for non-commercial purposes.  No title to or ownership of   *
  18:  *  the software is hereby transferred.					    *
  19:  * 									    *
  20:  *  The information in this software is  subject to change without notice   *
  21:  *  and  should  not  be  construed as  a commitment by DIGITAL EQUIPMENT   *
  22:  *  CORPORATION.							    *
  23:  * 									    *
  24:  *  DIGITAL assumes no responsibility for the use  or  reliability of its   *
  25:  *  software on equipment which is not supplied by DIGITAL.		    *
  26:  * 									    *
  27:  *									    *
  28:  ****************************************************************************/
  29: 
  30: #include "vs100.h"
  31: 
  32: extern BitMap screen;
  33: extern int VSReloc;
  34: extern char SSMap[];
  35: 
  36: char *AllocateSpace();
  37: 
  38: PixFill (srcpix, xymask, dstx, dsty, width, height, clips, clipcount,
  39:      func, zmask)
  40:     int srcpix, dstx, dsty, width, height, clipcount, zmask;
  41:     register BITMAP *xymask;
  42:     register int func;
  43:     CLIP *clips;
  44: {
  45:     register CopyAreaPacket *cap;
  46: #define h ((PacketHeader *) cap->cap_head)
  47: #define mask ((SubBitmap *) cap->cap_sourceMask)
  48: #define size ((Extent *) cap->cap_maskSize)
  49: #define destOff ((Point *) cap->cap_destOffset)
  50: #define clip ((RectangleList *) cap->cap_clipping.rectList)
  51: 
  52:     if (!(zmask & 1)) {
  53:         DeallocateSpace ();
  54:         return;
  55:     }
  56:     cap = (CopyAreaPacket *) AllocateSpace (sizeof (CopyAreaPacket));
  57:     if (cap == NULL) return;
  58: 
  59:     func = SSMap[func];
  60:     h->ph_copyMod.m_source = 0;
  61:     h->ph_copyMod.m_mask = xymask ? 1 : 0;
  62:     h->ph_copyMod.m_map = MAPTYPE(func);
  63:     h->ph_opcode = COPY_AREA;
  64:     *(long *) h->ph_next = NULL;
  65: 
  66:     cap->cap_source.const = srcpix & 1;
  67: 
  68:     if (xymask) {
  69:         *(caddr_t *) mask->sb_address = BDATA(xymask)->vsPtr;
  70:         mask->sb_height = xymask->height;
  71:         mask->sb_width = xymask->width;
  72:         mask->sb_bitsPerPixel = 1;
  73:         mask->sb_x = mask->sb_y = 0;
  74:     }
  75:     size->e_height = height;
  76:     size->e_width = width;
  77: 
  78:     *(BitMap *) cap->cap_destImage = screen;
  79:     destOff->p_x = dstx;
  80:     destOff->p_y = dsty;
  81: 
  82:     *(short *) cap->cap_map.literal = MAPLIT(func);
  83: 
  84:     if (clipcount == 1) {
  85:         h->ph_copyMod.m_clipping = 1;
  86:         *(CLIP *) cap->cap_clipping.litRect = *clips;
  87:     } else {
  88:         h->ph_copyMod.m_clipping = 2;
  89:         *(caddr_t *) clip->r_first = (caddr_t) clips + VSReloc;
  90:         clip->r_count = clipcount;
  91:     }
  92: 
  93:     WritePacket ((caddr_t) cap);
  94: #undef h
  95: #undef mask
  96: #undef size
  97: #undef destOff
  98: #undef clip
  99: }

Defined functions

PixFill defined in line 38; never used

Defined macros

clip defined in line 50; used 3 times
destOff defined in line 49; used 3 times
h defined in line 46; used 8 times
mask defined in line 47; used 7 times
size defined in line 48; used 3 times
Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 841
Valid CSS Valid XHTML 1.0 Strict