… | |
… | |
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, char *floorstyle, random_map_params *RP) |
32 | { |
32 | { |
33 | char styledirname[1024]; |
|
|
34 | char stylefilepath[1024]; |
|
|
35 | maptile *style_map = 0; |
|
|
36 | object *the_floor; |
33 | object *the_floor; |
37 | |
34 | |
38 | clear (); |
35 | clear (); |
39 | |
36 | |
40 | width = RP->Xsize; |
37 | width = RP->Xsize; |
41 | height = RP->Ysize; |
38 | height = RP->Ysize; |
42 | |
39 | |
43 | alloc (); |
40 | alloc (); |
44 | |
41 | |
45 | /* get the style map */ |
42 | /* get the style map */ |
46 | sprintf (styledirname, "%s", "/styles/floorstyles"); |
|
|
47 | sprintf (stylefilepath, "%s/%s", styledirname, floorstyle); |
|
|
48 | |
|
|
49 | style_map = find_style (styledirname, floorstyle, -1); |
43 | maptile *style_map = find_style ("/styles/floorstyles", floorstyle, -1); |
50 | |
|
|
51 | if (!style_map) |
44 | if (!style_map) |
52 | return; |
45 | return; |
53 | |
46 | |
54 | /* fill up the map with the given floor style */ |
47 | /* fill up the map with the given floor style */ |
55 | if ((the_floor = style_map->pick_random_object (rmg_rndm))) |
48 | if ((the_floor = style_map->pick_random_object (rmg_rndm))) |