57 int surround_index = 0;
59 if ((i > 0) && layout[i-1][j] != 0)
61 if ((i < RP->Xsize-1) && layout[i+1][j] != 0)
63 if ((j > 0) && layout[i][j-1] != 0)
65 if ((j < RP->Ysize-1) && layout[i][j+1] != 0)
67 return surround_index;
89 int surround_index = 0;
91 if ((i > 0) && layout[i-1][j] ==
'#')
93 if ((i < RP->Xsize-1) && layout[i+1][j] ==
'#')
95 if ((j > 0) && layout[i][j-1] ==
'#')
97 if ((j < RP->Ysize-1) && layout[i][j+1] ==
'#')
99 return surround_index;
121 int surround_index = 0;
132 return surround_index;
154 int surround_index = 0;
165 return surround_index;
181 char styledirname[256];
182 char stylefilepath[256];
187 if (!strcmp(w_style,
"none"))
189 snprintf(styledirname,
sizeof(styledirname),
"%s",
"/styles/wallstyles");
190 snprintf(stylefilepath,
sizeof(stylefilepath),
"%s/%s", styledirname, w_style);
191 style_map =
find_style(styledirname, w_style, -1);
192 if (style_map == NULL)
203 if ((cp = strchr(RP->
wall_name,
'_')) != NULL) {
208 for (i = 0; i < RP->
Xsize; i++)
209 for (j = 0; j < RP->
Ysize; j++) {
210 if (layout[i][j] ==
'#') {
246 int surround_index = 0;
251 strncpy(wall_name, the_wall->
arch->
name,
sizeof(wall_name));
260 for (l = 0; l < 64; l++) {
261 if (wall_name[l] ==
'_') {
269 switch (surround_index) {
271 strcat(wall_name,
"_0");
275 strcat(wall_name,
"_1_3");
279 strcat(wall_name,
"_1_4");
283 strcat(wall_name,
"_2_1_2");
287 strcat(wall_name,
"_1_2");
291 strcat(wall_name,
"_2_2_4");
295 strcat(wall_name,
"_2_2_1");
299 strcat(wall_name,
"_3_1");
303 strcat(wall_name,
"_1_1");
307 strcat(wall_name,
"_2_2_3");
311 strcat(wall_name,
"_2_2_2");
315 strcat(wall_name,
"_3_3");
319 strcat(wall_name,
"_2_1_1");
323 strcat(wall_name,
"_3_4");
327 strcat(wall_name,
"_3_2");
331 strcat(wall_name,
"_4");
368 int surround_index = 0;
370 object *the_wall = NULL;
371 object *new_wall = NULL;
375 for (the_wall =
GET_MAP_OB(the_map, i, j); the_wall != NULL; the_wall = the_wall->
above)
388 if (insert_flag == 0)
390 }
else if (the_wall == NULL)
394 for (l = 0; l < 64; l++) {
405 switch (surround_index) {
471 if (wall_arch != NULL) {
475 if (the_wall && the_wall->
map) {
int surround_flag2(char **layout, int i, int j, RMParms *RP)
int surround_flag(char **layout, int i, int j, RMParms *RP)
object * pick_random_object(mapstruct *style)
void remove_ob(object *op)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
int surround_flag3(mapstruct *map, int i, int j, RMParms *RP)
archetype * try_find_archetype(const char *name)
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
#define MOVE_BLOCK_DEFAULT
object * retrofit_joined_wall(mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP)
int wall_blocked(mapstruct *m, int x, int y)
int snprintf(char *dest, int max, const char *format,...)
void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP)
#define GET_MAP_OB(M, X, Y)
object * pick_joined_wall(object *the_wall, char **layout, int i, int j, RMParms *RP)
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
void free_object(object *ob)
object * arch_to_object(archetype *at)
int surround_flag4(mapstruct *map, int i, int j, RMParms *RP)