1 /*
2 
3 Copyright (C) 2015-2018 Night Dive Studios, LLC.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 /*
20  * $Source: n:/project/lib/src/2d/RCS/fl8rect.c $
21  * $Revision: 1.4 $
22  * $Author: kaboom $
23  * $Date: 1993/10/19 09:50:53 $
24  *
25  * Routines for drawing rectangles into a flat 8 canvas.
26  *
27  * This file is part of the 2d library.
28  *
29  * $Log: fl8rect.c $
30  * Revision 1.4  1993/10/19  09:50:53  kaboom
31  * Replaced #include <grd.h" with new headers split from grd.h.
32  *
33  * Revision 1.3  1993/10/08  01:15:29  kaboom
34  * Changed quotes in #include liness to angle brackets for Watcom problem.
35  *
36  * Revision 1.2  1993/05/04  18:43:51  kaboom
37  * Changed rectangle to omit the right and bottom edges.
38  *
39  * Revision 1.1  1993/02/16  14:17:05  kaboom
40  * Initial revision
41  */
42 
43 #include "cnvdat.h"
44 #include "lg.h"
45 #include <string.h>
46 
flat8_urect(short left,short top,short right,short bot)47 void flat8_urect(short left, short top, short right, short bot) {
48     uchar *p;
49     int w, h;
50     int grow = grd_bm.row;
51     long fcolor = grd_gc.fcolor;
52 
53     p = grd_bm.bits + top * grow + left;
54     w = right - left;
55     h = bot - top;
56 
57     while (h-- > 0) {
58         LG_memset(p, fcolor, w);
59         p += grow;
60     }
61 }
62