ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/server/random_maps/floor.C
(Generate patch)

Comparing cf.schmorp.de/server/random_maps/floor.C (file contents):
Revision 1.24 by root, Sat Apr 10 01:54:07 2010 UTC vs.
Revision 1.25 by root, Sat Jun 26 22:10:18 2010 UTC

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. */
30void 30void
31maptile::make_map_floor (char **layout, char *floorstyle, random_map_params *RP) 31maptile::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}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines