… | |
… | |
59 | maptile::generate_random_map (random_map_params *RP) |
59 | maptile::generate_random_map (random_map_params *RP) |
60 | { |
60 | { |
61 | char **layout, buf[16384]; |
61 | char **layout, buf[16384]; |
62 | int i; |
62 | int i; |
63 | |
63 | |
|
|
64 | RP->Xsize = RP->xsize; |
|
|
65 | RP->Ysize = RP->ysize; |
|
|
66 | |
64 | /* pick a random seed, or use the one from the input file */ |
67 | /* pick a random seed, or use the one from the input file */ |
65 | RP->random_seed = RP->random_seed |
68 | RP->random_seed = RP->random_seed |
66 | ? RP->random_seed + RP->dungeon_level |
69 | ? RP->random_seed + RP->dungeon_level |
67 | : time (0); |
70 | : time (0); |
68 | CEDE; |
71 | CEDE; |
… | |
… | |
93 | else |
96 | else |
94 | RP->symmetry_used = RP->symmetry; |
97 | RP->symmetry_used = RP->symmetry; |
95 | |
98 | |
96 | if (RP->symmetry_used == SYMMETRY_Y || RP->symmetry_used == SYMMETRY_XY) |
99 | if (RP->symmetry_used == SYMMETRY_Y || RP->symmetry_used == SYMMETRY_XY) |
97 | RP->Ysize = RP->Ysize / 2 + 1; |
100 | RP->Ysize = RP->Ysize / 2 + 1; |
|
|
101 | |
98 | if (RP->symmetry_used == SYMMETRY_X || RP->symmetry_used == SYMMETRY_XY) |
102 | if (RP->symmetry_used == SYMMETRY_X || RP->symmetry_used == SYMMETRY_XY) |
99 | RP->Xsize = RP->Xsize / 2 + 1; |
103 | RP->Xsize = RP->Xsize / 2 + 1; |
100 | |
104 | |
101 | if (RP->expand2x > 0) |
105 | if (RP->expand2x > 0) |
102 | { |
106 | { |
… | |
… | |
152 | |
156 | |
153 | /* allocate the map and set the floor */ |
157 | /* allocate the map and set the floor */ |
154 | make_map_floor (layout, RP->floorstyle, RP); |
158 | make_map_floor (layout, RP->floorstyle, RP); |
155 | |
159 | |
156 | /* set region */ |
160 | /* set region */ |
157 | region = RP->region; |
161 | default_region = RP->region; |
158 | |
162 | |
159 | CEDE; |
163 | CEDE; |
160 | |
164 | |
161 | /* create walls unless the wallstyle is "none" */ |
165 | /* create walls unless the wallstyle is "none" */ |
162 | if (strcmp (RP->wallstyle, "none")) |
166 | if (strcmp (RP->wallstyle, "none")) |
… | |
… | |
640 | void |
644 | void |
641 | write_map_parameters_to_string (char *buf, random_map_params *RP) |
645 | write_map_parameters_to_string (char *buf, random_map_params *RP) |
642 | { |
646 | { |
643 | char small_buf[16384]; |
647 | char small_buf[16384]; |
644 | |
648 | |
645 | sprintf (buf, "xsize %d\nysize %d\n", RP->Xsize, RP->Ysize); |
649 | sprintf (buf, "xsize %d\nysize %d\n", RP->xsize, RP->ysize); |
646 | |
650 | |
647 | if (RP->wallstyle[0]) |
651 | if (RP->wallstyle[0]) |
648 | { |
652 | { |
649 | sprintf (small_buf, "wallstyle %s\n", RP->wallstyle); |
653 | sprintf (small_buf, "wallstyle %s\n", RP->wallstyle); |
650 | strcat (buf, small_buf); |
654 | strcat (buf, small_buf); |
… | |
… | |
791 | strcat (buf, small_buf); |
795 | strcat (buf, small_buf); |
792 | } |
796 | } |
793 | |
797 | |
794 | if (RP->random_seed) |
798 | if (RP->random_seed) |
795 | { |
799 | { |
796 | sprintf (small_buf, "random_seed %d\n", RP->random_seed); |
800 | sprintf (small_buf, "random_seed %u\n", RP->random_seed); |
797 | strcat (buf, small_buf); |
801 | strcat (buf, small_buf); |
798 | } |
802 | } |
799 | |
803 | |
800 | if (RP->custom) |
804 | if (RP->custom) |
801 | { |
805 | { |
… | |
… | |
827 | int dungeon_level_n, |
831 | int dungeon_level_n, |
828 | int difficulty_n, |
832 | int difficulty_n, |
829 | int difficulty_given_n, |
833 | int difficulty_given_n, |
830 | int decoroptions_n, |
834 | int decoroptions_n, |
831 | int orientation_n, |
835 | int orientation_n, |
832 | int origin_x_n, int origin_y_n, int random_seed_n, int treasureoptions_n, float difficulty_increase) |
836 | int origin_x_n, int origin_y_n, uint32_t random_seed_n, int treasureoptions_n, float difficulty_increase) |
833 | { |
837 | { |
834 | char small_buf[16384]; |
838 | char small_buf[16384]; |
835 | |
839 | |
836 | sprintf (buf, "xsize %d\nysize %d\n", xsize_n, ysize_n); |
840 | sprintf (buf, "xsize %d\nysize %d\n", xsize_n, ysize_n); |
837 | |
841 | |
… | |
… | |
973 | } |
977 | } |
974 | |
978 | |
975 | if (random_seed_n) |
979 | if (random_seed_n) |
976 | { |
980 | { |
977 | /* Add one so that the next map is a bit different */ |
981 | /* Add one so that the next map is a bit different */ |
978 | sprintf (small_buf, "random_seed %d\n", random_seed_n + 1); |
982 | sprintf (small_buf, "random_seed %u\n", random_seed_n + 1); |
979 | strcat (buf, small_buf); |
983 | strcat (buf, small_buf); |
980 | } |
984 | } |
981 | |
985 | |
982 | if (treasureoptions_n) |
986 | if (treasureoptions_n) |
983 | { |
987 | { |