… | |
… | |
26 | #include <random_map.h> |
26 | #include <random_map.h> |
27 | #include <rproto.h> |
27 | #include <rproto.h> |
28 | |
28 | |
29 | /* make a map and layout the floor. */ |
29 | /* make a map and layout the floor. */ |
30 | void |
30 | void |
31 | maptile::make_map_floor (char **layout, char *floorstyle, random_map_params *RP) |
31 | maptile::make_map_floor (char **layout, const char *floorstyle, random_map_params *RP) |
32 | { |
32 | { |
33 | object *the_floor; |
|
|
34 | |
|
|
35 | clear (); |
33 | clear (); |
36 | |
34 | |
37 | width = RP->Xsize; |
35 | width = RP->Xsize; |
38 | height = RP->Ysize; |
36 | height = RP->Ysize; |
39 | |
37 | |
… | |
… | |
43 | maptile *style_map = find_style ("/styles/floorstyles", floorstyle, RP->difficulty); |
41 | maptile *style_map = find_style ("/styles/floorstyles", floorstyle, RP->difficulty); |
44 | if (!style_map) |
42 | if (!style_map) |
45 | return; |
43 | return; |
46 | |
44 | |
47 | /* fill up the map with the given floor style */ |
45 | /* fill up the map with the given floor style */ |
48 | if ((the_floor = style_map->pick_random_object (rmg_rndm))) |
46 | if (object *the_floor = style_map->pick_random_object (rmg_rndm)) |
49 | for (int x = 0; x < width; x++) |
47 | for (int x = 0; x < width; x++) |
50 | for (int y = 0; y < height; y++) |
48 | for (int y = 0; y < height; y++) |
51 | insert (the_floor->clone (), x, y, 0, INS_NO_MERGE | INS_NO_WALK_ON); |
49 | insert (the_floor->clone (), x, y, 0, INS_NO_MERGE | INS_NO_WALK_ON); |
52 | } |
50 | } |