Go to the documentation of this file.
47 for (i = 0; i < RP->
Xsize; i++) {
48 for (j = 0; j < RP->
Ysize; j++) {
52 printf(
"%c",
layout[i][j]);
194 for (i = 0; i < RP->
Xsize; i++) {
364 int Xsize_orig, Ysize_orig;
366 Xsize_orig = RP->
Xsize;
367 Ysize_orig = RP->
Ysize;
370 RP->
Xsize = Xsize_orig;
371 RP->
Ysize = Ysize_orig;
378 sym_maze = (
char **)calloc(
sizeof(
char *), RP->
Xsize);
379 for (i = 0; i < RP->
Xsize; i++) {
380 sym_maze[i] = (
char *)calloc(
sizeof(
char), RP->
Ysize);
384 for (i = 0; i < RP->
Xsize/2+1; i++)
385 for (j = 0; j < RP->
Ysize; j++) {
386 sym_maze[i][j] = maze[i][j];
387 sym_maze[RP->
Xsize-i-1][j] = maze[i][j];
390 for (i = 0; i < RP->
Xsize; i++)
391 for (j = 0; j < RP->
Ysize/2+1; j++) {
392 sym_maze[i][j] = maze[i][j];
393 sym_maze[i][RP->
Ysize-j-1] = maze[i][j];
396 for (i = 0; i < RP->
Xsize/2+1; i++)
397 for (j = 0; j < RP->
Ysize/2+1; j++) {
398 sym_maze[i][j] = maze[i][j];
399 sym_maze[i][RP->
Ysize-j-1] = maze[i][j];
400 sym_maze[RP->
Xsize-i-1][j] = maze[i][j];
401 sym_maze[RP->
Xsize-i-1][RP->
Ysize-j-1] = maze[i][j];
405 for (i = 0; i < Xsize_orig; i++) {
451 char *rotated =
static_cast<char *
>(malloc(
sizeof(
char)*RP->
Xsize*RP->
Ysize));
453 for (i = 0; i < RP->
Xsize; i++) {
454 for (j = 0; j < RP->
Ysize; j++) {
455 rotated[i*RP->
Ysize+j] = maze[i][j];
458 for (i = 0; i < RP->
Xsize; i++) {
459 for (j = 0; j < RP->
Ysize; j++) {
471 new_maze = (
char **)calloc(
sizeof(
char *), RP->
Ysize);
472 for (i = 0; i < RP->
Ysize; i++) {
473 new_maze[i] = (
char *)calloc(
sizeof(
char), RP->
Xsize);
476 for (i = 0; i < RP->
Xsize; i++)
477 for (j = 0; j < RP->
Ysize; j++) {
478 new_maze[j][i] = maze[i][j];
482 for (i = 0; i < RP->
Xsize; i++)
483 for (j = 0; j < RP->
Ysize; j++) {
484 new_maze[j][i] = maze[RP->
Xsize-i-1][RP->
Ysize-j-1];
489 for (i = 0; i < RP->
Xsize; i++) {
515 for (ti = 0; ti < tries; ti++) {
564 if (dx == 0 || dx == (RP->
Xsize-1) || dy == 0 || dy == (RP->
Ysize-1)) {
569 if (maze[dx][dy] != 0) {
577 for (i1 = dx-1; i1 > 0; i1--) {
586 if (maze[i1][
y] != 0) {
592 for (i1 = dx+1; i1 < RP->
Xsize-1; i1++) {
601 if (maze[i1][
y] != 0) {
611 for (i1 = dy-1; i1 > 0; i1--) {
620 if (maze[
x][i1] != 0) {
626 for (i1 = dy+1; i1 < RP->
Ysize-1; i1++) {
635 if (maze[
x][i1] != 0) {
665 for (i1 =
x-1; maze[i1][
y] == 0; i1--) {
668 for (i1 =
x+1; maze[i1][
y] == 0; i1++) {
677 for (i1 =
y-1; maze[
x][i1] == 0; i1--) {
680 for (i1 =
y+1; maze[
x][i1] == 0; i1++) {
705 doorlist_x =
static_cast<int *
>(malloc(
sizeof(
int)*RP->
Xsize*RP->
Ysize));
706 doorlist_y =
static_cast<int *
>(malloc(
sizeof(
int)*RP->
Xsize*RP->
Ysize));
710 for (i = 1; i < RP->
Xsize-1; i++)
711 for (j = 1; j < RP->
Ysize-1; j++) {
713 if (sindex == 3 || sindex == 12) {
715 doorlist_x[doorlocs] = i;
716 doorlist_y[doorlocs] = j;
721 while (ndoors > 0 && doorlocs > 0) {
729 if (sindex == 3 || sindex == 12) {
735 doorlist_x[di] = doorlist_x[doorlocs];
736 doorlist_y[di] = doorlist_y[doorlocs];
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
char layoutstyle[RM_SIZE]
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
int make_wall(char **maze, int x, int y, int dir)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
StringBuffer * stringbuffer_new(void)
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
int can_make_wall(char **maze, int dx, int dy, int dir, RMParms *RP)
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
void roomify_layout(char **maze, RMParms *RP)
char ** map_gen_spiral(int xsize, int ysize, int option, int _unused_layers)
int surround_flag2(char **layout, int i, int j, RMParms *RP)
void unblock_exits(mapstruct *map, char **maze, RMParms *RP)
void set_darkness_map(mapstruct *m)
char * stringbuffer_finish(StringBuffer *sb)
void apply_auto_fix(mapstruct *m)
#define SQUARE_SPIRAL_LAYOUT
void place_specials_in_map(mapstruct *map, char **layout, RMParms *RP)
StringBuffer * write_map_parameters_to_string(const RMParms *RP)
void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP)
void dump_layout(char **layout, RMParms *RP)
sstring add_string(const char *str)
int surround_flag(char **layout, int i, int j, RMParms *RP)
int change_map_light(mapstruct *m, int change)
#define MIN_RANDOM_MAP_SIZE
void doorify_layout(char **maze, RMParms *RP)
char ** expand2x(char **layout, int xsize, int ysize)
char ** rotate_layout(char **maze, int rotation, RMParms *RP)
char ** symmetrize_layout(char **maze, int sym, RMParms *RP)
char final_exit_archetype[RM_SIZE]
void place_treasure(mapstruct *map, char **layout, char *treasure_style, int treasureoptions, RMParms *RP)
void connect_spirals(int xsize, int ysize, int sym, char **layout)
const typedef char * sstring
void place_exits(mapstruct *map, char **maze, char *exitstyle, int orientation, RMParms *RP)
void put_doors(mapstruct *the_map, char **maze, const char *doorstyle, RMParms *RP)
void place_monsters(mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP)
char exit_on_final_map[RM_SIZE]
char treasurestyle[RM_SIZE]
char dungeon_name[RM_SIZE]
char ** make_snake_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
mapstruct * make_map_floor(char **layout, char *floorstyle, RMParms *RP)
void put_decor(mapstruct *map, char **maze, char *decorstyle, int decor_option, RMParms *RP)
char monsterstyle[RM_SIZE]
int calculate_difficulty(mapstruct *m)
float difficulty_increase
char ** layoutgen(RMParms *RP)