|
|
1.1 ! root 1: /* ! 2: * $Source: /u1/X/libis/RCS/put.c,v $ ! 3: * $Header: put.c,v 1.1 86/11/17 14:34:25 swick Rel $ ! 4: */ ! 5: ! 6: #ifndef lint ! 7: static char *rcsid_put_c = "$Header: put.c,v 1.1 86/11/17 14:34:25 swick Rel $"; ! 8: #endif lint ! 9: ! 10: #include "is-copyright.h" ! 11: ! 12: /* put.c Perform a raster operation with a source bitmap ! 13: * ! 14: * PixmapPut Puts a pixmap up on the screen ! 15: * PixmapBitsPut Puts a pixmap up on the screen ! 16: * BitmapBitsPut Puts a pixmap up on the screen ! 17: * ! 18: * Copyright (c) 1986, Integrated Solutions, Inc. ! 19: */ ! 20: ! 21: #include "Xis.h" ! 22: ! 23: ! 24: PixmapPut(src, srcx, srcy, width, height, dstx, dsty, clips, clipcount, func, zmask) ! 25: register PIXMAP *src; ! 26: int srcx, srcy, width, height, dstx, dsty, zmask; ! 27: register int clipcount; ! 28: register int func; ! 29: register CLIP *clips; ! 30: { ! 31: CLIP bounds, i; ! 32: int tflag = 0; ! 33: ! 34: #ifdef DEBUG ! 35: if (debug & D_Pixmaps) ! 36: printf("PixmapPut\n"); ! 37: #endif DEBUG ! 38: ! 39: if (src->tile) { ! 40: src->tile = CannotBeTiled; ! 41: tflag++; ! 42: } ! 43: bounds.top = dsty; ! 44: bounds.left = dstx; ! 45: bounds.width = width; ! 46: bounds.height = height; ! 47: ! 48: for ( ; clipcount; clipcount--, ++clips) { ! 49: if (Overlap(clips[0], bounds)) { ! 50: i = Intersection(clips[0], bounds); ! 51: CheckCursor(i); ! 52: GIP_RasterOp((unsigned char)func, ! 53: src, (i.left - dstx) + srcx, (i.top - dsty) + srcy, ! 54: &ScreenPixmap, i.left, i.top, ! 55: (BITMAP *)NULL, 0, 0, ! 56: i.width, i.height, ! 57: zmask); ! 58: } ! 59: ! 60: } ! 61: RestoreCursor(); ! 62: if (tflag) ! 63: src->tile = CanBeTiled; ! 64: } ! 65: ! 66: ! 67: PixmapBitsPut(width, height, format, data, xymask, dstx, dsty, clips, clipcount, func, zmask) ! 68: char *data; ! 69: int width, height, format, zmask; ! 70: register int dstx, dsty; ! 71: register int clipcount; ! 72: BITMAP *xymask; ! 73: register CLIP *clips; ! 74: int func; ! 75: { ! 76: PIXMAP *src; ! 77: CLIP bounds, i; ! 78: extern PIXMAP *StorePixmap(); ! 79: ! 80: #ifdef DEBUG ! 81: if (debug & D_Pixmaps) ! 82: printf("PixmapBitsPut\n"); ! 83: #endif DEBUG ! 84: ! 85: bounds.top = dsty; ! 86: bounds.left = dstx; ! 87: bounds.width = width; ! 88: bounds.height = height; ! 89: ! 90: src = StorePixmap(width, height, format, data); ! 91: src->tile = CannotBeTiled; ! 92: ! 93: for ( ; clipcount; clipcount--, ++clips) { ! 94: if (Overlap(clips[0], bounds)) { ! 95: i = Intersection(clips[0], bounds); ! 96: CheckCursor(i); ! 97: GIP_RasterOp((unsigned char)func, ! 98: src, (i.left - dstx), (i.top - dsty), ! 99: &ScreenPixmap, i.left, i.top, ! 100: xymask, i.left - dstx, i.top - dsty, ! 101: i.width, i.height, ! 102: zmask); ! 103: } ! 104: ! 105: } ! 106: RestoreCursor(); ! 107: FreePixmap(src); ! 108: } ! 109: ! 110: ! 111: BitmapBitsPut(width, height, data, fore, back, xymask, dstx, dsty, clips, clipcount, func, zmask) ! 112: char *data; ! 113: int width, height, fore, back, zmask; ! 114: register int dstx, dsty; ! 115: register int clipcount; ! 116: BITMAP *xymask; ! 117: register CLIP *clips; ! 118: int func; ! 119: { ! 120: BITMAP *bsrc; ! 121: PIXMAP *src; ! 122: CLIP bounds, i; ! 123: extern BITMAP *StoreBitmap(); ! 124: extern PIXMAP *MakePixmap(); ! 125: ! 126: #ifdef DEBUG ! 127: if (debug & D_Bitmaps) ! 128: printf("BitmapBitsPut\n"); ! 129: #endif DEBUG ! 130: ! 131: /* first make a src pixmap */ ! 132: bsrc = StoreBitmap(width, height, data); ! 133: src = MakePixmap(bsrc, fore, back); ! 134: src->tile = CannotBeTiled; ! 135: ! 136: bounds.top = dsty; ! 137: bounds.left = dstx; ! 138: bounds.width = width; ! 139: bounds.height = height; ! 140: ! 141: for ( ; clipcount; clipcount--, ++clips) { ! 142: if (Overlap(clips[0], bounds)) { ! 143: i = Intersection(clips[0], bounds); ! 144: CheckCursor(i); ! 145: GIP_RasterOp((unsigned char)func, ! 146: src, (i.left - dstx), (i.top - dsty), ! 147: &ScreenPixmap, i.left, i.top, ! 148: xymask, i.left - dstx, i.top - dsty, ! 149: i.width, i.height, ! 150: zmask); ! 151: } ! 152: ! 153: } ! 154: RestoreCursor(); ! 155: FreePixmap(src); ! 156: FreeBitmap(bsrc); ! 157: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.