… | |
… | |
30 | |
30 | |
31 | /* given a layout and a coordinate, tell me which squares up/down/right/left |
31 | /* given a layout and a coordinate, tell me which squares up/down/right/left |
32 | are occupied. */ |
32 | are occupied. */ |
33 | |
33 | |
34 | int |
34 | int |
35 | surround_flag (char **layout, int i, int j, RMParms * RP) |
35 | surround_flag (char **layout, int i, int j, random_map_params * RP) |
36 | { |
36 | { |
37 | /* 1 = wall to left, |
37 | /* 1 = wall to left, |
38 | 2 = wall to right, |
38 | 2 = wall to right, |
39 | 4 = wall above |
39 | 4 = wall above |
40 | 8 = wall below */ |
40 | 8 = wall below */ |
… | |
… | |
54 | |
54 | |
55 | /* like surround_flag, but only walls count. |
55 | /* like surround_flag, but only walls count. |
56 | */ |
56 | */ |
57 | |
57 | |
58 | int |
58 | int |
59 | surround_flag2 (char **layout, int i, int j, RMParms * RP) |
59 | surround_flag2 (char **layout, int i, int j, random_map_params * RP) |
60 | { |
60 | { |
61 | /* 1 = wall to left, |
61 | /* 1 = wall to left, |
62 | 2 = wall to right, |
62 | 2 = wall to right, |
63 | 4 = wall above |
63 | 4 = wall above |
64 | 8 = wall below */ |
64 | 8 = wall below */ |
… | |
… | |
80 | * Since this is part of the random map code, presumption |
80 | * Since this is part of the random map code, presumption |
81 | * is that this is not a tiled map. |
81 | * is that this is not a tiled map. |
82 | * What is considered blocking and not is somewhat hard coded. |
82 | * What is considered blocking and not is somewhat hard coded. |
83 | */ |
83 | */ |
84 | int |
84 | int |
85 | surround_flag3 (maptile *map, sint16 i, sint16 j, RMParms * RP) |
85 | surround_flag3 (maptile *map, sint16 i, sint16 j, random_map_params * RP) |
86 | { |
86 | { |
87 | /* |
87 | /* |
88 | * 1 = blocked to left, |
88 | * 1 = blocked to left, |
89 | * 2 = blocked to right, |
89 | * 2 = blocked to right, |
90 | * 4 = blocked above |
90 | * 4 = blocked above |
… | |
… | |
106 | } |
106 | } |
107 | |
107 | |
108 | /* like surround_flag2, except it checks a map, not a layout. */ |
108 | /* like surround_flag2, except it checks a map, not a layout. */ |
109 | |
109 | |
110 | int |
110 | int |
111 | surround_flag4 (maptile *map, int i, int j, RMParms * RP) |
111 | surround_flag4 (maptile *map, int i, int j, random_map_params * RP) |
112 | { |
112 | { |
113 | /* 1 = blocked to left, |
113 | /* 1 = blocked to left, |
114 | 2 = blocked to right, |
114 | 2 = blocked to right, |
115 | 4 = blocked above |
115 | 4 = blocked above |
116 | 8 = blocked below */ |
116 | 8 = blocked below */ |
… | |
… | |
130 | |
130 | |
131 | /* takes a map and a layout, and puts walls in the map (picked from |
131 | /* takes a map and a layout, and puts walls in the map (picked from |
132 | w_style) at '#' marks. */ |
132 | w_style) at '#' marks. */ |
133 | |
133 | |
134 | void |
134 | void |
135 | make_map_walls (maptile *map, char **layout, char *w_style, RMParms * RP) |
135 | make_map_walls (maptile *map, char **layout, char *w_style, random_map_params * RP) |
136 | { |
136 | { |
137 | char styledirname[256]; |
137 | char styledirname[256]; |
138 | char stylefilepath[256]; |
138 | char stylefilepath[256]; |
139 | maptile *style_map = 0; |
139 | maptile *style_map = 0; |
140 | object *the_wall; |
140 | object *the_wall; |
… | |
… | |
184 | |
184 | |
185 | /* picks the right wall type for this square, to make it look nice, |
185 | /* picks the right wall type for this square, to make it look nice, |
186 | and have everything nicely joined. It uses the layout. */ |
186 | and have everything nicely joined. It uses the layout. */ |
187 | |
187 | |
188 | object * |
188 | object * |
189 | pick_joined_wall (object *the_wall, char **layout, int i, int j, RMParms * RP) |
189 | pick_joined_wall (object *the_wall, char **layout, int i, int j, random_map_params * RP) |
190 | { |
190 | { |
191 | /* 1 = wall to left, |
191 | /* 1 = wall to left, |
192 | 2 = wall to right, |
192 | 2 = wall to right, |
193 | 4 = wall above |
193 | 4 = wall above |
194 | 8 = wall below */ |
194 | 8 = wall below */ |
… | |
… | |
283 | * remove anything. It depends on the |
283 | * remove anything. It depends on the |
284 | * global, previously-set variable, "wall_name" |
284 | * global, previously-set variable, "wall_name" |
285 | */ |
285 | */ |
286 | |
286 | |
287 | object * |
287 | object * |
288 | retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, RMParms * RP) |
288 | retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params * RP) |
289 | { |
289 | { |
290 | /* 1 = wall to left, |
290 | /* 1 = wall to left, |
291 | * 2 = wall to right, |
291 | * 2 = wall to right, |
292 | * 4 = wall above |
292 | * 4 = wall above |
293 | * 8 = wall below |
293 | * 8 = wall below |