56 int surround_index = 0;
58 if ((i > 0) && (layout[i-1][j] ==
'D' || layout[i-1][j] ==
'#'))
60 if ((i < Xsize-1) && (layout[i+1][j] ==
'D' || layout[i+1][j] ==
'#'))
62 if ((j > 0) && (layout[i][j-1] ==
'D' || layout[i][j-1] ==
'#'))
64 if ((j < Ysize-1) && (layout[i][j+1] ==
'D' && layout[i][j+1] ==
'#'))
66 return surround_index;
86 if (!strcmp(doorstyle,
"none"))
88 vdoors =
find_style(
"/styles/doorstyles", doorstyle, -1);
92 vdoors =
find_style(
"/styles/doorstyles/vdoors", doorstyle, -1);
95 snprintf(doorpath,
sizeof(doorpath),
"/styles/doorstyles/hdoors%s", strrchr(vdoors->
path,
'/'));
99 for (i = 0; i < RP->
Xsize; i++)
100 for (j = 0; j < RP->
Ysize; j++) {
101 if (maze[i][j] ==
'D') {
103 object *this_door, *new_door;
int surround_check2(char **layout, int i, int j, int Xsize, int Ysize)
object * pick_random_object(mapstruct *style)
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
int snprintf(char *dest, int max, const char *format,...)
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
void copy_object(object *op2, object *op)
void put_doors(mapstruct *the_map, char **maze, const char *doorstyle, RMParms *RP)
object * arch_to_object(archetype *at)