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.34 by root, Fri Jul 2 15:03:57 2010 UTC vs.
Revision 1.36 by root, Fri Jul 2 17:18:04 2010 UTC

158 158
159// use this in new code 159// use this in new code
160INTERFACE_CLASS(layout) 160INTERFACE_CLASS(layout)
161struct layout 161struct layout
162{ 162{
163 char **col; 163 typedef char cell;
164
165 cell **data;
164 int w, h; 166 int w, h;
165 167
166 layout (int w, int h); 168 layout (int w, int h);
169 layout (layout &copy);
167 ~layout (); 170 ~layout ();
168 171
169 operator char **() const 172 operator cell **() const
170 { 173 {
171 return col; 174 return data;
172 } 175 }
173 176
174 void swap (layout &maze) 177 void swap (layout &maze)
175 { 178 {
176 ::swap (maze.col, col); 179 ::swap (maze.data, data);
177 ::swap (maze.w , w ); 180 ::swap (maze.w , w );
178 ::swap (maze.h , h ); 181 ::swap (maze.h , h );
179 } 182 }
183
184 MTH void swap (layout *maze) { swap (*maze); }
180 185
181 // for debugging, print maze to stdout 186 // for debugging, print maze to stdout
182 MTH void print () const; 187 MTH void print () const;
183 188
184 // simple inpainting 189 // simple inpainting
203 MTH void expand2x (); 208 MTH void expand2x ();
204 MTH void symmetrize (int symmetry); 209 MTH void symmetrize (int symmetry);
205 MTH void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees 210 MTH void rotate (int rotation); // rotate by 1=90, 2=180, 3=270 degrees
206 211
207 void generate (random_map_params *RP); 212 void generate (random_map_params *RP);
213private:
214 void alloc (int w, int h);
208}; 215};
209 216
210// utility functions, to use rmg_rndm instead of rndm. 217// utility functions, to use rmg_rndm instead of rndm.
211static inline int 218static inline int
212rmg_find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop) 219rmg_find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines