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.19 by root, Fri Nov 6 13:03:34 2009 UTC vs.
Revision 1.20 by root, Sat Nov 7 18:30:05 2009 UTC

50*/ 50*/
51 51
52 52
53#include <global.h> 53#include <global.h>
54#include <random_map.h> 54#include <random_map.h>
55 55#include <rproto.h>
56#ifndef MIN
57# define MIN(x,y) (((x)<(y))? (x):(y))
58#endif
59 56
60static 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);
61static 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);
62static 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);
63 60
113static void 110static void
114centered_onion (char **maze, int xsize, int ysize, int option, int layers) 111centered_onion (char **maze, int xsize, int ysize, int option, int layers)
115{ 112{
116 int i, maxlayers; 113 int i, maxlayers;
117 114
118 maxlayers = (MIN (xsize, ysize) - 2) / 5; 115 maxlayers = (min (xsize, ysize) - 2) / 5;
119 116
120 if (!maxlayers) 117 if (!maxlayers)
121 return; /* map too small to onionize */ 118 return; /* map too small to onionize */
122 119
123 if (layers > maxlayers) 120 if (layers > maxlayers)
185static void 182static void
186bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers) 183bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
187{ 184{
188 int i, maxlayers; 185 int i, maxlayers;
189 186
190 maxlayers = (MIN (xsize, ysize) - 2) / 5; 187 maxlayers = (min (xsize, ysize) - 2) / 5;
191 188
192 if (!maxlayers) 189 if (!maxlayers)
193 return; /* map too small to onionize */ 190 return; /* map too small to onionize */
194 191
195 if (layers > maxlayers) 192 if (layers > maxlayers)
413static void 410static void
414bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers) 411bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
415{ 412{
416 int i, maxlayers; 413 int i, maxlayers;
417 414
418 maxlayers = (MIN (xsize, ysize) - 2) / 5; 415 maxlayers = (min (xsize, ysize) - 2) / 5;
419 416
420 if (!maxlayers) 417 if (!maxlayers)
421 return; /* map too small to onionize */ 418 return; /* map too small to onionize */
422 419
423 if (layers > maxlayers) 420 if (layers > maxlayers)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines