1 /**
2  ** genptscl.c ---- generic, VERY SLOW putscanline routine
3  **
4  ** Copyright (c) 1998 Hartmut Schirmer
5  **
6  ** This file is part of the GRX graphics library.
7  **
8  ** The GRX graphics library is free software; you can redistribute it
9  ** and/or modify it under some conditions; see the "copying.grx" file
10  ** for details.
11  **
12  ** This library is distributed in the hope that it will be useful,
13  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  **
16  **/
17 
18 #include "libgrx.h"
19 #include "grdriver.h"
20 
21 /* will draw array of pixel values to current context          */
22 
_GrFrDrvGenericPutScanline(int x,int y,int w,const GrColor far * scl,GrColor op)23 void _GrFrDrvGenericPutScanline(int x,int y,int w,
24 				const GrColor far *scl, GrColor op )
25 {
26    GrColor skipc;
27    _GR_drawPix drawpixel;
28    GRX_ENTER();
29    drawpixel = CURC->gc_driver->drawpixel;
30    DBGPRINTF(DBG_DRIVER,("x=%d, y=%d, w=%d, op=%lx\n",x,y,w,op));
31    skipc = op ^ GrIMAGE;
32    op &= GrCMODEMASK;
33    for ( w += x; x < w; ++x) {
34      GrColor c = *(scl++);
35      if (c != skipc) (*drawpixel)(x,y,(c|op));
36    }
37    GRX_LEAVE();
38 }
39