… | |
… | |
60 | ++(*cx); |
60 | ++(*cx); |
61 | |
61 | |
62 | /* cx and cy should now be the top-right corner of the onion layer */ |
62 | /* cx and cy should now be the top-right corner of the onion layer */ |
63 | } |
63 | } |
64 | |
64 | |
65 | Maze |
65 | void |
66 | make_square_spiral_layout (int xsize, int ysize, int options) |
66 | make_square_spiral_layout (Maze maze, int options) |
67 | { |
67 | { |
68 | int i, j; |
68 | int i, j; |
69 | int cx, cy; |
69 | int cx, cy; |
70 | int tx, ty; |
70 | int tx, ty; |
71 | |
71 | |
72 | /* generate and allocate a doorless, centered onion */ |
72 | /* generate and allocate a doorless, centered onion */ |
73 | Maze maze = map_gen_onion (xsize, ysize, RMOPT_CENTERED | RMOPT_NO_DOORS, 0); |
73 | map_gen_onion (maze, RMOPT_CENTERED | RMOPT_NO_DOORS, 0); |
|
|
74 | |
|
|
75 | int xsize = maze->w; |
|
|
76 | int ysize = maze->h; |
74 | |
77 | |
75 | /* find the layout center. */ |
78 | /* find the layout center. */ |
76 | cx = 0; |
79 | cx = 0; |
77 | cy = 0; |
80 | cy = 0; |
78 | for (i = 0; i < xsize; i++) |
81 | for (i = 0; i < xsize; i++) |
… | |
… | |
127 | else |
130 | else |
128 | { |
131 | { |
129 | maze[cx][cy] = '<'; |
132 | maze[cx][cy] = '<'; |
130 | maze[xsize - 2][1] = '>'; |
133 | maze[xsize - 2][1] = '>'; |
131 | } |
134 | } |
132 | |
|
|
133 | return maze; |
|
|
134 | } |
135 | } |
135 | |
136 | |