perim2 = snewn(nperim, struct xyd);
memcpy(perim2, perimeter, nperim * sizeof(struct xyd));
/* Shuffle the perimeter, so as to search it without directional bias. */
- for (i = nperim; --i ;) {
- int j = random_upto(rs, i+1);
- struct xyd t;
-
- t = perim2[j];
- perim2[j] = perim2[i];
- perim2[i] = t;
- }
+ shuffle(perim2, nperim, sizeof(*perim2), rs);
for (i = 0; i < nperim; i++) {
int x2, y2;
* Draw each radial line.
*/
if (drawlines) {
- print_line_width(dr, thick * 2);
for (k = 1; k < 16; k *= 2)
if (v & k) {
int x1 = min(cx, cx + (r-thick) * X(k));
/* Ick: fake up `ds->tilesize' for macro expansion purposes */
game_drawstate ads, *ds = &ads;
- ads.tilesize = tilesize;
+ game_set_size(dr, ds, NULL, tilesize);
/*
* Border.
for (y = 0; y <= h; y++)
for (x = 0; x <= w; x++) {
int b = barrier(state, x % w, y % h);
- fprintf(stderr, "%d,%d: %d\n", x, y, b);
if (x < w && (b & U))
draw_rect(dr, WINDOW_OFFSET + TILE_SIZE * x - TILE_SIZE/24,
WINDOW_OFFSET + TILE_SIZE * y - TILE_SIZE/24,