1 /*
2  * File: grid.h
3  * Purpose: header file for grid.c, used only in dungeon generation
4  * files (generate.c, rooms.c)
5  */
6 
7 /*
8  * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
9  *
10  * This software may be copied and distributed for educational, research, and
11  * not for profit purposes provided that this copyright and statement are
12  * included in all such copies.
13  */
14 
15 
16 /* Macros */
17 
18 /*
19  * Access the cave data for the current region
20  */
21 #define cave_p(X, Y) \
22 	(&cave_data[Y][X])
23 
24 /*
25  * Access the cave data for the given region
26  */
27 #define access_region(X, Y, R) \
28 	(&rg_list[R][Y][X])
29 
30 /*
31  * Set feature on a square
32  */
33 #define set_feat_bold(X, Y, F) \
34 	(cave_p(X, Y)->feat=(F))
35 
36 /*
37  * Grid-based version of the above
38  */
39 #define set_feat_grid(C, F) \
40 	((C)->feat=(F))
41 
42 /* Helpful macros */
43 #define place_secret_door(X,Y) \
44 	set_feat_bold((X), (Y), (FEAT_SECRET))
45 
46 
47 /* Externs */
48 extern bool new_player_spot(void);
49 
50 extern void place_random_stairs(int x, int y);
51 extern void place_random_door(int x, int y);
52 
53 extern void vault_objects(int x, int y, int num);
54 extern void vault_traps(int x, int y, int xd, int yd, int num);
55 extern void vault_monsters(int x1, int y1, int num);
56 
57 extern int next_to_walls(int x, int y);
58 
59 extern void generate_room(int x1, int y1, int x2, int y2, int light);
60 extern void generate_vault(int x1, int y1, int x2, int y2);
61 extern void clear_vault(int x1, int y1, int x2, int y2);
62 extern void generate_fill(int x1, int y1, int x2, int y2, int feat);
63 extern void generate_draw(int x1, int y1, int x2, int y2, int feat);
64 extern void generate_line(int x1, int y1, int x2, int y2, int feat);
65 extern void generate_plus(int x1, int y1, int x2, int y2, int feat);
66 extern void generate_door(int x1, int y1, int x2, int y2, bool secret);
67 
68 
69 extern bool get_is_floor(int x, int y);
70 extern void set_floor(int x, int y);
71 
72 extern void build_tunnel(int col1, int row1, int col2, int row2);
73 extern bool build_tunnel2(int x1, int y1, int x2, int y2, int type, int cutoff);
74 
75 extern void generate_hmap(int x0, int y0, int xsiz, int ysiz, int grd,
76 						  int roug, int cutoff);
77 extern bool generate_fracave(int x0, int y0, int xsize, int ysize, int cutoff,
78 							 bool light);
79 extern bool generate_lake(int x0, int y0, int xsize, int ysize,
80 						  int c1, int c2, int c3,
81 						  byte f1, byte f2, byte f3);
82