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.2 by root, Sun Sep 10 16:06:37 2006 UTC vs.
Revision 1.5 by root, Sun Dec 31 19:02:24 2006 UTC

151connect_spirals (int xsize, int ysize, int sym, char **layout) 151connect_spirals (int xsize, int ysize, int sym, char **layout)
152{ 152{
153 153
154 int i, j, ic = xsize / 2, jc = ysize / 2; 154 int i, j, ic = xsize / 2, jc = ysize / 2;
155 155
156 if (sym == X_SYM) 156 if (sym == SYMMETRY_X)
157 { 157 {
158 layout[ic][jc] = 0; 158 layout[ic][jc] = 0;
159 /* go left from map center */ 159 /* go left from map center */
160 for (i = ic - 1, j = jc; i > 0 && layout[i][j] == '#'; i--) 160 for (i = ic - 1, j = jc; i > 0 && layout[i][j] == '#'; i--)
161 layout[i][j] = 0; 161 layout[i][j] = 0;
162 /* go right */ 162 /* go right */
163 for (i = ic + 1, j = jc; i < xsize - 1 && layout[i][j] == '#'; i++) 163 for (i = ic + 1, j = jc; i < xsize - 1 && layout[i][j] == '#'; i++)
164 layout[i][j] = 0; 164 layout[i][j] = 0;
165 } 165 }
166 166
167 if (sym == Y_SYM) 167 if (sym == SYMMETRY_Y)
168 { 168 {
169 169
170 layout[ic][jc] = 0; 170 layout[ic][jc] = 0;
171 /* go up */ 171 /* go up */
172 for (i = ic, j = jc - 1; j > 0 && layout[i][j] == '#'; j--) 172 for (i = ic, j = jc - 1; j > 0 && layout[i][j] == '#'; j--)
174 /* go down */ 174 /* go down */
175 for (i = ic, j = jc + 1; j < ysize - 1 && layout[i][j] == '#'; j++) 175 for (i = ic, j = jc + 1; j < ysize - 1 && layout[i][j] == '#'; j++)
176 layout[i][j] = 0; 176 layout[i][j] = 0;
177 } 177 }
178 178
179 if (sym == XY_SYM) 179 if (sym == SYMMETRY_XY)
180 { 180 {
181 /* go left from map center */ 181 /* go left from map center */
182 layout[ic][jc / 2] = 0; 182 layout[ic][jc / 2] = 0;
183 layout[ic / 2][jc] = 0; 183 layout[ic / 2][jc] = 0;
184 layout[ic][jc / 2 + jc] = 0; 184 layout[ic][jc / 2 + jc] = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines