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/fl8gfl8.c $
21  * $Revision: 1.3 $
22  * $Author: kaboom $
23  * $Date: 1993/10/19 09:50:23 $
24  *
25  * Routines for reading flat 8 bitmaps from a flat 8 canvas.
26  *
27  * This file is part of the 2d library.
28  *
29  * $Log: fl8gfl8.c $
30  * Revision 1.3  1993/10/19  09:50:23  kaboom
31  * Replaced #include <grd.h" with new headers split from grd.h.
32  *
33  * Revision 1.2  1993/10/08  01:15:14  kaboom
34  * Changed quotes in #include lines to angle brackets for Watcom.
35  *
36  * Revision 1.1  1993/02/16  14:15:10  kaboom
37  * Initial revision
38  */
39 
40 #include "cnvdat.h"
41 #include "lg.h"
42 #include <string.h>
43 
flat8_get_flat8_ubitmap(grs_bitmap * bm,short x,short y)44 void flat8_get_flat8_ubitmap(grs_bitmap *bm, short x, short y) {
45     uchar *src;
46     uchar *dst;
47     short h = bm->h;
48     short w = bm->w;
49     ushort brow = bm->row;
50     ushort grow = grd_bm.row;
51 
52     src = grd_bm.bits + grow * y + x;
53     dst = bm->bits;
54     while (h--) {
55         LG_memmove(dst, src, w);
56         src += grow;
57         dst += brow;
58     }
59 }
60