1 /* wvWare
2  * Copyright (C) Caolan McNamara, Dom Lachowicz, and others
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23 
24 #include <sys/types.h>
25 #include <string.h>
26 #include <stdio.h>
27 #include "wv.h"
28 
29 void
wvGetDOGRID(DOGRID * dog,wvStream * fd)30 wvGetDOGRID (DOGRID * dog, wvStream * fd)
31 {
32     U16 temp16;
33     dog->xaGrid = read_16ubit (fd);
34     dog->yaGrid = read_16ubit (fd);
35     dog->dxaGrid = read_16ubit (fd);
36     dog->dyaGrid = read_16ubit (fd);
37 
38     temp16 = read_16ubit (fd);
39 
40     dog->dyGridDisplay = temp16 & 0x007F;
41     dog->fTurnItOff = (temp16 & 0x0080) >> 7;
42     dog->dxGridDisplay = (temp16 & 0x7F00) >> 8;
43     dog->fFollowMargins = (temp16 & 0x8000) >> 15;
44 }
45 
46 void
wvInitDOGRID(DOGRID * dog)47 wvInitDOGRID (DOGRID * dog)
48 {
49     dog->xaGrid = 0;
50     dog->yaGrid = 0;
51     dog->dxaGrid = 0;
52     dog->dyaGrid = 0;
53     dog->dyGridDisplay = 0;
54     dog->fTurnItOff = 0;
55     dog->dxGridDisplay = 0;
56     dog->fFollowMargins = 0;
57 }
58