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

Comparing deliantra/server/random_maps/random_map.h (file contents):
Revision 1.33 by root, Fri Jul 2 03:40:14 2010 UTC vs.
Revision 1.34 by root, Fri Jul 2 15:03:57 2010 UTC

150// \0 floor only 150// \0 floor only
151// # wall 151// # wall
152// D door 152// D door
153// < up 153// < up
154// > down 154// > down
155// C "center" (of onion layout) 155// C "center" (of onion maze)
156// . ?? (rogue) 156// . ?? (rogue)
157// 157//
158 158
159// use this in new code 159// use this in new code
160INTERFACE_CLASS(layout)
160struct Layout 161struct layout
161{ 162{
162 char **col; 163 char **col;
163 int w, h; 164 int w, h;
164 165
165 Layout (int w, int h); 166 layout (int w, int h);
166 ~Layout (); 167 ~layout ();
167 168
168 operator char **() const 169 operator char **() const
169 { 170 {
170 return col; 171 return col;
171 } 172 }
172 173
173 void swap (Layout &layout) 174 void swap (layout &maze)
174 { 175 {
175 ::swap (layout.col, col); 176 ::swap (maze.col, col);
176 ::swap (layout.w , w ); 177 ::swap (maze.w , w );
177 ::swap (layout.h , h ); 178 ::swap (maze.h , h );
178 } 179 }
179 180
180 // for debugging, print layout to stdout 181 // for debugging, print maze to stdout
181 void print () const; 182 MTH void print () const;
182 183
183 // simple inpainting 184 // simple inpainting
184 void fill (char fill); 185 MTH void fill (char fill);
185 void clear () { fill (0); } 186 MTH void clear () { fill (0); }
186 void border (char fill = '#'); 187 MTH void border (char fill = '#');
187 void rect (int x1, int y1, int x2, int y2, char fill); // x2, y2 exclusive 188 MTH void rect (int x1, int y1, int x2, int y2, char fill); // x2, y2 exclusive
188 189
189 void fill_rand (int perc); 190 MTH void fill_rand (int perc);
190 191
191 // makes sure all areas are connected. dirty=true carves rounder but also 192 // makes sure all areas are connected. dirty=true carves rounder but also
192 // more walls, dirty=false carves narrow corridors. 193 // more walls, dirty=false carves narrow corridors.
193 void isolation_remover (bool dirty = 0); 194 MTH void isolation_remover (bool dirty = 0);
194 195
195 // generates a cave, subtype 0 is a rough cave, randomly open or closed 196 // generates a cave, subtype 0 is a rough cave, randomly open or closed
196 void gen_cave (int subtype); 197 MTH void gen_cave (int subtype);
197 198
198 // helper functions to modify the layout 199 // helper functions to modify the maze
199 void erode_1_2 (int c1, int c2 = -1, int repeat = 1); 200 MTH void erode_1_2 (int c1, int c2 = -1, int repeat = 1);
200 void doorify (); 201 MTH void doorify ();
201 void roomify (); // make some rooms in it, works best on onions 202 MTH void roomify (); // make some rooms in it, works best on onions
202 void expand2x (); 203 MTH void expand2x ();
203 void symmetrize (int symmetry); 204 MTH void symmetrize (int symmetry);
204 void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees 205 MTH void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees
205 206
206 void generate (random_map_params *RP); 207 void generate (random_map_params *RP);
207}; 208};
208 209
209// utility functions, to use rmg_rndm instead of rndm. 210// utility functions, to use rmg_rndm instead of rndm.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines