1: /* $Header: copy.c,v 10.3 86/02/01 15:46:31 tony Rel $ */
   2: /* copy.c	Copy one section of the framebuffer to another
   3:  *
   4:  *	CopyArea	Copies a section of the framebuffer
   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: CopyArea (srcx, srcy, width, height, dstx, dsty, clips, clipcount, func, zmask)
  39:     int srcx, srcy, width, height, dstx, dsty, clipcount, zmask;
  40:     register int func;
  41:     CLIP *clips;
  42: {
  43:     register CopyAreaPacket *cap;
  44: 
  45:     if (!(zmask & 1)) {
  46:         DeallocateSpace ();
  47:         return;
  48:     }
  49:     cap = (CopyAreaPacket *) AllocateSpace (sizeof (CopyAreaPacket));
  50:     if(cap == NULL) return;
  51: #define h ((PacketHeader *) cap->cap_head)
  52: #define src ((SubBitmap *) cap->cap_source.image)
  53: #define size ((Extent *) cap->cap_maskSize)
  54: #define destOff ((Point *) cap->cap_destOffset)
  55: #define clip ((RectangleList *) cap->cap_clipping.rectList)
  56: 
  57:     func = SSMap[func];
  58:     h->ph_copyMod.m_source = 1;
  59:     h->ph_copyMod.m_mask = 0;
  60:     h->ph_copyMod.m_map = MAPTYPE(func);
  61:     h->ph_opcode = COPY_AREA;
  62:     *(long *) h->ph_next = NULL;
  63: 
  64:     *(BitMap *) src->sb_base = screen;
  65:     src->sb_x = srcx;
  66:     src->sb_y = srcy;
  67:     size->e_height = height;
  68:     size->e_width = width;
  69: 
  70:     *(BitMap *) cap->cap_destImage = screen;
  71:     destOff->p_x = dstx;
  72:     destOff->p_y = dsty;
  73: 
  74:     *(short *) cap->cap_map.literal = MAPLIT(func);
  75: 
  76:     if (clipcount == 1) {
  77:         h->ph_copyMod.m_clipping = 1;
  78:         *(CLIP *) cap->cap_clipping.litRect = *clips;
  79:     } else {
  80:         h->ph_copyMod.m_clipping = 2;
  81:         *(caddr_t *) clip->r_first = (caddr_t) clips + VSReloc;
  82:         clip->r_count = clipcount;
  83:     }
  84: 
  85:     WritePacket ((caddr_t) cap);
  86: #undef h
  87: #undef src
  88: #undef size
  89: #undef destOff
  90: #undef clip
  91: }

Defined functions

CopyArea defined in line 38; never used

Defined macros

clip defined in line 55; used 3 times
destOff defined in line 54; used 3 times
h defined in line 51; used 8 times
size defined in line 53; used 3 times
src defined in line 52; used 4 times
Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 932
Valid CSS Valid XHTML 1.0 Strict