home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / mpel / mpelBlit.c < prev    next >
C/C++ Source or Header  |  1991-12-12  |  2KB  |  78 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23.  
  24. #ifndef lint
  25. static char *rcsid = "$Id: mpelBlit.c,v 6.3 88/11/03 20:51:48 paul Exp $";
  26. #endif
  27.  
  28. #include "Xmd.h"
  29.  
  30. #include "mpel.h"
  31. #include "mpelFifo.h"
  32.  
  33. #include "ibmTrace.h"
  34.  
  35. /* Cursor Stuff */
  36. extern int mpelcursorSemaphore;
  37. extern int mpelCheckCursor();
  38. extern void mpelReplaceCursor();
  39.  
  40. void
  41. mpelBitBlt(alu, rmask, wmask, x0, y0, x1, y1, w, h)
  42. int alu;
  43. unsigned long int rmask;
  44. unsigned long int wmask;
  45. int x0;
  46. int y0;
  47. int x1;
  48. int y1;
  49. int w;
  50. int h;
  51. {
  52.     int cursor_saved;
  53.     mpelVPMCopy    vpm;
  54.  
  55.     TRACE( ( "mpelBitBlt(0x%x,0x%x,0x%x,%d,%d,%d,%d,%d,%d)\n",
  56.        alu, rmask, wmask, x0, y0, x1, y1, w, h ) );
  57.  
  58.     /* If Cursor Is In The Way Remove It */
  59.     cursor_saved = !mpelcursorSemaphore
  60.             && (mpelCheckCursor(x0, y0, w, h) || mpelCheckCursor(x1, y1, w, h));
  61.  
  62.     mpelSetPlaneMask( wmask );
  63.  
  64.     vpm.source.lleft.x=        x0;
  65.     vpm.source.lleft.y=        MPEL_HEIGHT - ( y0 + h );
  66.     vpm.source.uright.x=    x0 + w - 1;
  67.     vpm.source.uright.y=    MPEL_HEIGHT - 1 - y0;
  68.     vpm.dlleft.x=        x1;
  69.     vpm.dlleft.y=        MPEL_HEIGHT - ( y1 + h );
  70.     vpm.alu=            alu + 1;
  71.     MPELVPMCopy( &vpm );
  72.  
  73.     if (cursor_saved)
  74.     mpelReplaceCursor();
  75.  
  76.     return;
  77. }
  78.