Go to the documentation of this file.
42 int surround_index = 0;
44 if ((i > 0) &&
layout[i-1][j] != 0) {
47 if ((i < RP->Xsize-1) &&
layout[i+1][j] != 0) {
50 if ((j > 0) &&
layout[i][j-1] != 0) {
53 if ((j < RP->Ysize-1) &&
layout[i][j+1] != 0) {
56 return surround_index;
79 int surround_index = 0;
81 if ((i > 0) &&
layout[i-1][j] ==
'#') {
84 if ((i < RP->Xsize-1) &&
layout[i+1][j] ==
'#') {
87 if ((j > 0) &&
layout[i][j-1] ==
'#') {
90 if ((j < RP->Ysize-1) &&
layout[i][j+1] ==
'#') {
93 return surround_index;
116 int surround_index = 0;
131 return surround_index;
154 int surround_index = 0;
169 return surround_index;
190 if (!strcmp(w_style,
"none")) {
193 const char *styledirname =
"/styles/wallstyles";
194 style_map =
find_style(styledirname, w_style, -1);
195 if (style_map == NULL) {
207 if ((cp = strchr(RP->
wall_name,
'_')) != NULL) {
212 for (i = 0; i < RP->
Xsize; i++)
213 for (j = 0; j < RP->
Ysize; j++) {
214 if (
layout[i][j] ==
'#') {
233 "_0",
"_1_3",
"_1_4",
"_2_1_2",
234 "_1_2",
"_2_2_4",
"_2_2_1",
"_3_1",
235 "_1_1",
"_2_2_3",
"_2_2_2",
"_3_3",
236 "_2_1_1",
"_3_4",
"_3_2",
"_4"
261 int surround_index = 0;
266 strncpy(wall_name, the_wall->
arch->
name,
sizeof(wall_name));
275 for (
l = 0;
l < 64;
l++) {
276 if (wall_name[
l] ==
'_') {
283 assert(surround_index >= 0 && surround_index < 16);
284 strcat(wall_name,
wall_join[surround_index]);
321 int surround_index = 0;
323 object *the_wall = NULL;
324 object *new_wall = NULL;
343 if (insert_flag == 0) {
346 }
else if (the_wall == NULL) {
351 for (
l = 0;
l < 64;
l++) {
359 assert(surround_index >= 0 && surround_index < 16);
362 if (wall_arch != NULL) {
364 if (the_wall && the_wall->
map) {
int surround_flag(char **layout, int i, int j, RMParms *RP)
void object_remove(object *op)
#define MOVE_BLOCK_DEFAULT
int surround_flag4(mapstruct *map, int i, int j, RMParms *RP)
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
int surround_flag2(char **layout, int i, int j, RMParms *RP)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
size_t strlcpy(char *dst, const char *src, size_t size)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
object * pick_joined_wall(object *the_wall, char **layout, int i, int j, RMParms *RP)
int surround_flag3(mapstruct *map, int i, int j, RMParms *RP)
static const char * wall_join[16]
object * pick_random_object(mapstruct *style)
object * arch_to_object(archetype *at)
object * retrofit_joined_wall(mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void object_free_drop_inventory(object *ob)
int wall_blocked(mapstruct *m, int x, int y)
archetype * try_find_archetype(const char *name)
void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP)