ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/room_gen_onion.C
(Generate patch)

Comparing deliantra/server/random_maps/room_gen_onion.C (file contents):
Revision 1.22 by root, Fri Mar 26 01:04:44 2010 UTC vs.
Revision 1.25 by root, Sun Aug 22 20:23:06 2010 UTC

49 49
50*/ 50*/
51 51
52 52
53#include <global.h> 53#include <global.h>
54#include <random_map.h> 54#include <rmg.h>
55#include <rproto.h> 55#include <rproto.h>
56 56
57static void centered_onion (char **maze, int xsize, int ysize, int option, int layers); 57static void centered_onion (char **maze, int xsize, int ysize, int option, int layers);
58static void bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers); 58static void bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers);
59static void bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers); 59static void bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers);
60 60
61static void draw_onion (char **maze, float *xlocations, float *ylocations, int layers); 61static void draw_onion (char **maze, float *xlocations, float *ylocations, int layers);
62static void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options); 62static void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options);
63 63
64void 64void
65map_gen_onion (Layout maze, int option, int layers) 65map_gen_onion (layout &maze, int option, int layers)
66{ 66{
67 int i, j; 67 int i, j;
68 68
69 int xsize = maze->w; 69 int xsize = maze.w;
70 int ysize = maze->h; 70 int ysize = maze.h;
71 71
72 maze->clear (); 72 maze.clear ();
73 73
74 /* pick some random options if option = 0 */ 74 /* pick some random options if option = 0 */
75 if (option == 0) 75 if (option == 0)
76 { 76 {
77 switch (rmg_rndm (3)) 77 switch (rmg_rndm (3))
91 if (rmg_rndm (2)) option |= RMOPT_IRR_SPACE; 91 if (rmg_rndm (2)) option |= RMOPT_IRR_SPACE;
92 } 92 }
93 93
94 /* write the outer walls, if appropriate. */ 94 /* write the outer walls, if appropriate. */
95 if (!(option & RMOPT_WALL_OFF)) 95 if (!(option & RMOPT_WALL_OFF))
96 maze->border (); 96 maze.border ();
97 97
98 if (option & RMOPT_WALLS_ONLY) 98 if (option & RMOPT_WALLS_ONLY)
99 return; 99 return;
100 100
101 /* pick off the mutually exclusive options */ 101 /* pick off the mutually exclusive options */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines