Go to the documentation of this file.
48 for (i = 0; i < RP->
Xsize; i++) {
49 for (j = 0; j < RP->
Ysize; j++) {
53 printf(
"%c",
layout[i][j]);
195 for (i = 0; i < RP->
Xsize; i++) {
365 int Xsize_orig, Ysize_orig;
367 Xsize_orig = RP->
Xsize;
368 Ysize_orig = RP->
Ysize;
371 RP->
Xsize = Xsize_orig;
372 RP->
Ysize = Ysize_orig;
379 sym_maze = (
char **)calloc(
sizeof(
char *), RP->
Xsize);
380 for (i = 0; i < RP->
Xsize; i++) {
381 sym_maze[i] = (
char *)calloc(
sizeof(
char), RP->
Ysize);
385 for (i = 0; i < RP->
Xsize/2+1; i++)
386 for (j = 0; j < RP->
Ysize; j++) {
387 sym_maze[i][j] = maze[i][j];
388 sym_maze[RP->
Xsize-i-1][j] = maze[i][j];
391 for (i = 0; i < RP->
Xsize; i++)
392 for (j = 0; j < RP->
Ysize/2+1; j++) {
393 sym_maze[i][j] = maze[i][j];
394 sym_maze[i][RP->
Ysize-j-1] = maze[i][j];
397 for (i = 0; i < RP->
Xsize/2+1; i++)
398 for (j = 0; j < RP->
Ysize/2+1; j++) {
399 sym_maze[i][j] = maze[i][j];
400 sym_maze[i][RP->
Ysize-j-1] = maze[i][j];
401 sym_maze[RP->
Xsize-i-1][j] = maze[i][j];
402 sym_maze[RP->
Xsize-i-1][RP->
Ysize-j-1] = maze[i][j];
406 for (i = 0; i < Xsize_orig; i++) {
452 char *
new = malloc(
sizeof(
char)*RP->
Xsize*RP->
Ysize);
454 for (i = 0; i < RP->
Xsize; i++) {
455 for (j = 0; j < RP->
Ysize; j++) {
456 new[i*RP->
Ysize+j] = maze[i][j];
459 for (i = 0; i < RP->
Xsize; i++) {
460 for (j = 0; j < RP->
Ysize; j++) {
472 new_maze = (
char **)calloc(
sizeof(
char *), RP->
Ysize);
473 for (i = 0; i < RP->
Ysize; i++) {
474 new_maze[i] = (
char *)calloc(
sizeof(
char), RP->
Xsize);
477 for (i = 0; i < RP->
Xsize; i++)
478 for (j = 0; j < RP->
Ysize; j++) {
479 new_maze[j][i] = maze[i][j];
483 for (i = 0; i < RP->
Xsize; i++)
484 for (j = 0; j < RP->
Ysize; j++) {
485 new_maze[j][i] = maze[RP->
Xsize-i-1][RP->
Ysize-j-1];
490 for (i = 0; i < RP->
Xsize; i++) {
516 for (ti = 0; ti < tries; ti++) {
565 if (dx == 0 || dx == (RP->
Xsize-1) || dy == 0 || dy == (RP->
Ysize-1)) {
570 if (maze[dx][dy] != 0) {
578 for (i1 = dx-1; i1 > 0; i1--) {
587 if (maze[i1][
y] != 0) {
593 for (i1 = dx+1; i1 < RP->
Xsize-1; i1++) {
602 if (maze[i1][
y] != 0) {
612 for (i1 = dy-1; i1 > 0; i1--) {
621 if (maze[
x][i1] != 0) {
627 for (i1 = dy+1; i1 < RP->
Ysize-1; i1++) {
636 if (maze[
x][i1] != 0) {
666 for (i1 =
x-1; maze[i1][
y] == 0; i1--) {
669 for (i1 =
x+1; maze[i1][
y] == 0; i1++) {
678 for (i1 =
y-1; maze[
x][i1] == 0; i1--) {
681 for (i1 =
y+1; maze[
x][i1] == 0; i1++) {
706 doorlist_x = malloc(
sizeof(
int)*RP->
Xsize*RP->
Ysize);
707 doorlist_y = malloc(
sizeof(
int)*RP->
Xsize*RP->
Ysize);
711 for (i = 1; i < RP->
Xsize-1; i++)
712 for (j = 1; j < RP->
Ysize-1; j++) {
714 if (sindex == 3 || sindex == 12) {
716 doorlist_x[doorlocs] = i;
717 doorlist_y[doorlocs] = j;
722 while (ndoors > 0 && doorlocs > 0) {
730 if (sindex == 3 || sindex == 12) {
736 doorlist_x[di] = doorlist_x[doorlocs];
737 doorlist_y[di] = doorlist_y[doorlocs];
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
char layoutstyle[RM_SIZE]
sstring add_string(const char *str)
StringBuffer * stringbuffer_new(void)
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
void dump_layout(char **layout, RMParms *RP)
int calculate_difficulty(mapstruct *m)
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
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 doorify_layout(char **maze, RMParms *RP)
void set_darkness_map(mapstruct *m)
void apply_auto_fix(mapstruct *m)
int change_map_light(mapstruct *m, int change)
char ** layoutgen(RMParms *RP)
#define SQUARE_SPIRAL_LAYOUT
void place_specials_in_map(mapstruct *map, char **layout, RMParms *RP)
void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP)
int surround_flag(char **layout, int i, int j, RMParms *RP)
#define MIN_RANDOM_MAP_SIZE
int can_make_wall(char **maze, int dx, int dy, int dir, RMParms *RP)
char * stringbuffer_finish(StringBuffer *sb)
char ** expand2x(char **layout, int xsize, int ysize)
const typedef char * sstring
struct regiondef * region
int make_wall(char **maze, int x, int y, int dir)
StringBuffer * write_map_parameters_to_string(const 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)
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]
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
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)
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
void put_decor(mapstruct *map, char **maze, char *decorstyle, int decor_option, RMParms *RP)
char monsterstyle[RM_SIZE]
void roomify_layout(char **maze, RMParms *RP)
char ** rotate_layout(char **maze, int rotation, RMParms *RP)
char ** symmetrize_layout(char **maze, int sym, RMParms *RP)
float difficulty_increase
struct regiondef * region