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

Comparing deliantra/server/random_maps/room_gen_spiral.C (file contents):
Revision 1.7 by pippijn, Mon Jan 15 21:06:19 2007 UTC vs.
Revision 1.9 by root, Sat Jan 27 02:19:37 2007 UTC

82 SizeY = ysize / 2 - 2; 82 SizeY = ysize / 2 - 2;
83 83
84 /* select random options if necessary */ 84 /* select random options if necessary */
85 if (option == 0) 85 if (option == 0)
86 { 86 {
87 option = RANDOM () % MAX_SPIRAL_OPT; 87 option = rndm (MAX_SPIRAL_OPT);
88 } 88 }
89 89
90 /* the order in which these are evaluated matters */ 90 /* the order in which these are evaluated matters */
91 91
92 /* the following two are mutually exclusive. 92 /* the following two are mutually exclusive.
93 pick one if they're both set. */ 93 pick one if they're both set. */
94 if ((option & REGULAR_SPIRAL) && (option & FIT_SPIRAL)) 94 if ((option & REGULAR_SPIRAL) && (option & FIT_SPIRAL))
95 { 95 {
96 /* unset REGULAR_SPIRAL half the time */ 96 /* unset REGULAR_SPIRAL half the time */
97 if (RANDOM () % 2 && (option & REGULAR_SPIRAL)) 97 if (rndm (2) && (option & REGULAR_SPIRAL))
98 option -= REGULAR_SPIRAL; 98 option -= REGULAR_SPIRAL;
99 else 99 else
100 option -= FIT_SPIRAL; 100 option -= FIT_SPIRAL;
101 } 101 }
102 102
103 xscale = yscale = MAX_FINE; /* fine spiral */ 103 xscale = yscale = MAX_FINE; /* fine spiral */
104 104
105 /* choose the spiral pitch */ 105 /* choose the spiral pitch */
106 if (!(option & FINE_SPIRAL)) 106 if (!(option & FINE_SPIRAL))
107 { 107 {
108 float pitch = (RANDOM () % 5) / 10. + 10. / 22.; 108 float pitch = (rndm (5)) / 10. + 10. / 22.;
109 109
110 xscale = yscale = pitch; 110 xscale = yscale = pitch;
111 } 111 }
112 112
113 if ((option & FIT_SPIRAL) && (xsize != ysize)) 113 if ((option & FIT_SPIRAL) && (xsize != ysize))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines