1 //
2 // Copyright(C) 1993-1996 Id Software, Inc.
3 // Copyright(C) 1993-2008 Raven Software
4 // Copyright(C) 2005-2014 Simon Howard
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 #ifndef __AMMAP_H__
17 #define __AMMAP_H__
18 
19 // For use if I do walls with outsides/insides
20 #define REDS		12*8
21 #define REDRANGE	1       //16
22 #define BLUES		(256-4*16+8)
23 #define BLUERANGE	1       //8
24 #define GREENS		(33*8)
25 #define GREENRANGE	1       //16
26 #define GRAYS		(5*8)
27 #define GRAYSRANGE	1       //16
28 #define BROWNS		(14*8)
29 #define BROWNRANGE	1       //16
30 #define YELLOWS		10*8
31 #define YELLOWRANGE	1
32 #define BLACK		0
33 #define WHITE		4*8
34 #define PARCH		13*8-1
35 #define BLOODRED  150
36 #define BLUEKEY 	197
37 #define YELLOWKEY 144
38 #define GREENKEY  220
39 
40 // Automap colors
41 #define BACKGROUND	PARCH
42 #define YOURCOLORS	WHITE
43 #define YOURRANGE	0
44 #define WALLCOLORS	REDS
45 #define WALLRANGE	REDRANGE
46 #define TSWALLCOLORS	GRAYS
47 #define TSWALLRANGE	GRAYSRANGE
48 #define FDWALLCOLORS	BROWNS
49 #define FDWALLRANGE	BROWNRANGE
50 #define CDWALLCOLORS	YELLOWS
51 #define CDWALLRANGE	YELLOWRANGE
52 #define THINGCOLORS	GREENS
53 #define THINGRANGE	GREENRANGE
54 #define SECRETWALLCOLORS WALLCOLORS
55 #define SECRETWALLRANGE WALLRANGE
56 #define GRIDCOLORS	(GRAYS + GRAYSRANGE/2)
57 #define GRIDRANGE	0
58 #define XHAIRCOLORS	GRAYS
59 
60 // drawing stuff
61 #define	FB		0
62 
63 #define AM_NUMMARKPOINTS 10
64 
65 #define AM_MSGHEADER (('a'<<24)+('m'<<16))
66 #define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8))
67 #define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8))
68 
69 #define INITSCALEMTOF (.2*FRACUNIT)     // scale on entry
70 // how much the automap moves window per tic in frame-buffer coordinates
71 #define F_PANINC	4       // moves 140 pixels in 1 second
72 // how much zoom-in per tic
73 #define M_ZOOMIN        ((int) (1.02*FRACUNIT)) // goes to 2x in 1 second
74 // how much zoom-out per tic
75 #define M_ZOOMOUT       ((int) (FRACUNIT/1.02)) // pulls out to 0.5x in 1 second
76 
77 // translates between frame-buffer and map distances
78 #define FTOM(x) FixedMul(((x)<<16),scale_ftom)
79 #define MTOF(x) (FixedMul((x),scale_mtof)>>16)
80 // translates between frame-buffer and map coordinates
81 #define CXMTOF(x)  (f_x + MTOF((x)-m_x))
82 #define CYMTOF(y)  (f_y + (f_h - MTOF((y)-m_y)))
83 
84 // the following is crap
85 #define LINE_NEVERSEE ML_DONTDRAW
86 
87 typedef struct
88 {
89     int x, y;
90 } fpoint_t;
91 
92 typedef struct
93 {
94     fpoint_t a, b;
95 } fline_t;
96 
97 typedef vertex_t mpoint_t;
98 
99 typedef struct
100 {
101     mpoint_t a, b;
102 } mline_t;
103 
104 typedef struct
105 {
106     fixed_t slp, islp;
107 } islope_t;
108 
109 // extern int f_x, f_y, f_w, f_h;
110 
111 #endif
112